From 617f0d65b20b7b405b1acecea6f99ccd0a6d73f3 Mon Sep 17 00:00:00 2001 From: johannst Date: Thu, 5 Jan 2023 20:25:01 +0000 Subject: deploy: 802cca1963bc27f8ea4e4923029909e45464d3df --- ayu.css | 2 +- dark.css | 2 +- down-arrow.svg | 2 +- implementors/core/clone/trait.Clone.js | 6 +- implementors/core/cmp/trait.PartialEq.js | 6 +- implementors/core/convert/trait.TryFrom.js | 6 +- implementors/core/fmt/trait.Debug.js | 6 +- implementors/core/marker/trait.Copy.js | 6 +- implementors/core/marker/trait.Freeze.js | 6 +- implementors/core/marker/trait.Send.js | 6 +- .../core/marker/trait.StructuralPartialEq.js | 6 +- implementors/core/marker/trait.Sync.js | 6 +- implementors/core/marker/trait.Unpin.js | 6 +- implementors/core/ops/deref/trait.Deref.js | 6 +- implementors/core/ops/drop/trait.Drop.js | 6 +- .../core/panic/unwind_safe/trait.RefUnwindSafe.js | 6 +- .../core/panic/unwind_safe/trait.UnwindSafe.js | 6 +- light.css | 2 +- llvm_kaleidoscope_rs/all.html | 9 +- llvm_kaleidoscope_rs/codegen/index.html | 12 +- llvm_kaleidoscope_rs/codegen/struct.Codegen.html | 27 +- llvm_kaleidoscope_rs/constant.SMALL_STR_SIZE.html | 12 +- llvm_kaleidoscope_rs/enum.Either.html | 25 +- llvm_kaleidoscope_rs/index.html | 18 +- llvm_kaleidoscope_rs/lexer/enum.Token.html | 37 +- llvm_kaleidoscope_rs/lexer/index.html | 12 +- llvm_kaleidoscope_rs/lexer/struct.Lexer.html | 25 +- .../llvm/fn.initialize_native_taget.html | 12 +- llvm_kaleidoscope_rs/llvm/fn.shutdown.html | 12 +- llvm_kaleidoscope_rs/llvm/index.html | 26 +- llvm_kaleidoscope_rs/llvm/struct.BasicBlock.html | 32 +- llvm_kaleidoscope_rs/llvm/struct.FnValue.html | 56 +- .../llvm/struct.FunctionPassManager.html | 30 +- llvm_kaleidoscope_rs/llvm/struct.IRBuilder.html | 54 +- llvm_kaleidoscope_rs/llvm/struct.LLJit.html | 33 +- llvm_kaleidoscope_rs/llvm/struct.Module.html | 42 +- llvm_kaleidoscope_rs/llvm/struct.PhiValue.html | 46 +- .../llvm/struct.ResourceTracker.html | 26 +- llvm_kaleidoscope_rs/llvm/struct.Type.html | 34 +- llvm_kaleidoscope_rs/llvm/struct.Value.html | 42 +- llvm_kaleidoscope_rs/parser/enum.ExprAST.html | 67 +- llvm_kaleidoscope_rs/parser/index.html | 17 +- .../parser/struct.FunctionAST.html | 31 +- llvm_kaleidoscope_rs/parser/struct.Parser.html | 35 +- .../parser/struct.PrototypeAST.html | 36 +- llvm_kaleidoscope_rs/struct.SmallCStr.html | 39 +- main.js | 8 +- rustdoc.css | 2 +- search-index.js | 2 +- search.js | 2 +- settings.css | 2 +- settings.html | 9 +- settings.js | 2 +- source-files.js | 5 +- source-script.js | 2 +- src/llvm_kaleidoscope_rs/codegen.rs.html | 521 ++++++------ src/llvm_kaleidoscope_rs/lexer.rs.html | 307 ++++--- src/llvm_kaleidoscope_rs/lib.rs.html | 175 ++-- src/llvm_kaleidoscope_rs/llvm/basic_block.rs.html | 69 +- src/llvm_kaleidoscope_rs/llvm/builder.rs.html | 423 +++++----- src/llvm_kaleidoscope_rs/llvm/lljit.rs.html | 217 +++-- src/llvm_kaleidoscope_rs/llvm/mod.rs.html | 115 ++- src/llvm_kaleidoscope_rs/llvm/module.rs.html | 325 ++++---- src/llvm_kaleidoscope_rs/llvm/pass_manager.rs.html | 115 ++- src/llvm_kaleidoscope_rs/llvm/type_.rs.html | 95 +-- src/llvm_kaleidoscope_rs/llvm/value.rs.html | 361 ++++---- src/llvm_kaleidoscope_rs/parser.rs.html | 915 ++++++++++----------- storage.js | 2 +- 68 files changed, 2043 insertions(+), 2570 deletions(-) diff --git a/ayu.css b/ayu.css index a9c9be0..336031a 100644 --- a/ayu.css +++ b/ayu.css @@ -1 +1 @@ - body,#settings-menu #settings,#settings-menu #settings::before{background-color:#0f1419;color:#c5c5c5;}.setting-line .radio-line input{border-color:#c5c5c5;}.setting-line .radio-line input:checked{box-shadow:inset 0 0 0 3px #0f1419;background-color:#ffb454;}.setting-line .radio-line input:focus{box-shadow:0 0 1px 1px #ffb454;}.setting-line .radio-line input:checked:focus{box-shadow:inset 0 0 0 3px 0f1419,0 0 2px 2px #ffb454;}.setting-line .radio-line input:hover{border-color:#ffb454 !important;}.slider{background-color:#ccc;}.slider:before{background-color:white;}input:checked+.slider{background-color:#ffb454;}input:focus+.slider{box-shadow:0 0 0 2px #0a84ff,0 0 0 6px rgba(10,132,255,0.3);}h1,h2,h3,h4{color:white;}h1.fqn{border-bottom-color:#5c6773;}h1.fqn a{color:#fff;}h2,h3,h4{border-bottom-color:#5c6773;}h4{border:none;}.in-band{background-color:#0f1419;}.invisible{background:rgba(0,0,0,0);}.docblock code{color:#ffb454;}.code-header{color:#e6e1cf;}.docblock pre>code,pre>code{color:#e6e1cf;}span code{color:#e6e1cf;}.docblock a>code{color:#39AFD7 !important;}.docblock code,.docblock-short code{background-color:#191f26;}pre,.rustdoc.source .example-wrap{color:#e6e1cf;background-color:#191f26;}.sidebar,.mobile-topbar,.sidebar-menu-toggle{background-color:#14191f;}.rust-logo{filter:drop-shadow(1px 0 0px #fff) drop-shadow(0 1px 0 #fff) drop-shadow(-1px 0 0 #fff) drop-shadow(0 -1px 0 #fff);}*{scrollbar-color:#5c6773 #24292f;}.sidebar{scrollbar-color:#5c6773 #24292f;}::-webkit-scrollbar-track{background-color:transparent;}::-webkit-scrollbar-thumb{background-color:#5c6773;}.sidebar::-webkit-scrollbar-track{background-color:transparent;}.sidebar::-webkit-scrollbar-thumb{background-color:#5c6773;}.sidebar .current,.sidebar a:hover{background-color:transparent;color:#ffb44c;}.source .sidebar{background-color:#14191f;}.sidebar-elems .location{color:#ff7733;}.line-numbers span{color:#5c6773;}.line-numbers .line-highlighted{color:#708090;background-color:rgba(255,236,164,0.06);padding-right:4px;border-right:1px solid #ffb44c;}.docblock h1,.docblock h2,.docblock h3,.docblock h4,.docblock h5,.docblock h6{border-bottom-color:#5c6773;}.docblock table td,.docblock table th{border-color:#5c6773;}.content .method .where,.content .fn .where,.content .where.fmt-newline{color:#c5c5c5;}.search-results a:hover{background-color:#777;}.search-results a:focus{color:#000 !important;background-color:#c6afb3;}.search-results a{color:#0096cf;}.search-results a div.desc{color:#c5c5c5;}.content .item-info::before{color:#ccc;}.content span.foreigntype,.content a.foreigntype{color:#ffa0a5;}.content span.union,.content a.union{color:#ffa0a5;}.content span.constant,.content a.constant,.content span.static,.content a.static{color:#39AFD7;}.content span.primitive,.content a.primitive{color:#ffa0a5;}.content span.traitalias,.content a.traitalias{color:#39AFD7;}.content span.keyword,.content a.keyword{color:#39AFD7;}.content span.externcrate,.content span.mod,.content a.mod{color:#39AFD7;}.content span.struct,.content a.struct{color:#ffa0a5;}.content span.enum,.content a.enum{color:#ffa0a5;}.content span.trait,.content a.trait{color:#39AFD7;}.content span.type,.content a.type{color:#39AFD7;}.content span.type,.content a.type,.block a.current.type{color:#39AFD7;}.content span.associatedtype,.content a.associatedtype,.block a.current.associatedtype{color:#39AFD7;}.content span.fn,.content a.fn,.content span.method,.content a.method,.content span.tymethod,.content a.tymethod,.content .fnname{color:#fdd687;}.content span.attr,.content a.attr,.content span.derive,.content a.derive,.content span.macro,.content a.macro{color:#a37acc;}.sidebar a{color:#53b1db;}.sidebar a.current.type{color:#53b1db;}.sidebar a.current.associatedtype{color:#53b1db;}pre.rust .comment{color:#788797;}pre.rust .doccomment{color:#a1ac88;}nav.main .current{border-top-color:#5c6773;border-bottom-color:#5c6773;}nav.main .separator{border:1px solid #5c6773;}a{color:#39AFD7;}a#toggle-all-docs,a.anchor,.small-section-header a,#source-sidebar a,pre.rust a,.sidebar h2 a,.sidebar h3 a,.mobile-topbar h2 a,.in-band a{color:#c5c5c5;}.sidebar h2 a,.sidebar h3 a{color:white;}.search-results a{color:#0096cf;}body.source .example-wrap pre.rust a{background:#333;}details.rustdoc-toggle>summary.hideme>span,details.rustdoc-toggle>summary::before,details.undocumented>summary::before{color:#999;}details.rustdoc-toggle>summary::before,details.undocumented>summary::before{filter:invert(100%);}#crate-search,.search-input{background-color:#141920;border-color:#424c57 !important;}.search-input{color:#ffffff;}.module-item .stab,.import-item .stab{color:#000;}.stab.empty-impl{}.stab.unstable,.stab.deprecated,.stab.portability,.stab.empty-impl{color:#c5c5c5;background:#314559 !important;border-style:none !important;border-radius:4px;padding:3px 6px 3px 6px;}.stab.portability>code{color:#e6e1cf;background:none;}#help>div{background:#14191f;box-shadow:0px 6px 20px 0px black;border:none;border-radius:4px;}#help span.bottom,#help span.top{border-color:#5c6773;}.rightside,.out-of-band{color:grey;}.result-name .primitive>i,.result-name .keyword>i{color:#788797;}.line-numbers :target{background-color:transparent;}pre.rust .number,pre.rust .string{color:#b8cc52;}pre.rust .kw,pre.rust .kw-2,pre.rust .prelude-ty,pre.rust .bool-val,pre.rust .prelude-val,pre.rust .op,pre.rust .lifetime{color:#ff7733;}pre.rust .macro,pre.rust .macro-nonterminal{color:#a37acc;}pre.rust .question-mark{color:#ff9011;}pre.rust .self{color:#36a3d9;font-style:italic;}pre.rust .attribute{color:#e6e1cf;}pre.rust .attribute .ident,pre.rust .attribute .op{color:#e6e1cf;}.example-wrap>pre.line-number{color:#5c67736e;border:none;}a.test-arrow{font-size:100%;color:#788797;border-radius:4px;background-color:rgba(57,175,215,0.09);}a.test-arrow:hover{background-color:rgba(57,175,215,0.368);color:#c5c5c5;}.toggle-label,.code-attribute{color:#999;}:target{background:rgba(255,236,164,0.06);border-right:3px solid rgba(255,180,76,0.85);}pre.compile_fail{border-left:2px solid rgba(255,0,0,.4);}pre.compile_fail:hover,.information:hover+pre.compile_fail{border-left:2px solid #f00;}pre.should_panic{border-left:2px solid rgba(255,0,0,.4);}pre.should_panic:hover,.information:hover+pre.should_panic{border-left:2px solid #f00;}pre.ignore{border-left:2px solid rgba(255,142,0,.6);}pre.ignore:hover,.information:hover+pre.ignore{border-left:2px solid #ff9200;}.tooltip.compile_fail{color:rgba(255,0,0,.5);}.information>.compile_fail:hover{color:#f00;}.tooltip.should_panic{color:rgba(255,0,0,.5);}.information>.should_panic:hover{color:#f00;}.tooltip.ignore{color:rgba(255,142,0,.6);}.information>.ignore:hover{color:#ff9200;}.search-failed a{color:#39AFD7;}.tooltip::after{background-color:#314559;color:#c5c5c5;border:1px solid #5c6773;}.tooltip::before{border-color:transparent #314559 transparent transparent;}.notable-traits-tooltiptext{background-color:#314559;border-color:#5c6773;}.notable-traits-tooltiptext .notable{border-bottom-color:#5c6773;}#titles>button.selected{background-color:#141920 !important;border-bottom:1px solid #ffb44c !important;border-top:none;}#titles>button:not(.selected){background-color:transparent !important;border:none;}#titles>button:hover{border-bottom:1px solid rgba(242,151,24,0.3);}#titles>button>div.count{color:#888;}.search-input:focus{}.content span.attr,.content a.attr,.block a.current.attr,.content span.derive,.content a.derive,.block a.current.derive,.content span.macro,.content a.macro,.block a.current.macro{}.content span.struct,.content a.struct,.block a.current.struct{}#titles>button:hover,#titles>button.selected{}.content span.typedef,.content a.typedef,.block a.current.typedef{}.content span.union,.content a.union,.block a.current.union{}pre.rust .lifetime{}.stab.unstable{}h2,h3:not(.impl):not(.method):not(.type):not(.tymethod),h4:not(.method):not(.type):not(.tymethod){}.content span.enum,.content a.enum,.block a.current.enum{}.content span.constant,.content a.constant,.block a.current.constant,.content span.static,.content a.static,.block a.current.static{}.content span.keyword,.content a.keyword,.block a.current.keyword{}pre.rust .comment{}.content span.traitalias,.content a.traitalias,.block a.current.traitalias{}.content span.fn,.content a.fn,.block a.current.fn,.content span.method,.content a.method,.block a.current.method,.content span.tymethod,.content a.tymethod,.block a.current.tymethod,.content .fnname{}pre.rust .kw{}pre.rust .self,pre.rust .bool-val,pre.rust .prelude-val,pre.rust .attribute,pre.rust .attribute .ident{}.content span.foreigntype,.content a.foreigntype,.block a.current.foreigntype{}pre.rust .doccomment{}.stab.deprecated{}.content a.attr,.content a.derive,.content a.macro{}.stab.portability{}.content span.primitive,.content a.primitive,.block a.current.primitive{}.content span.externcrate,.content span.mod,.content a.mod,.block a.current.mod{}pre.rust .kw-2,pre.rust .prelude-ty{}.content span.trait,.content a.trait,.block a.current.trait{}.search-results a:focus span{}a.result-trait:focus{}a.result-traitalias:focus{}a.result-mod:focus,a.result-externcrate:focus{}a.result-mod:focus{}a.result-externcrate:focus{}a.result-enum:focus{}a.result-struct:focus{}a.result-union:focus{}a.result-fn:focus,a.result-method:focus,a.result-tymethod:focus{}a.result-type:focus{}a.result-associatedtype:focus{}a.result-foreigntype:focus{}a.result-attr:focus,a.result-derive:focus,a.result-macro:focus{}a.result-constant:focus,a.result-static:focus{}a.result-primitive:focus{}a.result-keyword:focus{}.sidebar a.current.enum{}.sidebar a.current.struct{}.sidebar a.current.foreigntype{}.sidebar a.current.attr,.sidebar a.current.derive,.sidebar a.current.macro{}.sidebar a.current.union{}.sidebar a.current.constant .sidebar a.current.static{}.sidebar a.current.primitive{}.sidebar a.current.externcrate .sidebar a.current.mod{}.sidebar a.current.trait{}.sidebar a.current.traitalias{}.sidebar a.current.fn,.sidebar a.current.method,.sidebar a.current.tymethod{}.sidebar a.current.keyword{}@media (max-width:700px){.sidebar-menu{background-color:#14191f;border-bottom-color:#5c6773;border-right-color:#5c6773;}.sidebar-elems{background-color:#14191f;border-right-color:#5c6773;}#sidebar-filler{background-color:#14191f;border-bottom-color:#5c6773;}}kbd{color:#c5c5c5;background-color:#314559;border-color:#5c6773;border-bottom-color:#5c6773;box-shadow:inset 0 -1px 0 #5c6773;}#settings-menu>a,#help-button{border-color:#5c6773;background-color:#0f1419;color:#fff;}#settings-menu>a img{filter:invert(100);}#settings-menu #settings,#settings-menu #settings::before{border-color:#5c6773;}#copy-path{color:#fff;}#copy-path>img{filter:invert(70%);}#copy-path:hover>img{filter:invert(100%);}#settings-menu>a:hover,#settings-menu>a:focus,#help-button:hover,#help-button:focus{border-color:#e0e0e0;}#theme-choices{border-color:#5c6773;background-color:#0f1419;}#theme-choices>button:not(:first-child){border-top-color:#5c6773;}#theme-choices>button:hover,#theme-choices>button:focus{background-color:rgba(110,110,110,0.33);}.search-results .result-name span.alias{color:#c5c5c5;}.search-results .result-name span.grey{color:#999;}#sidebar-toggle{background-color:#14191f;}#sidebar-toggle:hover{background-color:rgba(70,70,70,0.33);}#source-sidebar{background-color:#14191f;}#source-sidebar>.title{color:#fff;border-bottom-color:#5c6773;}div.files>a:hover,div.name:hover{background-color:#14191f;color:#ffb44c;}div.files>.selected{background-color:#14191f;color:#ffb44c;}.scraped-example-list .scrape-help{border-color:#aaa;color:#eee;}.scraped-example-list .scrape-help:hover{border-color:white;color:white;}.more-examples-toggle summary,.more-examples-toggle .hide-more{color:#999;}.scraped-example .example-wrap .rust span.highlight{background:rgb(91,59,1);}.scraped-example .example-wrap .rust span.highlight.focus{background:rgb(124,75,15);}.scraped-example:not(.expanded) .code-wrapper:before{background:linear-gradient(to bottom,rgba(15,20,25,1),rgba(15,20,25,0));}.scraped-example:not(.expanded) .code-wrapper:after{background:linear-gradient(to top,rgba(15,20,25,1),rgba(15,20,25,0));}.toggle-line-inner{background:#999;}.toggle-line:hover .toggle-line-inner{background:#c5c5c5;} \ No newline at end of file + :root{--main-background-color:#0f1419;--main-color:#c5c5c5;--settings-input-color:#ffb454;--sidebar-background-color:#14191f;--sidebar-background-color-hover:rgba(70,70,70,0.33);--code-block-background-color:#191f26;--scrollbar-track-background-color:transparent;--scrollbar-thumb-background-color:#5c6773;--scrollbar-color:#5c6773 #24292f;--headings-border-bottom-color:#5c6773;--border-color:#5c6773;--button-background-color:#141920;--right-side-color:grey;--code-attribute-color:#999;--toggles-color:#999;--search-input-focused-border-color:#5c6773;--copy-path-button-color:#fff;--copy-path-img-filter:invert(70%);--copy-path-img-hover-filter:invert(100%);--codeblock-error-hover-color:rgb(255,0,0);--codeblock-error-color:rgba(255,0,0,.5);--codeblock-ignore-hover-color:rgb(255,142,0);--codeblock-ignore-color:rgba(255,142,0,.6);--type-link-color:#ffa0a5;--trait-link-color:#39afd7;--assoc-item-link-color:#39afd7;--function-link-color:#fdd687;--macro-link-color:#a37acc;--keyword-link-color:#39afd7;--mod-link-color:#39afd7;--link-color:#39afd7;}.slider{background-color:#ccc;}.slider:before{background-color:white;}input:focus+.slider{box-shadow:0 0 0 2px #0a84ff,0 0 0 6px rgba(10,132,255,0.3);}h1,h2,h3,h4{color:white;}h1.fqn a{color:#fff;}h4{border:none;}.docblock code{color:#ffb454;}.code-header{color:#e6e1cf;}.docblock pre>code,pre>code{color:#e6e1cf;}.item-info code{color:#e6e1cf;}.docblock a>code{color:#39AFD7 !important;}pre,.rustdoc.source .example-wrap{color:#e6e1cf;}.rust-logo{filter:drop-shadow(1px 0 0px #fff) drop-shadow(0 1px 0 #fff) drop-shadow(-1px 0 0 #fff) drop-shadow(0 -1px 0 #fff);}.sidebar .current,.sidebar a:hover{background-color:transparent;color:#ffb44c;}.sidebar-elems .location{color:#ff7733;}.line-numbers span{color:#5c6773;}.line-numbers .line-highlighted{color:#708090;background-color:rgba(255,236,164,0.06);padding-right:4px;border-right:1px solid #ffb44c;}.search-results a:hover{color:#fff !important;background-color:#3c3c3c;}.search-results a:focus{color:#fff !important;background-color:#3c3c3c;}.search-results a{color:#0096cf;}.search-results a div.desc{color:#c5c5c5;}.content .item-info::before{color:#ccc;}.sidebar a{color:#53b1db;}.sidebar a.current.type{color:#53b1db;}pre.rust .comment{color:#788797;}pre.rust .doccomment{color:#a1ac88;}.sidebar h2 a,.sidebar h3 a{color:white;}body.source .example-wrap pre.rust a{background:#333;}details.rustdoc-toggle>summary::before{filter:invert(100%);}#crate-search-div::after{filter:invert(41%) sepia(12%) saturate(487%) hue-rotate(171deg) brightness(94%) contrast(94%);}#crate-search:hover,#crate-search:focus{border-color:#e0e0e0 !important;}#crate-search-div:hover::after,#crate-search-div:focus-within::after{filter:invert(98%) sepia(12%) saturate(81%) hue-rotate(343deg) brightness(113%) contrast(76%);}.search-input{color:#fff;}.module-item .stab,.import-item .stab{color:#000;}.stab{color:#c5c5c5;background:#314559 !important;}.stab.portability>code{color:#e6e1cf;background:none;}.result-name .primitive>i,.result-name .keyword>i{color:#788797;}.line-numbers :target{background-color:transparent;}pre.rust .number,pre.rust .string{color:#b8cc52;}pre.rust .kw,pre.rust .kw-2,pre.rust .prelude-ty,pre.rust .bool-val,pre.rust .prelude-val,pre.rust .lifetime{color:#ff7733;}pre.rust .macro,pre.rust .macro-nonterminal{color:#a37acc;}pre.rust .question-mark{color:#ff9011;}pre.rust .self{color:#36a3d9;font-style:italic;}pre.rust .attribute{color:#e6e1cf;}.example-wrap>pre.line-number{color:#5c67736e;border:none;}a.test-arrow{font-size:100%;color:#788797;border-radius:4px;background-color:rgba(57,175,215,0.09);}a.test-arrow:hover{background-color:rgba(57,175,215,0.368);color:#c5c5c5;}:target{background:rgba(255,236,164,0.06);border-right:3px solid rgba(255,180,76,0.85);}.search-failed a{color:#39AFD7;}.tooltip::after{background-color:#314559;color:#c5c5c5;}.tooltip::before{border-color:transparent #314559 transparent transparent;}.notable-traits-tooltiptext{background-color:#314559;}#titles>button.selected{background-color:#141920 !important;border-bottom:1px solid #ffb44c !important;border-top:none;}#titles>button:not(.selected){background-color:transparent !important;border:none;}#titles>button:hover{border-bottom:1px solid rgba(242,151,24,0.3);}#titles>button>div.count{color:#888;}pre.rust .lifetime{}pre.rust .kw{}#titles>button:hover,#titles>button.selected{}pre.rust .self,pre.rust .bool-val,pre.rust .prelude-val,pre.rust .attribute{}pre.rust .kw-2,pre.rust .prelude-ty{}.search-results a:focus span{}a.result-trait:focus{}a.result-traitalias:focus{}a.result-mod:focus,a.result-externcrate:focus{}a.result-mod:focus{}a.result-externcrate:focus{}a.result-enum:focus{}a.result-struct:focus{}a.result-union:focus{}a.result-fn:focus,a.result-method:focus,a.result-tymethod:focus{}a.result-type:focus{}a.result-associatedtype:focus{}a.result-foreigntype:focus{}a.result-attr:focus,a.result-derive:focus,a.result-macro:focus{}a.result-constant:focus,a.result-static:focus{}a.result-primitive:focus{}a.result-keyword:focus{}.sidebar a.current.enum{}.sidebar a.current.struct{}.sidebar a.current.foreigntype{}.sidebar a.current.attr,.sidebar a.current.derive,.sidebar a.current.macro{}.sidebar a.current.union{}.sidebar a.current.constant .sidebar a.current.static{}.sidebar a.current.primitive{}.sidebar a.current.trait{}.sidebar a.current.traitalias{}.sidebar a.current.fn{}.sidebar a.current.keyword{}kbd{color:#c5c5c5;background-color:#314559;box-shadow:inset 0 -1px 0 #5c6773;}#settings-menu>a,#help-button>button{color:#fff;}#settings-menu>a img{filter:invert(100);}#settings-menu>a:hover,#settings-menu>a:focus,#help-button>button:hover,#help-button>button:focus{border-color:#e0e0e0;}.search-results .result-name span.alias{color:#c5c5c5;}.search-results .result-name span.grey{color:#999;}#source-sidebar>.title{color:#fff;}#source-sidebar div.files>a:hover,details.dir-entry summary:hover,#source-sidebar div.files>a:focus,details.dir-entry summary:focus{background-color:#14191f;color:#ffb44c;}#source-sidebar div.files>a.selected{background-color:#14191f;color:#ffb44c;}.scraped-example-list .scrape-help{border-color:#aaa;color:#eee;}.scraped-example-list .scrape-help:hover{border-color:white;color:white;}.scraped-example .example-wrap .rust span.highlight{background:rgb(91,59,1);}.scraped-example .example-wrap .rust span.highlight.focus{background:rgb(124,75,15);}.scraped-example:not(.expanded) .code-wrapper:before{background:linear-gradient(to bottom,rgba(15,20,25,1),rgba(15,20,25,0));}.scraped-example:not(.expanded) .code-wrapper:after{background:linear-gradient(to top,rgba(15,20,25,1),rgba(15,20,25,0));}.toggle-line-inner{background:#999;}.toggle-line:hover .toggle-line-inner{background:#c5c5c5;} \ No newline at end of file diff --git a/dark.css b/dark.css index d8bd200..49b9b4f 100644 --- a/dark.css +++ b/dark.css @@ -1 +1 @@ -body,#settings-menu #settings,#settings-menu #settings::before{background-color:#353535;color:#ddd;}.setting-line .radio-line input{border-color:#ddd;}.setting-line .radio-line input:checked{box-shadow:inset 0 0 0 3px #353535;background-color:#2196f3;}.setting-line .radio-line input:focus{box-shadow:0 0 1px 1px #2196f3;}.setting-line .radio-line input:checked:focus{box-shadow:inset 0 0 0 3px #353535,0 0 2px 2px #2196f3;}.setting-line .radio-line input:hover{border-color:#2196f3 !important;}.slider{background-color:#ccc;}.slider:before{background-color:white;}input:checked+.slider{background-color:#2196F3;}input:focus+.slider{box-shadow:0 0 0 2px #0a84ff,0 0 0 6px rgba(10,132,255,0.3);}h1,h2,h3,h4{color:#ddd;}h1.fqn{border-bottom-color:#d2d2d2;}h2,h3,h4{border-bottom-color:#d2d2d2;}.in-band{background-color:#353535;}.invisible{background:rgba(0,0,0,0);}.docblock code,.docblock-short code{background-color:#2A2A2A;}pre,.rustdoc.source .example-wrap{background-color:#2A2A2A;}.sidebar,.mobile-topbar,.sidebar-menu-toggle{background-color:#505050;}.rust-logo{filter:drop-shadow(1px 0 0px #fff) drop-shadow(0 1px 0 #fff) drop-shadow(-1px 0 0 #fff) drop-shadow(0 -1px 0 #fff)}*{scrollbar-color:rgb(64,65,67) #717171;}.sidebar{scrollbar-color:rgba(32,34,37,.6) #5a5a5a;}::-webkit-scrollbar-track{background-color:#717171;}::-webkit-scrollbar-thumb{background-color:rgba(32,34,37,.6);}.sidebar::-webkit-scrollbar-track{background-color:#717171;}.sidebar::-webkit-scrollbar-thumb{background-color:rgba(32,34,37,.6);}.sidebar .current,.sidebar a:hover{background:#444;}.source .sidebar{background-color:#565656;}.line-numbers span{color:#3B91E2;}.line-numbers .line-highlighted{background-color:#0a042f !important;}.docblock h1,.docblock h2,.docblock h3,.docblock h4,.docblock h5,.docblock h6{border-bottom-color:#DDD;}.docblock table td,.docblock table th{border-color:#ddd;}.content .method .where,.content .fn .where,.content .where.fmt-newline{color:#ddd;}.search-results a:hover{background-color:#777;}.search-results a:focus{color:#eee !important;background-color:#616161;}.search-results a:focus span{color:#eee !important;}a.result-trait:focus{background-color:#013191;}a.result-traitalias:focus{background-color:#013191;}a.result-mod:focus,a.result-externcrate:focus{background-color:#884719;}a.result-enum:focus{background-color:#194e9f;}a.result-struct:focus{background-color:#194e9f;}a.result-union:focus{background-color:#194e9f;}a.result-fn:focus,a.result-method:focus,a.result-tymethod:focus{background-color:#4950ed;}a.result-type:focus{background-color:#194e9f;}a.result-associatedtype:focus{background-color:#884719;}a.result-foreigntype:focus{background-color:#194e9f;}a.result-attr:focus,a.result-derive:focus,a.result-macro:focus{background-color:#217d1c;}a.result-constant:focus,a.result-static:focus{background-color:#884719;}a.result-primitive:focus{background-color:#194e9f;}a.result-keyword:focus{background-color:#884719;}.content .item-info::before{color:#ccc;}.content span.enum,.content a.enum,.block a.current.enum{color:#2dbfb8;}.content span.struct,.content a.struct,.block a.current.struct{color:#2dbfb8;}.content span.type,.content a.type,.block a.current.type{color:#2dbfb8;}.content span.associatedtype,.content a.associatedtype,.block a.current.associatedtype{color:#D2991D;}.content span.foreigntype,.content a.foreigntype,.block a.current.foreigntype{color:#2dbfb8;}.content span.attr,.content a.attr,.block a.current.attr,.content span.derive,.content a.derive,.block a.current.derive,.content span.macro,.content a.macro,.block a.current.macro{color:#09bd00;}.content span.union,.content a.union,.block a.current.union{color:#2dbfb8;}.content span.constant,.content a.constant,.block a.current.constant,.content span.static,.content a.static,.block a.current.static{color:#D2991D;}.content span.primitive,.content a.primitive,.block a.current.primitive{color:#2dbfb8;}.content span.externcrate,.content span.mod,.content a.mod,.block a.current.mod{color:#D2991D;}.content span.trait,.content a.trait,.block a.current.trait{color:#b78cf2;}.content span.traitalias,.content a.traitalias,.block a.current.traitalias{color:#b78cf2;}.content span.fn,.content a.fn,.block a.current.fn,.content span.method,.content a.method,.block a.current.method,.content span.tymethod,.content a.tymethod,.block a.current.tymethod,.content .fnname{color:#2BAB63;}.content span.keyword,.content a.keyword,.block a.current.keyword{color:#D2991D;}.sidebar a{color:#fdbf35;}.sidebar a.current.enum{color:#12ece2;}.sidebar a.current.struct{color:#12ece2;}.sidebar a.current.type{color:#12ece2;}.sidebar a.current.associatedtype{color:#fdbf35;}.sidebar a.current.foreigntype{color:#12ece2;}.sidebar a.current.attr,.sidebar a.current.derive,.sidebar a.current.macro{color:#0be900;}.sidebar a.current.union{color:#12ece2;}.sidebar a.current.constant .sidebar a.current.static{color:#fdbf35;}.sidebar a.current.primitive{color:#12ece2;}.sidebar a.current.externcrate .sidebar a.current.mod{color:#fdbf35;}.sidebar a.current.trait{color:#cca7ff;}.sidebar a.current.traitalias{color:#cca7ff;}.sidebar a.current.fn,.sidebar a.current.method,.sidebar a.current.tymethod{color:#32d479;}.sidebar a.current.keyword{color:#fdbf35;}pre.rust .comment{color:#8d8d8b;}pre.rust .doccomment{color:#8ca375;}nav.main .current{border-top-color:#eee;border-bottom-color:#eee;}nav.main .separator{border-color:#eee;}a{color:#D2991D;}a#toggle-all-docs,a.anchor,.small-section-header a,#source-sidebar a,pre.rust a,.sidebar h2 a,.sidebar h3 a,.mobile-topbar h2 a,.in-band a{color:#ddd;}.search-results a{color:#ddd;}a.test-arrow{color:#dedede;}body.source .example-wrap pre.rust a{background:#333;}details.rustdoc-toggle>summary.hideme>span,details.rustdoc-toggle>summary::before,details.undocumented>summary::before{color:#999;}details.rustdoc-toggle>summary::before,details.undocumented>summary::before{filter:invert(100%);}#crate-search,.search-input{color:#111;background-color:#f0f0f0;border-color:#f0f0f0 !important;}.search-input{border-color:#e0e0e0;}.search-input:focus{border-color:#008dfd;}.module-item .stab,.import-item .stab{color:#ddd;}.stab.empty-impl{background:#FFF5D6;border-color:#FFC600;color:#2f2f2f;}.stab.unstable{background:#FFF5D6;border-color:#FFC600;color:#2f2f2f;}.stab.deprecated{background:#ffc4c4;border-color:#db7b7b;color:#2f2f2f;}.stab.portability{background:#F3DFFF;border-color:#b07bdb;color:#2f2f2f;}.stab.portability>code{background:none;}#help>div{background:#4d4d4d;border-color:#bfbfbf;}#help span.bottom,#help span.top{border-color:#bfbfbf;}#help dt{border-color:#bfbfbf;background:rgba(0,0,0,0);}.rightside,.out-of-band{color:grey;}.result-name .primitive>i,.result-name .keyword>i{color:#ddd;}.line-numbers :target{background-color:transparent;}pre.rust .kw{color:#ab8ac1;}pre.rust .kw-2,pre.rust .prelude-ty{color:#769acb;}pre.rust .number,pre.rust .string{color:#83a300;}pre.rust .self,pre.rust .bool-val,pre.rust .prelude-val,pre.rust .attribute,pre.rust .attribute .ident{color:#ee6868;}pre.rust .macro,pre.rust .macro-nonterminal{color:#3E999F;}pre.rust .lifetime{color:#d97f26;}pre.rust .question-mark{color:#ff9011;}.example-wrap>pre.line-number{border-color:#4a4949;}a.test-arrow{background-color:rgba(78,139,202,0.2);}a.test-arrow:hover{background-color:#4e8bca;}.toggle-label,.code-attribute{color:#999;}:target{background-color:#494a3d;border-right:3px solid #bb7410;}pre.compile_fail{border-left:2px solid rgba(255,0,0,.8);}pre.compile_fail:hover,.information:hover+pre.compile_fail{border-left:2px solid #f00;}pre.should_panic{border-left:2px solid rgba(255,0,0,.8);}pre.should_panic:hover,.information:hover+pre.should_panic{border-left:2px solid #f00;}pre.ignore{border-left:2px solid rgba(255,142,0,.6);}pre.ignore:hover,.information:hover+pre.ignore{border-left:2px solid #ff9200;}.tooltip.compile_fail{color:rgba(255,0,0,.8);}.information>.compile_fail:hover{color:#f00;}.tooltip.should_panic{color:rgba(255,0,0,.8);}.information>.should_panic:hover{color:#f00;}.tooltip.ignore{color:rgba(255,142,0,.6);}.information>.ignore:hover{color:#ff9200;}.search-failed a{color:#0089ff;}.tooltip::after{background-color:#000;color:#fff;border-color:#000;}.tooltip::before{border-color:transparent black transparent transparent;}.notable-traits-tooltiptext{background-color:#111;border-color:#777;}.notable-traits-tooltiptext .notable{border-bottom-color:#d2d2d2;}#titles>button:not(.selected){background-color:#252525;border-top-color:#252525;}#titles>button:hover,#titles>button.selected{border-top-color:#0089ff;background-color:#353535;}#titles>button>div.count{color:#888;}@media (max-width:700px){.sidebar-menu{background-color:#505050;border-bottom-color:#e0e0e0;border-right-color:#e0e0e0;}.sidebar-elems{background-color:#505050;border-right-color:#000;}#sidebar-filler{background-color:#505050;border-bottom-color:#e0e0e0;}}kbd{color:#000;background-color:#fafbfc;border-color:#d1d5da;border-bottom-color:#c6cbd1;box-shadow:inset 0 -1px 0 #c6cbd1;}#settings-menu>a,#help-button{border-color:#e0e0e0;background:#f0f0f0;color:#000;}#settings-menu>a:hover,#settings-menu>a:focus,#help-button:hover,#help-button:focus{border-color:#ffb900;}#settings-menu #settings,#settings-menu #settings::before{border-color:#d2d2d2;}#copy-path{color:#999;}#copy-path>img{filter:invert(50%);}#copy-path:hover>img{filter:invert(65%);}#theme-choices{border-color:#e0e0e0;background-color:#353535;}#theme-choices>button:not(:first-child){border-top-color:#e0e0e0;}#theme-choices>button:hover,#theme-choices>button:focus{background-color:#4e4e4e;}.search-results .result-name span.alias{color:#fff;}.search-results .result-name span.grey{color:#ccc;}#sidebar-toggle{background-color:#565656;}#sidebar-toggle:hover{background-color:#676767;}#source-sidebar{background-color:#565656;}#source-sidebar>.title{border-bottom-color:#ccc;}div.files>a:hover,div.name:hover{background-color:#444;}div.files>.selected{background-color:#333;}.scraped-example-list .scrape-help{border-color:#aaa;color:#eee;}.scraped-example-list .scrape-help:hover{border-color:white;color:white;}.more-examples-toggle summary,.more-examples-toggle .hide-more{color:#999;}.scraped-example .example-wrap .rust span.highlight{background:rgb(91,59,1);}.scraped-example .example-wrap .rust span.highlight.focus{background:rgb(124,75,15);}.scraped-example:not(.expanded) .code-wrapper:before{background:linear-gradient(to bottom,rgba(53,53,53,1),rgba(53,53,53,0));}.scraped-example:not(.expanded) .code-wrapper:after{background:linear-gradient(to top,rgba(53,53,53,1),rgba(53,53,53,0));}.toggle-line-inner{background:#999;}.toggle-line:hover .toggle-line-inner{background:#c5c5c5;} \ No newline at end of file +:root{--main-background-color:#353535;--main-color:#ddd;--settings-input-color:#2196f3;--sidebar-background-color:#505050;--sidebar-background-color-hover:#676767;--code-block-background-color:#2A2A2A;--scrollbar-track-background-color:#717171;--scrollbar-thumb-background-color:rgba(32,34,37,.6);--scrollbar-color:rgba(32,34,37,.6) #5a5a5a;--headings-border-bottom-color:#d2d2d2;--border-color:#e0e0e0;--button-background-color:#f0f0f0;--right-side-color:grey;--code-attribute-color:#999;--toggles-color:#999;--search-input-focused-border-color:#008dfd;--copy-path-button-color:#999;--copy-path-img-filter:invert(50%);--copy-path-img-hover-filter:invert(65%);--codeblock-error-hover-color:rgb(255,0,0);--codeblock-error-color:rgba(255,0,0,.5);--codeblock-ignore-hover-color:rgb(255,142,0);--codeblock-ignore-color:rgba(255,142,0,.6);--type-link-color:#2dbfb8;--trait-link-color:#b78cf2;--assoc-item-link-color:#d2991d;--function-link-color:#2bab63;--macro-link-color:#09bd00;--keyword-link-color:#d2991d;--mod-link-color:#d2991d;--link-color:#d2991d;}.slider{background-color:#ccc;}.slider:before{background-color:white;}input:focus+.slider{box-shadow:0 0 0 2px #0a84ff,0 0 0 6px rgba(10,132,255,0.3);}.rust-logo{filter:drop-shadow(1px 0 0px #fff) drop-shadow(0 1px 0 #fff) drop-shadow(-1px 0 0 #fff) drop-shadow(0 -1px 0 #fff)}.sidebar .current,.sidebar a:hover{background:#444;}.line-numbers span{color:#3B91E2;}.line-numbers .line-highlighted{background-color:#0a042f !important;}.search-results a:hover{background-color:#777;}.search-results a:focus{color:#eee !important;background-color:#616161;}.search-results a:focus span{color:#eee !important;}a.result-trait:focus{background-color:#013191;}a.result-traitalias:focus{background-color:#013191;}a.result-mod:focus,a.result-externcrate:focus{background-color:#884719;}a.result-enum:focus{background-color:#194e9f;}a.result-struct:focus{background-color:#194e9f;}a.result-union:focus{background-color:#194e9f;}a.result-fn:focus,a.result-method:focus,a.result-tymethod:focus{background-color:#4950ed;}a.result-type:focus{background-color:#194e9f;}a.result-associatedtype:focus{background-color:#884719;}a.result-foreigntype:focus{background-color:#194e9f;}a.result-attr:focus,a.result-derive:focus,a.result-macro:focus{background-color:#217d1c;}a.result-constant:focus,a.result-static:focus{background-color:#884719;}a.result-primitive:focus{background-color:#194e9f;}a.result-keyword:focus{background-color:#884719;}.content .item-info::before{color:#ccc;}.sidebar a{color:#fdbf35;}.sidebar a.current.enum{color:#12ece2;}.sidebar a.current.struct{color:#12ece2;}.sidebar a.current.type{color:#12ece2;}.sidebar a.current.foreigntype{color:#12ece2;}.sidebar a.current.attr,.sidebar a.current.derive,.sidebar a.current.macro{color:#0be900;}.sidebar a.current.union{color:#12ece2;}.sidebar a.current.constant .sidebar a.current.static{color:#fdbf35;}.sidebar a.current.primitive{color:#12ece2;}.sidebar a.current.trait{color:#cca7ff;}.sidebar a.current.traitalias{color:#cca7ff;}.sidebar a.current.fn{color:#32d479;}.sidebar a.current.keyword{color:#fdbf35;}pre.rust .comment{color:#8d8d8b;}pre.rust .doccomment{color:#8ca375;}body.source .example-wrap pre.rust a{background:#333;}details.rustdoc-toggle>summary::before{filter:invert(100%);}.search-input{color:#111;}#crate-search-div::after{filter:invert(94%) sepia(0%) saturate(721%) hue-rotate(255deg) brightness(90%) contrast(90%);}#crate-search:hover,#crate-search:focus{border-color:#2196f3 !important;}#crate-search-div:hover::after,#crate-search-div:focus-within::after{filter:invert(69%) sepia(60%) saturate(6613%) hue-rotate(184deg) brightness(100%) contrast(91%);}.stab{background:#314559;}.stab.portability>code{color:#e6e1cf;background:none;}.line-numbers :target{background-color:transparent;}pre.rust .kw{color:#ab8ac1;}pre.rust .kw-2,pre.rust .prelude-ty{color:#769acb;}pre.rust .number,pre.rust .string{color:#83a300;}pre.rust .self,pre.rust .bool-val,pre.rust .prelude-val,pre.rust .attribute{color:#ee6868;}pre.rust .macro,pre.rust .macro-nonterminal{color:#3E999F;}pre.rust .lifetime{color:#d97f26;}pre.rust .question-mark{color:#ff9011;}.example-wrap>pre.line-number{border-color:#4a4949;}a.test-arrow{color:#dedede;background-color:rgba(78,139,202,0.2);}a.test-arrow:hover{background-color:#4e8bca;}:target{background-color:#494a3d;border-right:3px solid #bb7410;}.search-failed a{color:#0089ff;}.tooltip::after{background-color:#000;color:#fff;border-color:#000;}.tooltip::before{border-color:transparent black transparent transparent;}.notable-traits-tooltiptext{background-color:#111;}#titles>button:not(.selected){background-color:#252525;border-top-color:#252525;}#titles>button:hover,#titles>button.selected{border-top-color:#0089ff;background-color:#353535;}#titles>button>div.count{color:#888;}kbd{color:#000;background-color:#fafbfc;box-shadow:inset 0 -1px 0 #c6cbd1;}#settings-menu>a,#help-button>button{color:#000;}#settings-menu>a:hover,#settings-menu>a:focus,#help-button>button:hover,#help-button>button:focus{border-color:#ffb900;}.search-results .result-name span.alias{color:#fff;}.search-results .result-name span.grey{color:#ccc;}#source-sidebar div.files>a:hover,details.dir-entry summary:hover,#source-sidebar div.files>a:focus,details.dir-entry summary:focus{background-color:#444;}#source-sidebar div.files>a.selected{background-color:#333;}.scraped-example-list .scrape-help{border-color:#aaa;color:#eee;}.scraped-example-list .scrape-help:hover{border-color:white;color:white;}.scraped-example .example-wrap .rust span.highlight{background:rgb(91,59,1);}.scraped-example .example-wrap .rust span.highlight.focus{background:rgb(124,75,15);}.scraped-example:not(.expanded) .code-wrapper:before{background:linear-gradient(to bottom,rgba(53,53,53,1),rgba(53,53,53,0));}.scraped-example:not(.expanded) .code-wrapper:after{background:linear-gradient(to top,rgba(53,53,53,1),rgba(53,53,53,0));}.toggle-line-inner{background:#999;}.toggle-line:hover .toggle-line-inner{background:#c5c5c5;} \ No newline at end of file diff --git a/down-arrow.svg b/down-arrow.svg index 35437e7..5d76a64 100644 --- a/down-arrow.svg +++ b/down-arrow.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/implementors/core/clone/trait.Clone.js b/implementors/core/clone/trait.Clone.js index 213b465..45cb34a 100644 --- a/implementors/core/clone/trait.Clone.js +++ b/implementors/core/clone/trait.Clone.js @@ -1,3 +1,3 @@ -(function() {var implementors = {}; -implementors["llvm_kaleidoscope_rs"] = [{"text":"impl<'llvm> Clone for BasicBlock<'llvm>","synthetic":false,"types":["llvm_kaleidoscope_rs::llvm::basic_block::BasicBlock"]},{"text":"impl<'llvm> Clone for Type<'llvm>","synthetic":false,"types":["llvm_kaleidoscope_rs::llvm::type_::Type"]},{"text":"impl<'llvm> Clone for Value<'llvm>","synthetic":false,"types":["llvm_kaleidoscope_rs::llvm::value::Value"]},{"text":"impl<'llvm> Clone for FnValue<'llvm>","synthetic":false,"types":["llvm_kaleidoscope_rs::llvm::value::FnValue"]},{"text":"impl<'llvm> Clone for PhiValue<'llvm>","synthetic":false,"types":["llvm_kaleidoscope_rs::llvm::value::PhiValue"]},{"text":"impl Clone for PrototypeAST","synthetic":false,"types":["llvm_kaleidoscope_rs::parser::PrototypeAST"]}]; -if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file +(function() {var implementors = { +"llvm_kaleidoscope_rs":[["impl<'llvm> Clone for BasicBlock<'llvm>"],["impl<'llvm> Clone for Type<'llvm>"],["impl<'llvm> Clone for Value<'llvm>"],["impl<'llvm> Clone for FnValue<'llvm>"],["impl<'llvm> Clone for PhiValue<'llvm>"],["impl Clone for PrototypeAST"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/implementors/core/cmp/trait.PartialEq.js b/implementors/core/cmp/trait.PartialEq.js index 91c93a8..286f9b5 100644 --- a/implementors/core/cmp/trait.PartialEq.js +++ b/implementors/core/cmp/trait.PartialEq.js @@ -1,3 +1,3 @@ -(function() {var implementors = {}; -implementors["llvm_kaleidoscope_rs"] = [{"text":"impl PartialEq<Token> for Token","synthetic":false,"types":["llvm_kaleidoscope_rs::lexer::Token"]},{"text":"impl PartialEq<ExprAST> for ExprAST","synthetic":false,"types":["llvm_kaleidoscope_rs::parser::ExprAST"]},{"text":"impl PartialEq<PrototypeAST> for PrototypeAST","synthetic":false,"types":["llvm_kaleidoscope_rs::parser::PrototypeAST"]},{"text":"impl PartialEq<FunctionAST> for FunctionAST","synthetic":false,"types":["llvm_kaleidoscope_rs::parser::FunctionAST"]},{"text":"impl PartialEq<SmallCStr> for SmallCStr","synthetic":false,"types":["llvm_kaleidoscope_rs::SmallCStr"]}]; -if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file +(function() {var implementors = { +"llvm_kaleidoscope_rs":[["impl PartialEq<Token> for Token"],["impl PartialEq<ExprAST> for ExprAST"],["impl PartialEq<PrototypeAST> for PrototypeAST"],["impl PartialEq<FunctionAST> for FunctionAST"],["impl PartialEq<SmallCStr> for SmallCStr"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/implementors/core/convert/trait.TryFrom.js b/implementors/core/convert/trait.TryFrom.js index 5cf4f9e..8bcabb1 100644 --- a/implementors/core/convert/trait.TryFrom.js +++ b/implementors/core/convert/trait.TryFrom.js @@ -1,3 +1,3 @@ -(function() {var implementors = {}; -implementors["llvm_kaleidoscope_rs"] = [{"text":"impl TryFrom<&str> for SmallCStr","synthetic":false,"types":["llvm_kaleidoscope_rs::SmallCStr"]}]; -if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file +(function() {var implementors = { +"llvm_kaleidoscope_rs":[["impl TryFrom<&str> for SmallCStr"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/implementors/core/fmt/trait.Debug.js b/implementors/core/fmt/trait.Debug.js index 4024ff2..315179a 100644 --- a/implementors/core/fmt/trait.Debug.js +++ b/implementors/core/fmt/trait.Debug.js @@ -1,3 +1,3 @@ -(function() {var implementors = {}; -implementors["llvm_kaleidoscope_rs"] = [{"text":"impl Debug for Token","synthetic":false,"types":["llvm_kaleidoscope_rs::lexer::Token"]},{"text":"impl Debug for ExprAST","synthetic":false,"types":["llvm_kaleidoscope_rs::parser::ExprAST"]},{"text":"impl Debug for PrototypeAST","synthetic":false,"types":["llvm_kaleidoscope_rs::parser::PrototypeAST"]},{"text":"impl Debug for FunctionAST","synthetic":false,"types":["llvm_kaleidoscope_rs::parser::FunctionAST"]},{"text":"impl Debug for SmallCStr","synthetic":false,"types":["llvm_kaleidoscope_rs::SmallCStr"]}]; -if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file +(function() {var implementors = { +"llvm_kaleidoscope_rs":[["impl Debug for Token"],["impl Debug for ExprAST"],["impl Debug for PrototypeAST"],["impl Debug for FunctionAST"],["impl Debug for SmallCStr"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/implementors/core/marker/trait.Copy.js b/implementors/core/marker/trait.Copy.js index 004b5dc..948fc59 100644 --- a/implementors/core/marker/trait.Copy.js +++ b/implementors/core/marker/trait.Copy.js @@ -1,3 +1,3 @@ -(function() {var implementors = {}; -implementors["llvm_kaleidoscope_rs"] = [{"text":"impl<'llvm> Copy for BasicBlock<'llvm>","synthetic":false,"types":["llvm_kaleidoscope_rs::llvm::basic_block::BasicBlock"]},{"text":"impl<'llvm> Copy for Type<'llvm>","synthetic":false,"types":["llvm_kaleidoscope_rs::llvm::type_::Type"]},{"text":"impl<'llvm> Copy for Value<'llvm>","synthetic":false,"types":["llvm_kaleidoscope_rs::llvm::value::Value"]},{"text":"impl<'llvm> Copy for FnValue<'llvm>","synthetic":false,"types":["llvm_kaleidoscope_rs::llvm::value::FnValue"]},{"text":"impl<'llvm> Copy for PhiValue<'llvm>","synthetic":false,"types":["llvm_kaleidoscope_rs::llvm::value::PhiValue"]}]; -if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file +(function() {var implementors = { +"llvm_kaleidoscope_rs":[["impl<'llvm> Copy for BasicBlock<'llvm>"],["impl<'llvm> Copy for Type<'llvm>"],["impl<'llvm> Copy for Value<'llvm>"],["impl<'llvm> Copy for FnValue<'llvm>"],["impl<'llvm> Copy for PhiValue<'llvm>"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/implementors/core/marker/trait.Freeze.js b/implementors/core/marker/trait.Freeze.js index d984c6a..58b47e3 100644 --- a/implementors/core/marker/trait.Freeze.js +++ b/implementors/core/marker/trait.Freeze.js @@ -1,3 +1,3 @@ -(function() {var implementors = {}; -implementors["llvm_kaleidoscope_rs"] = [{"text":"impl<'llvm, 'a> Freeze for Codegen<'llvm, 'a>","synthetic":true,"types":["llvm_kaleidoscope_rs::codegen::Codegen"]},{"text":"impl Freeze for Token","synthetic":true,"types":["llvm_kaleidoscope_rs::lexer::Token"]},{"text":"impl<I> Freeze for Lexer<I> where
    I: Freeze, 
","synthetic":true,"types":["llvm_kaleidoscope_rs::lexer::Lexer"]},{"text":"impl<'llvm> Freeze for BasicBlock<'llvm>","synthetic":true,"types":["llvm_kaleidoscope_rs::llvm::basic_block::BasicBlock"]},{"text":"impl<'llvm> Freeze for IRBuilder<'llvm>","synthetic":true,"types":["llvm_kaleidoscope_rs::llvm::builder::IRBuilder"]},{"text":"impl Freeze for LLJit","synthetic":true,"types":["llvm_kaleidoscope_rs::llvm::lljit::LLJit"]},{"text":"impl<'jit> Freeze for ResourceTracker<'jit>","synthetic":true,"types":["llvm_kaleidoscope_rs::llvm::lljit::ResourceTracker"]},{"text":"impl Freeze for Module","synthetic":true,"types":["llvm_kaleidoscope_rs::llvm::module::Module"]},{"text":"impl<'llvm> Freeze for FunctionPassManager<'llvm>","synthetic":true,"types":["llvm_kaleidoscope_rs::llvm::pass_manager::FunctionPassManager"]},{"text":"impl<'llvm> Freeze for Type<'llvm>","synthetic":true,"types":["llvm_kaleidoscope_rs::llvm::type_::Type"]},{"text":"impl<'llvm> Freeze for Value<'llvm>","synthetic":true,"types":["llvm_kaleidoscope_rs::llvm::value::Value"]},{"text":"impl<'llvm> Freeze for FnValue<'llvm>","synthetic":true,"types":["llvm_kaleidoscope_rs::llvm::value::FnValue"]},{"text":"impl<'llvm> Freeze for PhiValue<'llvm>","synthetic":true,"types":["llvm_kaleidoscope_rs::llvm::value::PhiValue"]},{"text":"impl Freeze for ExprAST","synthetic":true,"types":["llvm_kaleidoscope_rs::parser::ExprAST"]},{"text":"impl Freeze for PrototypeAST","synthetic":true,"types":["llvm_kaleidoscope_rs::parser::PrototypeAST"]},{"text":"impl Freeze for FunctionAST","synthetic":true,"types":["llvm_kaleidoscope_rs::parser::FunctionAST"]},{"text":"impl<I> Freeze for Parser<I> where
    I: Freeze, 
","synthetic":true,"types":["llvm_kaleidoscope_rs::parser::Parser"]},{"text":"impl Freeze for SmallCStr","synthetic":true,"types":["llvm_kaleidoscope_rs::SmallCStr"]},{"text":"impl<A, B> Freeze for Either<A, B> where
    A: Freeze,
    B: Freeze, 
","synthetic":true,"types":["llvm_kaleidoscope_rs::Either"]}]; -if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file +(function() {var implementors = { +"llvm_kaleidoscope_rs":[["impl<'llvm, 'a> Freeze for Codegen<'llvm, 'a>",1,["llvm_kaleidoscope_rs::codegen::Codegen"]],["impl Freeze for Token",1,["llvm_kaleidoscope_rs::lexer::Token"]],["impl<I> Freeze for Lexer<I>where
    I: Freeze,
",1,["llvm_kaleidoscope_rs::lexer::Lexer"]],["impl<'llvm> Freeze for BasicBlock<'llvm>",1,["llvm_kaleidoscope_rs::llvm::basic_block::BasicBlock"]],["impl<'llvm> Freeze for IRBuilder<'llvm>",1,["llvm_kaleidoscope_rs::llvm::builder::IRBuilder"]],["impl Freeze for LLJit",1,["llvm_kaleidoscope_rs::llvm::lljit::LLJit"]],["impl<'jit> Freeze for ResourceTracker<'jit>",1,["llvm_kaleidoscope_rs::llvm::lljit::ResourceTracker"]],["impl Freeze for Module",1,["llvm_kaleidoscope_rs::llvm::module::Module"]],["impl<'llvm> Freeze for FunctionPassManager<'llvm>",1,["llvm_kaleidoscope_rs::llvm::pass_manager::FunctionPassManager"]],["impl<'llvm> Freeze for Type<'llvm>",1,["llvm_kaleidoscope_rs::llvm::type_::Type"]],["impl<'llvm> Freeze for Value<'llvm>",1,["llvm_kaleidoscope_rs::llvm::value::Value"]],["impl<'llvm> Freeze for FnValue<'llvm>",1,["llvm_kaleidoscope_rs::llvm::value::FnValue"]],["impl<'llvm> Freeze for PhiValue<'llvm>",1,["llvm_kaleidoscope_rs::llvm::value::PhiValue"]],["impl Freeze for ExprAST",1,["llvm_kaleidoscope_rs::parser::ExprAST"]],["impl Freeze for PrototypeAST",1,["llvm_kaleidoscope_rs::parser::PrototypeAST"]],["impl Freeze for FunctionAST",1,["llvm_kaleidoscope_rs::parser::FunctionAST"]],["impl<I> Freeze for Parser<I>where
    I: Freeze,
",1,["llvm_kaleidoscope_rs::parser::Parser"]],["impl Freeze for SmallCStr",1,["llvm_kaleidoscope_rs::SmallCStr"]],["impl<A, B> Freeze for Either<A, B>where
    A: Freeze,
    B: Freeze,
",1,["llvm_kaleidoscope_rs::Either"]]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/implementors/core/marker/trait.Send.js b/implementors/core/marker/trait.Send.js index 0be6370..4f54b02 100644 --- a/implementors/core/marker/trait.Send.js +++ b/implementors/core/marker/trait.Send.js @@ -1,3 +1,3 @@ -(function() {var implementors = {}; -implementors["llvm_kaleidoscope_rs"] = [{"text":"impl<'llvm, 'a> !Send for Codegen<'llvm, 'a>","synthetic":true,"types":["llvm_kaleidoscope_rs::codegen::Codegen"]},{"text":"impl Send for Token","synthetic":true,"types":["llvm_kaleidoscope_rs::lexer::Token"]},{"text":"impl<I> Send for Lexer<I> where
    I: Send
","synthetic":true,"types":["llvm_kaleidoscope_rs::lexer::Lexer"]},{"text":"impl<'llvm> !Send for BasicBlock<'llvm>","synthetic":true,"types":["llvm_kaleidoscope_rs::llvm::basic_block::BasicBlock"]},{"text":"impl<'llvm> !Send for IRBuilder<'llvm>","synthetic":true,"types":["llvm_kaleidoscope_rs::llvm::builder::IRBuilder"]},{"text":"impl !Send for LLJit","synthetic":true,"types":["llvm_kaleidoscope_rs::llvm::lljit::LLJit"]},{"text":"impl<'jit> !Send for ResourceTracker<'jit>","synthetic":true,"types":["llvm_kaleidoscope_rs::llvm::lljit::ResourceTracker"]},{"text":"impl !Send for Module","synthetic":true,"types":["llvm_kaleidoscope_rs::llvm::module::Module"]},{"text":"impl<'llvm> !Send for FunctionPassManager<'llvm>","synthetic":true,"types":["llvm_kaleidoscope_rs::llvm::pass_manager::FunctionPassManager"]},{"text":"impl<'llvm> !Send for Type<'llvm>","synthetic":true,"types":["llvm_kaleidoscope_rs::llvm::type_::Type"]},{"text":"impl<'llvm> !Send for Value<'llvm>","synthetic":true,"types":["llvm_kaleidoscope_rs::llvm::value::Value"]},{"text":"impl<'llvm> !Send for FnValue<'llvm>","synthetic":true,"types":["llvm_kaleidoscope_rs::llvm::value::FnValue"]},{"text":"impl<'llvm> !Send for PhiValue<'llvm>","synthetic":true,"types":["llvm_kaleidoscope_rs::llvm::value::PhiValue"]},{"text":"impl Send for ExprAST","synthetic":true,"types":["llvm_kaleidoscope_rs::parser::ExprAST"]},{"text":"impl Send for PrototypeAST","synthetic":true,"types":["llvm_kaleidoscope_rs::parser::PrototypeAST"]},{"text":"impl Send for FunctionAST","synthetic":true,"types":["llvm_kaleidoscope_rs::parser::FunctionAST"]},{"text":"impl<I> Send for Parser<I> where
    I: Send
","synthetic":true,"types":["llvm_kaleidoscope_rs::parser::Parser"]},{"text":"impl Send for SmallCStr","synthetic":true,"types":["llvm_kaleidoscope_rs::SmallCStr"]},{"text":"impl<A, B> Send for Either<A, B> where
    A: Send,
    B: Send
","synthetic":true,"types":["llvm_kaleidoscope_rs::Either"]}]; -if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file +(function() {var implementors = { +"llvm_kaleidoscope_rs":[["impl<'llvm, 'a> !Send for Codegen<'llvm, 'a>",1,["llvm_kaleidoscope_rs::codegen::Codegen"]],["impl Send for Token",1,["llvm_kaleidoscope_rs::lexer::Token"]],["impl<I> Send for Lexer<I>where
    I: Send,
",1,["llvm_kaleidoscope_rs::lexer::Lexer"]],["impl<'llvm> !Send for BasicBlock<'llvm>",1,["llvm_kaleidoscope_rs::llvm::basic_block::BasicBlock"]],["impl<'llvm> !Send for IRBuilder<'llvm>",1,["llvm_kaleidoscope_rs::llvm::builder::IRBuilder"]],["impl !Send for LLJit",1,["llvm_kaleidoscope_rs::llvm::lljit::LLJit"]],["impl<'jit> !Send for ResourceTracker<'jit>",1,["llvm_kaleidoscope_rs::llvm::lljit::ResourceTracker"]],["impl !Send for Module",1,["llvm_kaleidoscope_rs::llvm::module::Module"]],["impl<'llvm> !Send for FunctionPassManager<'llvm>",1,["llvm_kaleidoscope_rs::llvm::pass_manager::FunctionPassManager"]],["impl<'llvm> !Send for Type<'llvm>",1,["llvm_kaleidoscope_rs::llvm::type_::Type"]],["impl<'llvm> !Send for Value<'llvm>",1,["llvm_kaleidoscope_rs::llvm::value::Value"]],["impl<'llvm> !Send for FnValue<'llvm>",1,["llvm_kaleidoscope_rs::llvm::value::FnValue"]],["impl<'llvm> !Send for PhiValue<'llvm>",1,["llvm_kaleidoscope_rs::llvm::value::PhiValue"]],["impl Send for ExprAST",1,["llvm_kaleidoscope_rs::parser::ExprAST"]],["impl Send for PrototypeAST",1,["llvm_kaleidoscope_rs::parser::PrototypeAST"]],["impl Send for FunctionAST",1,["llvm_kaleidoscope_rs::parser::FunctionAST"]],["impl<I> Send for Parser<I>where
    I: Send,
",1,["llvm_kaleidoscope_rs::parser::Parser"]],["impl Send for SmallCStr",1,["llvm_kaleidoscope_rs::SmallCStr"]],["impl<A, B> Send for Either<A, B>where
    A: Send,
    B: Send,
",1,["llvm_kaleidoscope_rs::Either"]]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/implementors/core/marker/trait.StructuralPartialEq.js b/implementors/core/marker/trait.StructuralPartialEq.js index 64f1c7d..658fc8e 100644 --- a/implementors/core/marker/trait.StructuralPartialEq.js +++ b/implementors/core/marker/trait.StructuralPartialEq.js @@ -1,3 +1,3 @@ -(function() {var implementors = {}; -implementors["llvm_kaleidoscope_rs"] = [{"text":"impl StructuralPartialEq for Token","synthetic":false,"types":["llvm_kaleidoscope_rs::lexer::Token"]},{"text":"impl StructuralPartialEq for ExprAST","synthetic":false,"types":["llvm_kaleidoscope_rs::parser::ExprAST"]},{"text":"impl StructuralPartialEq for PrototypeAST","synthetic":false,"types":["llvm_kaleidoscope_rs::parser::PrototypeAST"]},{"text":"impl StructuralPartialEq for FunctionAST","synthetic":false,"types":["llvm_kaleidoscope_rs::parser::FunctionAST"]},{"text":"impl StructuralPartialEq for SmallCStr","synthetic":false,"types":["llvm_kaleidoscope_rs::SmallCStr"]}]; -if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file +(function() {var implementors = { +"llvm_kaleidoscope_rs":[["impl StructuralPartialEq for Token"],["impl StructuralPartialEq for ExprAST"],["impl StructuralPartialEq for PrototypeAST"],["impl StructuralPartialEq for FunctionAST"],["impl StructuralPartialEq for SmallCStr"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/implementors/core/marker/trait.Sync.js b/implementors/core/marker/trait.Sync.js index 5713d5f..82d744a 100644 --- a/implementors/core/marker/trait.Sync.js +++ b/implementors/core/marker/trait.Sync.js @@ -1,3 +1,3 @@ -(function() {var implementors = {}; -implementors["llvm_kaleidoscope_rs"] = [{"text":"impl<'llvm, 'a> !Sync for Codegen<'llvm, 'a>","synthetic":true,"types":["llvm_kaleidoscope_rs::codegen::Codegen"]},{"text":"impl Sync for Token","synthetic":true,"types":["llvm_kaleidoscope_rs::lexer::Token"]},{"text":"impl<I> Sync for Lexer<I> where
    I: Sync
","synthetic":true,"types":["llvm_kaleidoscope_rs::lexer::Lexer"]},{"text":"impl<'llvm> !Sync for BasicBlock<'llvm>","synthetic":true,"types":["llvm_kaleidoscope_rs::llvm::basic_block::BasicBlock"]},{"text":"impl<'llvm> !Sync for IRBuilder<'llvm>","synthetic":true,"types":["llvm_kaleidoscope_rs::llvm::builder::IRBuilder"]},{"text":"impl !Sync for LLJit","synthetic":true,"types":["llvm_kaleidoscope_rs::llvm::lljit::LLJit"]},{"text":"impl<'jit> !Sync for ResourceTracker<'jit>","synthetic":true,"types":["llvm_kaleidoscope_rs::llvm::lljit::ResourceTracker"]},{"text":"impl !Sync for Module","synthetic":true,"types":["llvm_kaleidoscope_rs::llvm::module::Module"]},{"text":"impl<'llvm> !Sync for FunctionPassManager<'llvm>","synthetic":true,"types":["llvm_kaleidoscope_rs::llvm::pass_manager::FunctionPassManager"]},{"text":"impl<'llvm> !Sync for Type<'llvm>","synthetic":true,"types":["llvm_kaleidoscope_rs::llvm::type_::Type"]},{"text":"impl<'llvm> !Sync for Value<'llvm>","synthetic":true,"types":["llvm_kaleidoscope_rs::llvm::value::Value"]},{"text":"impl<'llvm> !Sync for FnValue<'llvm>","synthetic":true,"types":["llvm_kaleidoscope_rs::llvm::value::FnValue"]},{"text":"impl<'llvm> !Sync for PhiValue<'llvm>","synthetic":true,"types":["llvm_kaleidoscope_rs::llvm::value::PhiValue"]},{"text":"impl Sync for ExprAST","synthetic":true,"types":["llvm_kaleidoscope_rs::parser::ExprAST"]},{"text":"impl Sync for PrototypeAST","synthetic":true,"types":["llvm_kaleidoscope_rs::parser::PrototypeAST"]},{"text":"impl Sync for FunctionAST","synthetic":true,"types":["llvm_kaleidoscope_rs::parser::FunctionAST"]},{"text":"impl<I> Sync for Parser<I> where
    I: Sync
","synthetic":true,"types":["llvm_kaleidoscope_rs::parser::Parser"]},{"text":"impl Sync for SmallCStr","synthetic":true,"types":["llvm_kaleidoscope_rs::SmallCStr"]},{"text":"impl<A, B> Sync for Either<A, B> where
    A: Sync,
    B: Sync
","synthetic":true,"types":["llvm_kaleidoscope_rs::Either"]}]; -if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file +(function() {var implementors = { +"llvm_kaleidoscope_rs":[["impl<'llvm, 'a> !Sync for Codegen<'llvm, 'a>",1,["llvm_kaleidoscope_rs::codegen::Codegen"]],["impl Sync for Token",1,["llvm_kaleidoscope_rs::lexer::Token"]],["impl<I> Sync for Lexer<I>where
    I: Sync,
",1,["llvm_kaleidoscope_rs::lexer::Lexer"]],["impl<'llvm> !Sync for BasicBlock<'llvm>",1,["llvm_kaleidoscope_rs::llvm::basic_block::BasicBlock"]],["impl<'llvm> !Sync for IRBuilder<'llvm>",1,["llvm_kaleidoscope_rs::llvm::builder::IRBuilder"]],["impl !Sync for LLJit",1,["llvm_kaleidoscope_rs::llvm::lljit::LLJit"]],["impl<'jit> !Sync for ResourceTracker<'jit>",1,["llvm_kaleidoscope_rs::llvm::lljit::ResourceTracker"]],["impl !Sync for Module",1,["llvm_kaleidoscope_rs::llvm::module::Module"]],["impl<'llvm> !Sync for FunctionPassManager<'llvm>",1,["llvm_kaleidoscope_rs::llvm::pass_manager::FunctionPassManager"]],["impl<'llvm> !Sync for Type<'llvm>",1,["llvm_kaleidoscope_rs::llvm::type_::Type"]],["impl<'llvm> !Sync for Value<'llvm>",1,["llvm_kaleidoscope_rs::llvm::value::Value"]],["impl<'llvm> !Sync for FnValue<'llvm>",1,["llvm_kaleidoscope_rs::llvm::value::FnValue"]],["impl<'llvm> !Sync for PhiValue<'llvm>",1,["llvm_kaleidoscope_rs::llvm::value::PhiValue"]],["impl Sync for ExprAST",1,["llvm_kaleidoscope_rs::parser::ExprAST"]],["impl Sync for PrototypeAST",1,["llvm_kaleidoscope_rs::parser::PrototypeAST"]],["impl Sync for FunctionAST",1,["llvm_kaleidoscope_rs::parser::FunctionAST"]],["impl<I> Sync for Parser<I>where
    I: Sync,
",1,["llvm_kaleidoscope_rs::parser::Parser"]],["impl Sync for SmallCStr",1,["llvm_kaleidoscope_rs::SmallCStr"]],["impl<A, B> Sync for Either<A, B>where
    A: Sync,
    B: Sync,
",1,["llvm_kaleidoscope_rs::Either"]]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/implementors/core/marker/trait.Unpin.js b/implementors/core/marker/trait.Unpin.js index 50f7169..ef7b95b 100644 --- a/implementors/core/marker/trait.Unpin.js +++ b/implementors/core/marker/trait.Unpin.js @@ -1,3 +1,3 @@ -(function() {var implementors = {}; -implementors["llvm_kaleidoscope_rs"] = [{"text":"impl<'llvm, 'a> Unpin for Codegen<'llvm, 'a> where
    'llvm: 'a, 
","synthetic":true,"types":["llvm_kaleidoscope_rs::codegen::Codegen"]},{"text":"impl Unpin for Token","synthetic":true,"types":["llvm_kaleidoscope_rs::lexer::Token"]},{"text":"impl<I> Unpin for Lexer<I> where
    I: Unpin
","synthetic":true,"types":["llvm_kaleidoscope_rs::lexer::Lexer"]},{"text":"impl<'llvm> Unpin for BasicBlock<'llvm>","synthetic":true,"types":["llvm_kaleidoscope_rs::llvm::basic_block::BasicBlock"]},{"text":"impl<'llvm> Unpin for IRBuilder<'llvm>","synthetic":true,"types":["llvm_kaleidoscope_rs::llvm::builder::IRBuilder"]},{"text":"impl Unpin for LLJit","synthetic":true,"types":["llvm_kaleidoscope_rs::llvm::lljit::LLJit"]},{"text":"impl<'jit> Unpin for ResourceTracker<'jit>","synthetic":true,"types":["llvm_kaleidoscope_rs::llvm::lljit::ResourceTracker"]},{"text":"impl Unpin for Module","synthetic":true,"types":["llvm_kaleidoscope_rs::llvm::module::Module"]},{"text":"impl<'llvm> Unpin for FunctionPassManager<'llvm>","synthetic":true,"types":["llvm_kaleidoscope_rs::llvm::pass_manager::FunctionPassManager"]},{"text":"impl<'llvm> Unpin for Type<'llvm>","synthetic":true,"types":["llvm_kaleidoscope_rs::llvm::type_::Type"]},{"text":"impl<'llvm> Unpin for Value<'llvm>","synthetic":true,"types":["llvm_kaleidoscope_rs::llvm::value::Value"]},{"text":"impl<'llvm> Unpin for FnValue<'llvm>","synthetic":true,"types":["llvm_kaleidoscope_rs::llvm::value::FnValue"]},{"text":"impl<'llvm> Unpin for PhiValue<'llvm>","synthetic":true,"types":["llvm_kaleidoscope_rs::llvm::value::PhiValue"]},{"text":"impl Unpin for ExprAST","synthetic":true,"types":["llvm_kaleidoscope_rs::parser::ExprAST"]},{"text":"impl Unpin for PrototypeAST","synthetic":true,"types":["llvm_kaleidoscope_rs::parser::PrototypeAST"]},{"text":"impl Unpin for FunctionAST","synthetic":true,"types":["llvm_kaleidoscope_rs::parser::FunctionAST"]},{"text":"impl<I> Unpin for Parser<I> where
    I: Unpin
","synthetic":true,"types":["llvm_kaleidoscope_rs::parser::Parser"]},{"text":"impl Unpin for SmallCStr","synthetic":true,"types":["llvm_kaleidoscope_rs::SmallCStr"]},{"text":"impl<A, B> Unpin for Either<A, B> where
    A: Unpin,
    B: Unpin
","synthetic":true,"types":["llvm_kaleidoscope_rs::Either"]}]; -if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file +(function() {var implementors = { +"llvm_kaleidoscope_rs":[["impl<'llvm, 'a> Unpin for Codegen<'llvm, 'a>where
    'llvm: 'a,
",1,["llvm_kaleidoscope_rs::codegen::Codegen"]],["impl Unpin for Token",1,["llvm_kaleidoscope_rs::lexer::Token"]],["impl<I> Unpin for Lexer<I>where
    I: Unpin,
",1,["llvm_kaleidoscope_rs::lexer::Lexer"]],["impl<'llvm> Unpin for BasicBlock<'llvm>",1,["llvm_kaleidoscope_rs::llvm::basic_block::BasicBlock"]],["impl<'llvm> Unpin for IRBuilder<'llvm>",1,["llvm_kaleidoscope_rs::llvm::builder::IRBuilder"]],["impl Unpin for LLJit",1,["llvm_kaleidoscope_rs::llvm::lljit::LLJit"]],["impl<'jit> Unpin for ResourceTracker<'jit>",1,["llvm_kaleidoscope_rs::llvm::lljit::ResourceTracker"]],["impl Unpin for Module",1,["llvm_kaleidoscope_rs::llvm::module::Module"]],["impl<'llvm> Unpin for FunctionPassManager<'llvm>",1,["llvm_kaleidoscope_rs::llvm::pass_manager::FunctionPassManager"]],["impl<'llvm> Unpin for Type<'llvm>",1,["llvm_kaleidoscope_rs::llvm::type_::Type"]],["impl<'llvm> Unpin for Value<'llvm>",1,["llvm_kaleidoscope_rs::llvm::value::Value"]],["impl<'llvm> Unpin for FnValue<'llvm>",1,["llvm_kaleidoscope_rs::llvm::value::FnValue"]],["impl<'llvm> Unpin for PhiValue<'llvm>",1,["llvm_kaleidoscope_rs::llvm::value::PhiValue"]],["impl Unpin for ExprAST",1,["llvm_kaleidoscope_rs::parser::ExprAST"]],["impl Unpin for PrototypeAST",1,["llvm_kaleidoscope_rs::parser::PrototypeAST"]],["impl Unpin for FunctionAST",1,["llvm_kaleidoscope_rs::parser::FunctionAST"]],["impl<I> Unpin for Parser<I>where
    I: Unpin,
",1,["llvm_kaleidoscope_rs::parser::Parser"]],["impl Unpin for SmallCStr",1,["llvm_kaleidoscope_rs::SmallCStr"]],["impl<A, B> Unpin for Either<A, B>where
    A: Unpin,
    B: Unpin,
",1,["llvm_kaleidoscope_rs::Either"]]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/implementors/core/ops/deref/trait.Deref.js b/implementors/core/ops/deref/trait.Deref.js index 55f250e..60212c1 100644 --- a/implementors/core/ops/deref/trait.Deref.js +++ b/implementors/core/ops/deref/trait.Deref.js @@ -1,3 +1,3 @@ -(function() {var implementors = {}; -implementors["llvm_kaleidoscope_rs"] = [{"text":"impl<'llvm> Deref for FnValue<'llvm>","synthetic":false,"types":["llvm_kaleidoscope_rs::llvm::value::FnValue"]},{"text":"impl<'llvm> Deref for PhiValue<'llvm>","synthetic":false,"types":["llvm_kaleidoscope_rs::llvm::value::PhiValue"]}]; -if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file +(function() {var implementors = { +"llvm_kaleidoscope_rs":[["impl<'llvm> Deref for FnValue<'llvm>"],["impl<'llvm> Deref for PhiValue<'llvm>"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/implementors/core/ops/drop/trait.Drop.js b/implementors/core/ops/drop/trait.Drop.js index 8571c22..0e85143 100644 --- a/implementors/core/ops/drop/trait.Drop.js +++ b/implementors/core/ops/drop/trait.Drop.js @@ -1,3 +1,3 @@ -(function() {var implementors = {}; -implementors["llvm_kaleidoscope_rs"] = [{"text":"impl Drop for IRBuilder<'_>","synthetic":false,"types":["llvm_kaleidoscope_rs::llvm::builder::IRBuilder"]},{"text":"impl Drop for ResourceTracker<'_>","synthetic":false,"types":["llvm_kaleidoscope_rs::llvm::lljit::ResourceTracker"]},{"text":"impl Drop for Module","synthetic":false,"types":["llvm_kaleidoscope_rs::llvm::module::Module"]},{"text":"impl Drop for FunctionPassManager<'_>","synthetic":false,"types":["llvm_kaleidoscope_rs::llvm::pass_manager::FunctionPassManager"]}]; -if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file +(function() {var implementors = { +"llvm_kaleidoscope_rs":[["impl Drop for IRBuilder<'_>"],["impl Drop for ResourceTracker<'_>"],["impl Drop for Module"],["impl Drop for FunctionPassManager<'_>"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/implementors/core/panic/unwind_safe/trait.RefUnwindSafe.js b/implementors/core/panic/unwind_safe/trait.RefUnwindSafe.js index fadb1e5..626e139 100644 --- a/implementors/core/panic/unwind_safe/trait.RefUnwindSafe.js +++ b/implementors/core/panic/unwind_safe/trait.RefUnwindSafe.js @@ -1,3 +1,3 @@ -(function() {var implementors = {}; -implementors["llvm_kaleidoscope_rs"] = [{"text":"impl<'llvm, 'a> RefUnwindSafe for Codegen<'llvm, 'a>","synthetic":true,"types":["llvm_kaleidoscope_rs::codegen::Codegen"]},{"text":"impl RefUnwindSafe for Token","synthetic":true,"types":["llvm_kaleidoscope_rs::lexer::Token"]},{"text":"impl<I> RefUnwindSafe for Lexer<I> where
    I: RefUnwindSafe
","synthetic":true,"types":["llvm_kaleidoscope_rs::lexer::Lexer"]},{"text":"impl<'llvm> RefUnwindSafe for BasicBlock<'llvm>","synthetic":true,"types":["llvm_kaleidoscope_rs::llvm::basic_block::BasicBlock"]},{"text":"impl<'llvm> RefUnwindSafe for IRBuilder<'llvm>","synthetic":true,"types":["llvm_kaleidoscope_rs::llvm::builder::IRBuilder"]},{"text":"impl RefUnwindSafe for LLJit","synthetic":true,"types":["llvm_kaleidoscope_rs::llvm::lljit::LLJit"]},{"text":"impl<'jit> RefUnwindSafe for ResourceTracker<'jit>","synthetic":true,"types":["llvm_kaleidoscope_rs::llvm::lljit::ResourceTracker"]},{"text":"impl RefUnwindSafe for Module","synthetic":true,"types":["llvm_kaleidoscope_rs::llvm::module::Module"]},{"text":"impl<'llvm> RefUnwindSafe for FunctionPassManager<'llvm>","synthetic":true,"types":["llvm_kaleidoscope_rs::llvm::pass_manager::FunctionPassManager"]},{"text":"impl<'llvm> RefUnwindSafe for Type<'llvm>","synthetic":true,"types":["llvm_kaleidoscope_rs::llvm::type_::Type"]},{"text":"impl<'llvm> RefUnwindSafe for Value<'llvm>","synthetic":true,"types":["llvm_kaleidoscope_rs::llvm::value::Value"]},{"text":"impl<'llvm> RefUnwindSafe for FnValue<'llvm>","synthetic":true,"types":["llvm_kaleidoscope_rs::llvm::value::FnValue"]},{"text":"impl<'llvm> RefUnwindSafe for PhiValue<'llvm>","synthetic":true,"types":["llvm_kaleidoscope_rs::llvm::value::PhiValue"]},{"text":"impl RefUnwindSafe for ExprAST","synthetic":true,"types":["llvm_kaleidoscope_rs::parser::ExprAST"]},{"text":"impl RefUnwindSafe for PrototypeAST","synthetic":true,"types":["llvm_kaleidoscope_rs::parser::PrototypeAST"]},{"text":"impl RefUnwindSafe for FunctionAST","synthetic":true,"types":["llvm_kaleidoscope_rs::parser::FunctionAST"]},{"text":"impl<I> RefUnwindSafe for Parser<I> where
    I: RefUnwindSafe
","synthetic":true,"types":["llvm_kaleidoscope_rs::parser::Parser"]},{"text":"impl RefUnwindSafe for SmallCStr","synthetic":true,"types":["llvm_kaleidoscope_rs::SmallCStr"]},{"text":"impl<A, B> RefUnwindSafe for Either<A, B> where
    A: RefUnwindSafe,
    B: RefUnwindSafe
","synthetic":true,"types":["llvm_kaleidoscope_rs::Either"]}]; -if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file +(function() {var implementors = { +"llvm_kaleidoscope_rs":[["impl<'llvm, 'a> RefUnwindSafe for Codegen<'llvm, 'a>",1,["llvm_kaleidoscope_rs::codegen::Codegen"]],["impl RefUnwindSafe for Token",1,["llvm_kaleidoscope_rs::lexer::Token"]],["impl<I> RefUnwindSafe for Lexer<I>where
    I: RefUnwindSafe,
",1,["llvm_kaleidoscope_rs::lexer::Lexer"]],["impl<'llvm> RefUnwindSafe for BasicBlock<'llvm>",1,["llvm_kaleidoscope_rs::llvm::basic_block::BasicBlock"]],["impl<'llvm> RefUnwindSafe for IRBuilder<'llvm>",1,["llvm_kaleidoscope_rs::llvm::builder::IRBuilder"]],["impl RefUnwindSafe for LLJit",1,["llvm_kaleidoscope_rs::llvm::lljit::LLJit"]],["impl<'jit> RefUnwindSafe for ResourceTracker<'jit>",1,["llvm_kaleidoscope_rs::llvm::lljit::ResourceTracker"]],["impl RefUnwindSafe for Module",1,["llvm_kaleidoscope_rs::llvm::module::Module"]],["impl<'llvm> RefUnwindSafe for FunctionPassManager<'llvm>",1,["llvm_kaleidoscope_rs::llvm::pass_manager::FunctionPassManager"]],["impl<'llvm> RefUnwindSafe for Type<'llvm>",1,["llvm_kaleidoscope_rs::llvm::type_::Type"]],["impl<'llvm> RefUnwindSafe for Value<'llvm>",1,["llvm_kaleidoscope_rs::llvm::value::Value"]],["impl<'llvm> RefUnwindSafe for FnValue<'llvm>",1,["llvm_kaleidoscope_rs::llvm::value::FnValue"]],["impl<'llvm> RefUnwindSafe for PhiValue<'llvm>",1,["llvm_kaleidoscope_rs::llvm::value::PhiValue"]],["impl RefUnwindSafe for ExprAST",1,["llvm_kaleidoscope_rs::parser::ExprAST"]],["impl RefUnwindSafe for PrototypeAST",1,["llvm_kaleidoscope_rs::parser::PrototypeAST"]],["impl RefUnwindSafe for FunctionAST",1,["llvm_kaleidoscope_rs::parser::FunctionAST"]],["impl<I> RefUnwindSafe for Parser<I>where
    I: RefUnwindSafe,
",1,["llvm_kaleidoscope_rs::parser::Parser"]],["impl RefUnwindSafe for SmallCStr",1,["llvm_kaleidoscope_rs::SmallCStr"]],["impl<A, B> RefUnwindSafe for Either<A, B>where
    A: RefUnwindSafe,
    B: RefUnwindSafe,
",1,["llvm_kaleidoscope_rs::Either"]]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/implementors/core/panic/unwind_safe/trait.UnwindSafe.js b/implementors/core/panic/unwind_safe/trait.UnwindSafe.js index 7bca735..1b1a37d 100644 --- a/implementors/core/panic/unwind_safe/trait.UnwindSafe.js +++ b/implementors/core/panic/unwind_safe/trait.UnwindSafe.js @@ -1,3 +1,3 @@ -(function() {var implementors = {}; -implementors["llvm_kaleidoscope_rs"] = [{"text":"impl<'llvm, 'a> !UnwindSafe for Codegen<'llvm, 'a>","synthetic":true,"types":["llvm_kaleidoscope_rs::codegen::Codegen"]},{"text":"impl UnwindSafe for Token","synthetic":true,"types":["llvm_kaleidoscope_rs::lexer::Token"]},{"text":"impl<I> UnwindSafe for Lexer<I> where
    I: UnwindSafe
","synthetic":true,"types":["llvm_kaleidoscope_rs::lexer::Lexer"]},{"text":"impl<'llvm> UnwindSafe for BasicBlock<'llvm>","synthetic":true,"types":["llvm_kaleidoscope_rs::llvm::basic_block::BasicBlock"]},{"text":"impl<'llvm> UnwindSafe for IRBuilder<'llvm>","synthetic":true,"types":["llvm_kaleidoscope_rs::llvm::builder::IRBuilder"]},{"text":"impl UnwindSafe for LLJit","synthetic":true,"types":["llvm_kaleidoscope_rs::llvm::lljit::LLJit"]},{"text":"impl<'jit> UnwindSafe for ResourceTracker<'jit>","synthetic":true,"types":["llvm_kaleidoscope_rs::llvm::lljit::ResourceTracker"]},{"text":"impl UnwindSafe for Module","synthetic":true,"types":["llvm_kaleidoscope_rs::llvm::module::Module"]},{"text":"impl<'llvm> UnwindSafe for FunctionPassManager<'llvm>","synthetic":true,"types":["llvm_kaleidoscope_rs::llvm::pass_manager::FunctionPassManager"]},{"text":"impl<'llvm> UnwindSafe for Type<'llvm>","synthetic":true,"types":["llvm_kaleidoscope_rs::llvm::type_::Type"]},{"text":"impl<'llvm> UnwindSafe for Value<'llvm>","synthetic":true,"types":["llvm_kaleidoscope_rs::llvm::value::Value"]},{"text":"impl<'llvm> UnwindSafe for FnValue<'llvm>","synthetic":true,"types":["llvm_kaleidoscope_rs::llvm::value::FnValue"]},{"text":"impl<'llvm> UnwindSafe for PhiValue<'llvm>","synthetic":true,"types":["llvm_kaleidoscope_rs::llvm::value::PhiValue"]},{"text":"impl UnwindSafe for ExprAST","synthetic":true,"types":["llvm_kaleidoscope_rs::parser::ExprAST"]},{"text":"impl UnwindSafe for PrototypeAST","synthetic":true,"types":["llvm_kaleidoscope_rs::parser::PrototypeAST"]},{"text":"impl UnwindSafe for FunctionAST","synthetic":true,"types":["llvm_kaleidoscope_rs::parser::FunctionAST"]},{"text":"impl<I> UnwindSafe for Parser<I> where
    I: UnwindSafe
","synthetic":true,"types":["llvm_kaleidoscope_rs::parser::Parser"]},{"text":"impl UnwindSafe for SmallCStr","synthetic":true,"types":["llvm_kaleidoscope_rs::SmallCStr"]},{"text":"impl<A, B> UnwindSafe for Either<A, B> where
    A: UnwindSafe,
    B: UnwindSafe
","synthetic":true,"types":["llvm_kaleidoscope_rs::Either"]}]; -if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file +(function() {var implementors = { +"llvm_kaleidoscope_rs":[["impl<'llvm, 'a> !UnwindSafe for Codegen<'llvm, 'a>",1,["llvm_kaleidoscope_rs::codegen::Codegen"]],["impl UnwindSafe for Token",1,["llvm_kaleidoscope_rs::lexer::Token"]],["impl<I> UnwindSafe for Lexer<I>where
    I: UnwindSafe,
",1,["llvm_kaleidoscope_rs::lexer::Lexer"]],["impl<'llvm> UnwindSafe for BasicBlock<'llvm>",1,["llvm_kaleidoscope_rs::llvm::basic_block::BasicBlock"]],["impl<'llvm> UnwindSafe for IRBuilder<'llvm>",1,["llvm_kaleidoscope_rs::llvm::builder::IRBuilder"]],["impl UnwindSafe for LLJit",1,["llvm_kaleidoscope_rs::llvm::lljit::LLJit"]],["impl<'jit> UnwindSafe for ResourceTracker<'jit>",1,["llvm_kaleidoscope_rs::llvm::lljit::ResourceTracker"]],["impl UnwindSafe for Module",1,["llvm_kaleidoscope_rs::llvm::module::Module"]],["impl<'llvm> UnwindSafe for FunctionPassManager<'llvm>",1,["llvm_kaleidoscope_rs::llvm::pass_manager::FunctionPassManager"]],["impl<'llvm> UnwindSafe for Type<'llvm>",1,["llvm_kaleidoscope_rs::llvm::type_::Type"]],["impl<'llvm> UnwindSafe for Value<'llvm>",1,["llvm_kaleidoscope_rs::llvm::value::Value"]],["impl<'llvm> UnwindSafe for FnValue<'llvm>",1,["llvm_kaleidoscope_rs::llvm::value::FnValue"]],["impl<'llvm> UnwindSafe for PhiValue<'llvm>",1,["llvm_kaleidoscope_rs::llvm::value::PhiValue"]],["impl UnwindSafe for ExprAST",1,["llvm_kaleidoscope_rs::parser::ExprAST"]],["impl UnwindSafe for PrototypeAST",1,["llvm_kaleidoscope_rs::parser::PrototypeAST"]],["impl UnwindSafe for FunctionAST",1,["llvm_kaleidoscope_rs::parser::FunctionAST"]],["impl<I> UnwindSafe for Parser<I>where
    I: UnwindSafe,
",1,["llvm_kaleidoscope_rs::parser::Parser"]],["impl UnwindSafe for SmallCStr",1,["llvm_kaleidoscope_rs::SmallCStr"]],["impl<A, B> UnwindSafe for Either<A, B>where
    A: UnwindSafe,
    B: UnwindSafe,
",1,["llvm_kaleidoscope_rs::Either"]]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/light.css b/light.css index ceb83fc..e5e394d 100644 --- a/light.css +++ b/light.css @@ -1 +1 @@ - body,#settings-menu #settings,#settings-menu #settings::before{background-color:white;color:black;}.setting-line .radio-line input{border-color:black;}.setting-line .radio-line input:checked{box-shadow:inset 0 0 0 3px white;background-color:#2196f3;}.setting-line .radio-line input:focus{box-shadow:0 0 1px 1px #2196f3;}.setting-line .radio-line input:checked:focus{box-shadow:inset 0 0 0 3px white,0 0 2px 2px #2196f3;}.setting-line .radio-line input:hover{border-color:#2196f3 !important;}.slider{background-color:#ccc;}.slider:before{background-color:white;}input:checked+.slider{background-color:#2196F3;}input:focus+.slider{box-shadow:0 0 0 2px #0a84ff,0 0 0 6px rgba(10,132,255,0.3);}h1,h2,h3,h4{color:black;}h1.fqn{border-bottom-color:#DDDDDD;}h2,h3,h4{border-bottom-color:#DDDDDD;}.in-band{background-color:white;}.invisible{background:rgba(0,0,0,0);}.docblock code,.docblock-short code{background-color:#F5F5F5;}pre,.rustdoc.source .example-wrap{background-color:#F5F5F5;}.sidebar,.mobile-topbar,.sidebar-menu-toggle{background-color:#F5F5F5;}*{scrollbar-color:rgba(36,37,39,0.6) #e6e6e6;}.sidebar{scrollbar-color:rgba(36,37,39,0.6) #d9d9d9;}.rust-logo{}::-webkit-scrollbar-track{background-color:#ecebeb;}::-webkit-scrollbar-thumb{background-color:rgba(36,37,39,0.6);}.sidebar::-webkit-scrollbar-track{background-color:#dcdcdc;}.sidebar::-webkit-scrollbar-thumb{background-color:rgba(36,37,39,0.6);}.sidebar .current,.sidebar a:hover{background-color:#fff;}.source .sidebar{background-color:#f1f1f1;}.line-numbers span{color:#c67e2d;}.line-numbers .line-highlighted{background-color:#FDFFD3 !important;}.docblock h1,.docblock h2,.docblock h3,.docblock h4,.docblock h5,.docblock h6{border-bottom-color:#ddd;}.docblock table td,.docblock table th{border-color:#ddd;}.content .method .where,.content .fn .where,.content .where.fmt-newline{color:#4E4C4C;}.search-results a:hover{background-color:#ddd;}.search-results a:focus{color:#000 !important;background-color:#ccc;}.search-results a:focus span{color:#000 !important;}a.result-trait:focus{background-color:#c7b6ff;}a.result-traitalias:focus{background-color:#c7b6ff;}a.result-mod:focus,a.result-externcrate:focus{background-color:#afc6e4;}a.result-enum:focus{background-color:#e7b1a0;}a.result-struct:focus{background-color:#e7b1a0;}a.result-union:focus{background-color:#e7b1a0;}a.result-fn:focus,a.result-method:focus,a.result-tymethod:focus{background-color:#c6afb3;}a.result-type:focus{background-color:#e7b1a0;}a.result-associatedtype:focus{background-color:#afc6e4;}a.result-foreigntype:focus{background-color:#e7b1a0;}a.result-attr:focus,a.result-derive:focus,a.result-macro:focus{background-color:#8ce488;}a.result-constant:focus,a.result-static:focus{background-color:#afc6e4;}a.result-primitive:focus{background-color:#e7b1a0;}a.result-keyword:focus{background-color:#afc6e4;}.content .item-info::before{color:#ccc;}.content span.enum,.content a.enum,.block a.current.enum{color:#AD378A;}.content span.struct,.content a.struct,.block a.current.struct{color:#AD378A;}.content span.type,.content a.type,.block a.current.type{color:#AD378A;}.content span.foreigntype,.content a.foreigntype,.block a.current.foreigntype{color:#3873AD;}.content span.associatedtype,.content a.associatedtype,.block a.current.associatedtype{color:#3873AD;}.content span.attr,.content a.attr,.block a.current.attr,.content span.derive,.content a.derive,.block a.current.derive,.content span.macro,.content a.macro,.block a.current.macro{color:#068000;}.content span.union,.content a.union,.block a.current.union{color:#AD378A;}.content span.constant,.content a.constant,.block a.current.constant,.content span.static,.content a.static,.block a.current.static{color:#3873AD;}.content span.primitive,.content a.primitive,.block a.current.primitive{color:#AD378A;}.content span.externcrate,.content span.mod,.content a.mod,.block a.current.mod{color:#3873AD;}.content span.trait,.content a.trait,.block a.current.trait{color:#6E4FC9;}.content span.traitalias,.content a.traitalias,.block a.current.traitalias{color:#5137AD;}.content span.fn,.content a.fn,.block a.current.fn,.content span.method,.content a.method,.block a.current.method,.content span.tymethod,.content a.tymethod,.block a.current.tymethod,.content .fnname{color:#AD7C37;}.content span.keyword,.content a.keyword,.block a.current.keyword{color:#3873AD;}.sidebar a{color:#356da4;}.sidebar a.current.enum{color:#a63283;}.sidebar a.current.struct{color:#a63283;}.sidebar a.current.type{color:#a63283;}.sidebar a.current.associatedtype{color:#356da4;}.sidebar a.current.foreigntype{color:#356da4;}.sidebar a.current.attr,.sidebar a.current.derive,.sidebar a.current.macro{color:#067901;}.sidebar a.current.union{color:#a63283;}.sidebar a.current.constant .sidebar a.current.static{color:#356da4;}.sidebar a.current.primitive{color:#a63283;}.sidebar a.current.externcrate .sidebar a.current.mod{color:#356da4;}.sidebar a.current.trait{color:#6849c3;}.sidebar a.current.traitalias{color:#4b349e;}.sidebar a.current.fn,.sidebar a.current.method,.sidebar a.current.tymethod{color:#a67736;}.sidebar a.current.keyword{color:#356da4;}nav.main .current{border-top-color:#000;border-bottom-color:#000;}nav.main .separator{border:1px solid #000;}a{color:#3873AD;}a#toggle-all-docs,a.anchor,.small-section-header a,#source-sidebar a,pre.rust a,.sidebar h2 a,.sidebar h3 a,.mobile-topbar h2 a,.in-band a{color:#000;}.search-results a{color:initial;}a.test-arrow{color:#f5f5f5;}body.source .example-wrap pre.rust a{background:#eee;}details.rustdoc-toggle>summary.hideme>span,details.rustdoc-toggle>summary::before,details.undocumented>summary::before{color:#999;}#crate-search,.search-input{background-color:white;border-color:#e0e0e0 !important;}.search-input:focus{border-color:#66afe9;}.module-item .stab,.import-item .stab{color:#000;}.stab.empty-impl{background:#FFF5D6;border-color:#FFC600;}.stab.unstable{background:#FFF5D6;border-color:#FFC600;}.stab.deprecated{background:#ffc4c4;border-color:#db7b7b;}.stab.portability{background:#F3DFFF;border-color:#b07bdb;}.stab.portability>code{background:none;}#help>div{background:#e9e9e9;border-color:#bfbfbf;}#help span.bottom,#help span.top{border-color:#bfbfbf;}.rightside,.out-of-band{color:grey;}.result-name .primitive>i,.result-name .keyword>i{color:black;}.line-numbers :target{background-color:transparent;}pre.rust .kw{color:#8959A8;}pre.rust .kw-2,pre.rust .prelude-ty{color:#4271AE;}pre.rust .number,pre.rust .string{color:#718C00;}pre.rust .self,pre.rust .bool-val,pre.rust .prelude-val,pre.rust .attribute,pre.rust .attribute .ident{color:#C82829;}pre.rust .comment{color:#8E908C;}pre.rust .doccomment{color:#4D4D4C;}pre.rust .macro,pre.rust .macro-nonterminal{color:#3E999F;}pre.rust .lifetime{color:#B76514;}pre.rust .question-mark{color:#ff9011;}.example-wrap>pre.line-number{border-color:#c7c7c7;}a.test-arrow{background-color:rgb(78,139,202,0.2);}a.test-arrow:hover{background-color:#4e8bca;}.toggle-label,.code-attribute{color:#999;}:target{background:#FDFFD3;border-right:3px solid #AD7C37;}pre.compile_fail{border-left:2px solid rgba(255,0,0,.5);}pre.compile_fail:hover,.information:hover+pre.compile_fail{border-left:2px solid #f00;}pre.should_panic{border-left:2px solid rgba(255,0,0,.5);}pre.should_panic:hover,.information:hover+pre.should_panic{border-left:2px solid #f00;}pre.ignore{border-left:2px solid rgba(255,142,0,.6);}pre.ignore:hover,.information:hover+pre.ignore{border-left:2px solid #ff9200;}.tooltip.compile_fail{color:rgba(255,0,0,.5);}.information>.compile_fail:hover{color:#f00;}.tooltip.should_panic{color:rgba(255,0,0,.5);}.information>.should_panic:hover{color:#f00;}.tooltip.ignore{color:rgba(255,142,0,.6);}.information>.ignore:hover{color:#ff9200;}.search-failed a{color:#3873AD;}.tooltip::after{background-color:#000;color:#fff;}.tooltip::before{border-color:transparent black transparent transparent;}.notable-traits-tooltiptext{background-color:#eee;border-color:#999;}.notable-traits-tooltiptext .notable{border-bottom-color:#DDDDDD;}#titles>button:not(.selected){background-color:#e6e6e6;border-top-color:#e6e6e6;}#titles>button:hover,#titles>button.selected{background-color:#ffffff;border-top-color:#0089ff;}#titles>button>div.count{color:#888;}@media (max-width:700px){.sidebar-menu{background-color:#F5F5F5;border-bottom-color:#e0e0e0;border-right-color:#e0e0e0;}.sidebar-elems{background-color:#F5F5F5;border-right-color:#000;}#sidebar-filler{background-color:#F5F5F5;border-bottom-color:#e0e0e0;}}kbd{color:#000;background-color:#fafbfc;border-color:#d1d5da;border-bottom-color:#c6cbd1;box-shadow:inset 0 -1px 0 #c6cbd1;}#settings-menu>a,#help-button{border-color:#e0e0e0;background-color:#fff;}#settings-menu>a:hover,#settings-menu>a:focus,#help-button:hover,#help-button:focus{border-color:#717171;}#settings-menu #settings,#settings-menu #settings::before{border-color:#DDDDDD;}#copy-path{color:#999;}#copy-path>img{filter:invert(50%);}#copy-path:hover>img{filter:invert(35%);}#theme-choices{border-color:#ccc;background-color:#fff;}#theme-choices>button:not(:first-child){border-top-color:#e0e0e0;}#theme-choices>button:hover,#theme-choices>button:focus{background-color:#eee;}.search-results .result-name span.alias{color:#000;}.search-results .result-name span.grey{color:#999;}#sidebar-toggle{background-color:#F5F5F5;}#sidebar-toggle:hover{background-color:#E0E0E0;}#source-sidebar{background-color:#F5F5F5;}#source-sidebar>.title{border-bottom-color:#ccc;}div.files>a:hover,div.name:hover{background-color:#E0E0E0;}div.files>.selected{background-color:#fff;}.scraped-example-list .scrape-help{border-color:#555;color:#333;}.scraped-example-list .scrape-help:hover{border-color:black;color:black;}.more-examples-toggle summary,.more-examples-toggle .hide-more{color:#999;}.scraped-example .example-wrap .rust span.highlight{background:#fcffd6;}.scraped-example .example-wrap .rust span.highlight.focus{background:#f6fdb0;}.scraped-example:not(.expanded) .code-wrapper:before{background:linear-gradient(to bottom,rgba(255,255,255,1),rgba(255,255,255,0));}.scraped-example:not(.expanded) .code-wrapper:after{background:linear-gradient(to top,rgba(255,255,255,1),rgba(255,255,255,0));}.toggle-line-inner{background:#ccc;}.toggle-line:hover .toggle-line-inner{background:#999;} \ No newline at end of file +:root{--main-background-color:white;--main-color:black;--settings-input-color:#2196f3;--sidebar-background-color:#F5F5F5;--sidebar-background-color-hover:#E0E0E0;--code-block-background-color:#F5F5F5;--scrollbar-track-background-color:#dcdcdc;--scrollbar-thumb-background-color:rgba(36,37,39,0.6);--scrollbar-color:rgba(36,37,39,0.6) #d9d9d9;--headings-border-bottom-color:#ddd;--border-color:#e0e0e0;--button-background-color:#fff;--right-side-color:grey;--code-attribute-color:#999;--toggles-color:#999;--search-input-focused-border-color:#66afe9;--copy-path-button-color:#999;--copy-path-img-filter:invert(50%);--copy-path-img-hover-filter:invert(35%);--codeblock-error-hover-color:rgb(255,0,0);--codeblock-error-color:rgba(255,0,0,.5);--codeblock-ignore-hover-color:rgb(255,142,0);--codeblock-ignore-color:rgba(255,142,0,.6);--type-link-color:#ad378a;--trait-link-color:#6e4fc9;--assoc-item-link-color:#3873ad;--function-link-color:#ad7c37;--macro-link-color:#068000;--keyword-link-color:#3873ad;--mod-link-color:#3873ad;--link-color:#3873ad;}.slider{background-color:#ccc;}.slider:before{background-color:white;}input:focus+.slider{box-shadow:0 0 0 2px #0a84ff,0 0 0 6px rgba(10,132,255,0.3);}.rust-logo{}.sidebar .current,.sidebar a:hover{background-color:#fff;}.line-numbers span{color:#c67e2d;}.line-numbers .line-highlighted{background-color:#FDFFD3 !important;}.search-results a:hover{background-color:#ddd;}.search-results a:focus{color:#000 !important;background-color:#ccc;}.search-results a:focus span{color:#000 !important;}a.result-trait:focus{background-color:#c7b6ff;}a.result-traitalias:focus{background-color:#c7b6ff;}a.result-mod:focus,a.result-externcrate:focus{background-color:#afc6e4;}a.result-enum:focus{background-color:#e7b1a0;}a.result-struct:focus{background-color:#e7b1a0;}a.result-union:focus{background-color:#e7b1a0;}a.result-fn:focus,a.result-method:focus,a.result-tymethod:focus{background-color:#c6afb3;}a.result-type:focus{background-color:#e7b1a0;}a.result-associatedtype:focus{background-color:#afc6e4;}a.result-foreigntype:focus{background-color:#e7b1a0;}a.result-attr:focus,a.result-derive:focus,a.result-macro:focus{background-color:#8ce488;}a.result-constant:focus,a.result-static:focus{background-color:#afc6e4;}a.result-primitive:focus{background-color:#e7b1a0;}a.result-keyword:focus{background-color:#afc6e4;}.content .item-info::before{color:#ccc;}.sidebar a{color:#356da4;}.sidebar a.current.enum{color:#a63283;}.sidebar a.current.struct{color:#a63283;}.sidebar a.current.type{color:#a63283;}.sidebar a.current.foreigntype{color:#356da4;}.sidebar a.current.attr,.sidebar a.current.derive,.sidebar a.current.macro{color:#067901;}.sidebar a.current.union{color:#a63283;}.sidebar a.current.constant .sidebar a.current.static{color:#356da4;}.sidebar a.current.primitive{color:#a63283;}.sidebar a.current.trait{color:#6849c3;}.sidebar a.current.traitalias{color:#4b349e;}.sidebar a.current.fn{color:#a67736;}.sidebar a.current.keyword{color:#356da4;}body.source .example-wrap pre.rust a{background:#eee;}#crate-search-div::after{filter:invert(100%) sepia(0%) saturate(4223%) hue-rotate(289deg) brightness(114%) contrast(76%);}#crate-search:hover,#crate-search:focus{border-color:#717171 !important;}#crate-search-div:hover::after,#crate-search-div:focus-within::after{filter:invert(44%) sepia(18%) saturate(23%) hue-rotate(317deg) brightness(96%) contrast(93%);}.stab{background:#FFF5D6;border-color:#FFC600;}.stab.portability>code{background:none;}.line-numbers :target{background-color:transparent;}pre.rust .kw{color:#8959A8;}pre.rust .kw-2,pre.rust .prelude-ty{color:#4271AE;}pre.rust .number,pre.rust .string{color:#718C00;}pre.rust .self,pre.rust .bool-val,pre.rust .prelude-val,pre.rust .attribute{color:#C82829;}pre.rust .comment{color:#8E908C;}pre.rust .doccomment{color:#4D4D4C;}pre.rust .macro,pre.rust .macro-nonterminal{color:#3E999F;}pre.rust .lifetime{color:#B76514;}pre.rust .question-mark{color:#ff9011;}.example-wrap>pre.line-number{border-color:#c7c7c7;}a.test-arrow{color:#f5f5f5;background-color:rgba(78,139,202,0.2);}a.test-arrow:hover{background-color:#4e8bca;}:target{background:#FDFFD3;border-right:3px solid #AD7C37;}.search-failed a{color:#3873AD;}.tooltip::after{background-color:#000;color:#fff;}.tooltip::before{border-color:transparent black transparent transparent;}.notable-traits-tooltiptext{background-color:#eee;}#titles>button:not(.selected){background-color:#e6e6e6;border-top-color:#e6e6e6;}#titles>button:hover,#titles>button.selected{background-color:#ffffff;border-top-color:#0089ff;}#titles>button>div.count{color:#888;}kbd{color:#000;background-color:#fafbfc;box-shadow:inset 0 -1px 0 #c6cbd1;}#settings-menu>a:hover,#settings-menu>a:focus,#help-button>button:hover,#help-button>button:focus{border-color:#717171;}.search-results .result-name span.alias{color:#000;}.search-results .result-name span.grey{color:#999;}#source-sidebar div.files>a:hover,details.dir-entry summary:hover,#source-sidebar div.files>a:focus,details.dir-entry summary:focus{background-color:#E0E0E0;}#source-sidebar div.files>a.selected{background-color:#fff;}.scraped-example-list .scrape-help{border-color:#555;color:#333;}.scraped-example-list .scrape-help:hover{border-color:black;color:black;}.scraped-example .example-wrap .rust span.highlight{background:#fcffd6;}.scraped-example .example-wrap .rust span.highlight.focus{background:#f6fdb0;}.scraped-example:not(.expanded) .code-wrapper:before{background:linear-gradient(to bottom,rgba(255,255,255,1),rgba(255,255,255,0));}.scraped-example:not(.expanded) .code-wrapper:after{background:linear-gradient(to top,rgba(255,255,255,1),rgba(255,255,255,0));}.toggle-line-inner{background:#ccc;}.toggle-line:hover .toggle-line-inner{background:#999;} \ No newline at end of file diff --git a/llvm_kaleidoscope_rs/all.html b/llvm_kaleidoscope_rs/all.html index 1ce2b8c..be46318 100644 --- a/llvm_kaleidoscope_rs/all.html +++ b/llvm_kaleidoscope_rs/all.html @@ -1,8 +1 @@ -List of all items in this crate -
- \ No newline at end of file +List of all items in this crate
\ No newline at end of file diff --git a/llvm_kaleidoscope_rs/codegen/index.html b/llvm_kaleidoscope_rs/codegen/index.html index f4719e5..05c6cde 100644 --- a/llvm_kaleidoscope_rs/codegen/index.html +++ b/llvm_kaleidoscope_rs/codegen/index.html @@ -1,11 +1 @@ -llvm_kaleidoscope_rs::codegen - Rust -

Structs

-

Code generator from kaleidoscope AST to LLVM IR.

-
- \ No newline at end of file +llvm_kaleidoscope_rs::codegen - Rust

Structs

Code generator from kaleidoscope AST to LLVM IR.
\ No newline at end of file diff --git a/llvm_kaleidoscope_rs/codegen/struct.Codegen.html b/llvm_kaleidoscope_rs/codegen/struct.Codegen.html index a2cca22..c84fc43 100644 --- a/llvm_kaleidoscope_rs/codegen/struct.Codegen.html +++ b/llvm_kaleidoscope_rs/codegen/struct.Codegen.html @@ -1,22 +1,7 @@ -Codegen in llvm_kaleidoscope_rs::codegen - Rust -
pub struct Codegen<'llvm, 'a> { /* private fields */ }
Expand description

Code generator from kaleidoscope AST to LLVM IR.

-

Implementations

Compile either a PrototypeAST or a FunctionAST into the LLVM module.

-

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

-

Immutably borrows from an owned value. Read more

-

Mutably borrows from an owned value. Read more

-

Returns the argument unchanged.

-

Calls U::from(self).

+Codegen in llvm_kaleidoscope_rs::codegen - Rust
pub struct Codegen<'llvm, 'a> { /* private fields */ }
Expand description

Code generator from kaleidoscope AST to LLVM IR.

+

Implementations

Compile either a PrototypeAST or a FunctionAST into the LLVM module.

+

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

+

Calls U::from(self).

That is, this conversion is whatever the implementation of -From<T> for U chooses to do.

-

The type returned in the event of a conversion error.

-

Performs the conversion.

-

The type returned in the event of a conversion error.

-

Performs the conversion.

-
- \ No newline at end of file +From<T> for U chooses to do.

+
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
\ No newline at end of file diff --git a/llvm_kaleidoscope_rs/constant.SMALL_STR_SIZE.html b/llvm_kaleidoscope_rs/constant.SMALL_STR_SIZE.html index e13f893..d96e14c 100644 --- a/llvm_kaleidoscope_rs/constant.SMALL_STR_SIZE.html +++ b/llvm_kaleidoscope_rs/constant.SMALL_STR_SIZE.html @@ -1,10 +1,2 @@ -SMALL_STR_SIZE in llvm_kaleidoscope_rs - Rust -
pub const SMALL_STR_SIZE: usize = 16;
Expand description

Fixed size of SmallCStr including the trailing \0 byte.

-
- \ No newline at end of file +SMALL_STR_SIZE in llvm_kaleidoscope_rs - Rust
pub const SMALL_STR_SIZE: usize = 16;
Expand description

Fixed size of SmallCStr including the trailing \0 byte.

+
\ No newline at end of file diff --git a/llvm_kaleidoscope_rs/enum.Either.html b/llvm_kaleidoscope_rs/enum.Either.html index 8cf9394..825138f 100644 --- a/llvm_kaleidoscope_rs/enum.Either.html +++ b/llvm_kaleidoscope_rs/enum.Either.html @@ -1,24 +1,9 @@ -Either in llvm_kaleidoscope_rs - Rust -
pub enum Either<A, B> {
+Either in llvm_kaleidoscope_rs - Rust
pub enum Either<A, B> {
     A(A),
     B(B),
 }
Expand description

Either type, for APIs accepting two types.

-

Variants

A(A)

B(B)

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

-

Immutably borrows from an owned value. Read more

-

Mutably borrows from an owned value. Read more

-

Returns the argument unchanged.

-

Calls U::from(self).

+

Variants

A(A)

B(B)

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

+

Calls U::from(self).

That is, this conversion is whatever the implementation of -From<T> for U chooses to do.

-

The type returned in the event of a conversion error.

-

Performs the conversion.

-

The type returned in the event of a conversion error.

-

Performs the conversion.

-
- \ No newline at end of file +From<T> for U chooses to do.

+
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
\ No newline at end of file diff --git a/llvm_kaleidoscope_rs/index.html b/llvm_kaleidoscope_rs/index.html index eaab6fb..239da84 100644 --- a/llvm_kaleidoscope_rs/index.html +++ b/llvm_kaleidoscope_rs/index.html @@ -1,17 +1 @@ -llvm_kaleidoscope_rs - Rust -

Modules

-

Safe wrapper around the LLVM C API.

-

Structs

-

Small C string on the stack with fixed size SMALL_STR_SIZE.

-

Enums

-

Either type, for APIs accepting two types.

-

Constants

-

Fixed size of SmallCStr including the trailing \0 byte.

-
- \ No newline at end of file +llvm_kaleidoscope_rs - Rust

Modules

Safe wrapper around the LLVM C API.

Structs

Small C string on the stack with fixed size SMALL_STR_SIZE.

Enums

Either type, for APIs accepting two types.

Constants

Fixed size of SmallCStr including the trailing \0 byte.
\ No newline at end of file diff --git a/llvm_kaleidoscope_rs/lexer/enum.Token.html b/llvm_kaleidoscope_rs/lexer/enum.Token.html index 4d4b4d1..3d8ea38 100644 --- a/llvm_kaleidoscope_rs/lexer/enum.Token.html +++ b/llvm_kaleidoscope_rs/lexer/enum.Token.html @@ -1,36 +1,19 @@ -Token in llvm_kaleidoscope_rs::lexer - Rust -
pub enum Token {
+Token in llvm_kaleidoscope_rs::lexer - Rust
pub enum Token {
     Eof,
     Def,
     Extern,
-    Identifier(String),
-    Number(f64),
-    Char(char),
+    Identifier(String),
+    Number(f64),
+    Char(char),
     If,
     Then,
     Else,
     For,
     In,
-}

Variants

Eof

Def

Extern

Identifier(String)

Number(f64)

Char(char)

If

Then

Else

For

In

Trait Implementations

Formats the value using the given formatter. Read more

-

This method tests for self and other values to be equal, and is used -by ==. Read more

-

This method tests for !=.

-

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

-

Immutably borrows from an owned value. Read more

-

Mutably borrows from an owned value. Read more

-

Returns the argument unchanged.

-

Calls U::from(self).

+}

Variants

Eof

Def

Extern

Identifier(String)

Number(f64)

Char(char)

If

Then

Else

For

In

Trait Implementations

Formats the value using the given formatter. Read more
This method tests for self and other values to be equal, and is used +by ==. Read more
This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

+

Calls U::from(self).

That is, this conversion is whatever the implementation of -From<T> for U chooses to do.

-

The type returned in the event of a conversion error.

-

Performs the conversion.

-

The type returned in the event of a conversion error.

-

Performs the conversion.

-
- \ No newline at end of file +From<T> for U chooses to do.

+
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
\ No newline at end of file diff --git a/llvm_kaleidoscope_rs/lexer/index.html b/llvm_kaleidoscope_rs/lexer/index.html index 6c5c8f9..2b2c334 100644 --- a/llvm_kaleidoscope_rs/lexer/index.html +++ b/llvm_kaleidoscope_rs/lexer/index.html @@ -1,11 +1 @@ -llvm_kaleidoscope_rs::lexer - Rust -
- \ No newline at end of file +llvm_kaleidoscope_rs::lexer - Rust
\ No newline at end of file diff --git a/llvm_kaleidoscope_rs/lexer/struct.Lexer.html b/llvm_kaleidoscope_rs/lexer/struct.Lexer.html index ab9a86b..6f08c48 100644 --- a/llvm_kaleidoscope_rs/lexer/struct.Lexer.html +++ b/llvm_kaleidoscope_rs/lexer/struct.Lexer.html @@ -1,22 +1,7 @@ -Lexer in llvm_kaleidoscope_rs::lexer - Rust -
pub struct Lexer<I> where
    I: Iterator<Item = char>, 
{ /* private fields */ }

Implementations

Lex and return the next token.

+Lexer in llvm_kaleidoscope_rs::lexer - Rust
pub struct Lexer<I>where
    I: Iterator<Item = char>,
{ /* private fields */ }

Implementations

Lex and return the next token.

Implement int gettok(); from the tutorial.

-

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

-

Immutably borrows from an owned value. Read more

-

Mutably borrows from an owned value. Read more

-

Returns the argument unchanged.

-

Calls U::from(self).

+

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

+

Calls U::from(self).

That is, this conversion is whatever the implementation of -From<T> for U chooses to do.

-

The type returned in the event of a conversion error.

-

Performs the conversion.

-

The type returned in the event of a conversion error.

-

Performs the conversion.

-
- \ No newline at end of file +From<T> for U chooses to do.

+
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
\ No newline at end of file diff --git a/llvm_kaleidoscope_rs/llvm/fn.initialize_native_taget.html b/llvm_kaleidoscope_rs/llvm/fn.initialize_native_taget.html index 8790cac..fb42a17 100644 --- a/llvm_kaleidoscope_rs/llvm/fn.initialize_native_taget.html +++ b/llvm_kaleidoscope_rs/llvm/fn.initialize_native_taget.html @@ -1,10 +1,2 @@ -initialize_native_taget in llvm_kaleidoscope_rs::llvm - Rust -
pub fn initialize_native_taget()
Expand description

Initialize native target for corresponding to host (useful for jitting).

-
- \ No newline at end of file +initialize_native_taget in llvm_kaleidoscope_rs::llvm - Rust
pub fn initialize_native_taget()
Expand description

Initialize native target for corresponding to host (useful for jitting).

+
\ No newline at end of file diff --git a/llvm_kaleidoscope_rs/llvm/fn.shutdown.html b/llvm_kaleidoscope_rs/llvm/fn.shutdown.html index b8fda63..d859aaa 100644 --- a/llvm_kaleidoscope_rs/llvm/fn.shutdown.html +++ b/llvm_kaleidoscope_rs/llvm/fn.shutdown.html @@ -1,10 +1,2 @@ -shutdown in llvm_kaleidoscope_rs::llvm - Rust -
pub fn shutdown()
Expand description

Deallocate and destroy all “ManagedStatic” variables.

-
- \ No newline at end of file +shutdown in llvm_kaleidoscope_rs::llvm - Rust
pub fn shutdown()
Expand description

Deallocate and destroy all “ManagedStatic” variables.

+
\ No newline at end of file diff --git a/llvm_kaleidoscope_rs/llvm/index.html b/llvm_kaleidoscope_rs/llvm/index.html index 9e00f32..716a7f9 100644 --- a/llvm_kaleidoscope_rs/llvm/index.html +++ b/llvm_kaleidoscope_rs/llvm/index.html @@ -1,30 +1,8 @@ -llvm_kaleidoscope_rs::llvm - Rust -
Expand description

Safe wrapper around the LLVM C API.

+llvm_kaleidoscope_rs::llvm - Rust
Expand description

Safe wrapper around the LLVM C API.

References returned from the LLVM API are tied to the 'llvm lifetime which is bound to the context where the objects are created in. We do not offer wrappers to remove or delete any objects in the context and therefore all the references will be valid for the liftime of the context.

For the scope of this tutorial we mainly use assertions to validate the results from the LLVM API calls.

-

Structs

-

Wrapper for a LLVM Basic Block.

-

Wrapper for a LLVM Value Reference specialized for contexts where function values are needed.

-

Wrapper for a LLVM Function PassManager (legacy).

-

Wrapper for a LLVM IR Builder.

-

Wrapper for a LLVM LLJIT.

-

Wrapper for a LLVM Module with its own LLVM Context.

-

Wrapper for a LLVM Value Reference specialized for contexts where phi values are needed.

-

A resource handle for code added to an LLJit instance.

-

Wrapper for a LLVM Type Reference.

-

Wrapper for a LLVM Value Reference.

-

Functions

-

Initialize native target for corresponding to host (useful for jitting).

-

Deallocate and destroy all “ManagedStatic” variables.

-
- \ No newline at end of file +

Structs

Wrapper for a LLVM Basic Block.
Wrapper for a LLVM Value Reference specialized for contexts where function values are needed.
Wrapper for a LLVM Function PassManager (legacy).
Wrapper for a LLVM IR Builder.
Wrapper for a LLVM LLJIT.
Wrapper for a LLVM Module with its own LLVM Context.
Wrapper for a LLVM Value Reference specialized for contexts where phi values are needed.
A resource handle for code added to an LLJit instance.
Wrapper for a LLVM Type Reference.
Wrapper for a LLVM Value Reference.

Functions

Initialize native target for corresponding to host (useful for jitting).
Deallocate and destroy all “ManagedStatic” variables.
\ No newline at end of file diff --git a/llvm_kaleidoscope_rs/llvm/struct.BasicBlock.html b/llvm_kaleidoscope_rs/llvm/struct.BasicBlock.html index 4d1a7ef..f338ec4 100644 --- a/llvm_kaleidoscope_rs/llvm/struct.BasicBlock.html +++ b/llvm_kaleidoscope_rs/llvm/struct.BasicBlock.html @@ -1,29 +1,9 @@ -BasicBlock in llvm_kaleidoscope_rs::llvm - Rust -
pub struct BasicBlock<'llvm>(_, _);
Expand description

Wrapper for a LLVM Basic Block.

-

Implementations

Get the function to which the basic block belongs.

+BasicBlock in llvm_kaleidoscope_rs::llvm - Rust
pub struct BasicBlock<'llvm>(_, _);
Expand description

Wrapper for a LLVM Basic Block.

+

Implementations

Get the function to which the basic block belongs.

Panics

Panics if LLVM API returns a null pointer.

-

Trait Implementations

Returns a copy of the value. Read more

-

Performs copy-assignment from source. Read more

-

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

-

Immutably borrows from an owned value. Read more

-

Mutably borrows from an owned value. Read more

-

Returns the argument unchanged.

-

Calls U::from(self).

+

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

+

Calls U::from(self).

That is, this conversion is whatever the implementation of -From<T> for U chooses to do.

-

The resulting type after obtaining ownership.

-

Creates owned data from borrowed data, usually by cloning. Read more

-

Uses borrowed data to replace owned data, usually by cloning. Read more

-

The type returned in the event of a conversion error.

-

Performs the conversion.

-

The type returned in the event of a conversion error.

-

Performs the conversion.

-
- \ No newline at end of file +From<T> for U chooses to do.

+
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
\ No newline at end of file diff --git a/llvm_kaleidoscope_rs/llvm/struct.FnValue.html b/llvm_kaleidoscope_rs/llvm/struct.FnValue.html index a93d306..7a63d42 100644 --- a/llvm_kaleidoscope_rs/llvm/struct.FnValue.html +++ b/llvm_kaleidoscope_rs/llvm/struct.FnValue.html @@ -1,50 +1,28 @@ -FnValue in llvm_kaleidoscope_rs::llvm - Rust -
#[repr(transparent)]
pub struct FnValue<'llvm>(_);
Expand description

Wrapper for a LLVM Value Reference specialized for contexts where function values are needed.

-

Implementations

Get a type reference representing the return value of the given function value.

+FnValue in llvm_kaleidoscope_rs::llvm - Rust
#[repr(transparent)]
pub struct FnValue<'llvm>(_);
Expand description

Wrapper for a LLVM Value Reference specialized for contexts where function values are needed.

+

Implementations

Get a type reference representing the return value of the given function value.

Panics

Panics if LLVM API returns a null pointer.

-

Get the number of function arguments for the given function value.

-

Get a value reference for the function argument at index idx.

+

Get the number of function arguments for the given function value.

+

Get a value reference for the function argument at index idx.

Panics

Panics if LLVM API returns a null pointer or indexed out of bounds.

-

Get the number of Basic Blocks for the given function value.

-

Append a Basic Block to the end of the function value.

-

Verify that the given function is valid.

-

Methods from Deref<Target = Value<'llvm>>

Dump the LLVM Value to stdout.

-

Get a type reference representing for the given value reference.

+

Get the number of Basic Blocks for the given function value.

+

Append a Basic Block to the end of the function value.

+

Verify that the given function is valid.

+

Methods from Deref<Target = Value<'llvm>>

Dump the LLVM Value to stdout.

+

Get a type reference representing for the given value reference.

Panics

Panics if LLVM API returns a null pointer.

-

Set the name for the given value reference.

+

Set the name for the given value reference.

Panics

Panics if LLVM API returns a null pointer.

-

Get the name for the given value reference.

+

Get the name for the given value reference.

Panics

Panics if LLVM API returns a null pointer.

-

Check if value is of f64 type.

-

Check if value is of integer type.

-

Trait Implementations

Returns a copy of the value. Read more

-

Performs copy-assignment from source. Read more

-

The resulting type after dereferencing.

-

Dereferences the value.

-

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

-

Immutably borrows from an owned value. Read more

-

Mutably borrows from an owned value. Read more

-

Returns the argument unchanged.

-

Calls U::from(self).

+

Check if value is of f64 type.

+

Check if value is of integer type.

+

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
The resulting type after dereferencing.
Dereferences the value.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

+

Calls U::from(self).

That is, this conversion is whatever the implementation of -From<T> for U chooses to do.

-

The resulting type after obtaining ownership.

-

Creates owned data from borrowed data, usually by cloning. Read more

-

Uses borrowed data to replace owned data, usually by cloning. Read more

-

The type returned in the event of a conversion error.

-

Performs the conversion.

-

The type returned in the event of a conversion error.

-

Performs the conversion.

-
- \ No newline at end of file +From<T> for U chooses to do.

+
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
\ No newline at end of file diff --git a/llvm_kaleidoscope_rs/llvm/struct.FunctionPassManager.html b/llvm_kaleidoscope_rs/llvm/struct.FunctionPassManager.html index 5f32199..5800a38 100644 --- a/llvm_kaleidoscope_rs/llvm/struct.FunctionPassManager.html +++ b/llvm_kaleidoscope_rs/llvm/struct.FunctionPassManager.html @@ -1,12 +1,5 @@ -FunctionPassManager in llvm_kaleidoscope_rs::llvm - Rust -
pub struct FunctionPassManager<'llvm> { /* private fields */ }
Expand description

Wrapper for a LLVM Function PassManager (legacy).

-

Implementations

Create a new Function PassManager with the following optimization passes

+FunctionPassManager in llvm_kaleidoscope_rs::llvm - Rust
pub struct FunctionPassManager<'llvm> { /* private fields */ }
Expand description

Wrapper for a LLVM Function PassManager (legacy).

+

Implementations

Create a new Function PassManager with the following optimization passes

  • InstructionCombiningPass
  • ReassociatePass
  • @@ -15,19 +8,10 @@

The list of selected optimization passes is taken from the tutorial chapter LLVM Optimization Passes.

-

Run the optimization passes registered with the Function PassManager on the function +

Run the optimization passes registered with the Function PassManager on the function referenced by fn_value.

-

Trait Implementations

Executes the destructor for this type. Read more

-

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

-

Immutably borrows from an owned value. Read more

-

Mutably borrows from an owned value. Read more

-

Returns the argument unchanged.

-

Calls U::from(self).

+

Trait Implementations

Executes the destructor for this type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

+

Calls U::from(self).

That is, this conversion is whatever the implementation of -From<T> for U chooses to do.

-

The type returned in the event of a conversion error.

-

Performs the conversion.

-

The type returned in the event of a conversion error.

-

Performs the conversion.

-
- \ No newline at end of file +From<T> for U chooses to do.

+
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
\ No newline at end of file diff --git a/llvm_kaleidoscope_rs/llvm/struct.IRBuilder.html b/llvm_kaleidoscope_rs/llvm/struct.IRBuilder.html index 7f77a2c..b98503a 100644 --- a/llvm_kaleidoscope_rs/llvm/struct.IRBuilder.html +++ b/llvm_kaleidoscope_rs/llvm/struct.IRBuilder.html @@ -1,62 +1,46 @@ -IRBuilder in llvm_kaleidoscope_rs::llvm - Rust -
pub struct IRBuilder<'llvm> { /* private fields */ }
Expand description

Wrapper for a LLVM IR Builder.

-

Implementations

Create a new LLVM IR Builder with the modules context.

+IRBuilder in llvm_kaleidoscope_rs::llvm - Rust
pub struct IRBuilder<'llvm> { /* private fields */ }
Expand description

Wrapper for a LLVM IR Builder.

+

Implementations

Create a new LLVM IR Builder with the modules context.

Panics

Panics if creating the IR Builder fails.

-

Position the IR Builder at the end of the given Basic Block.

-

Get the BasicBlock the IRBuilder currently inputs into.

+

Position the IR Builder at the end of the given Basic Block.

+

Get the BasicBlock the IRBuilder currently inputs into.

Panics

Panics if LLVM API returns a null pointer.

-

Emit a fadd instruction.

+

Emit a fadd instruction.

Panics

Panics if LLVM API returns a null pointer.

-

Emit a fsub instruction.

+

Emit a fsub instruction.

Panics

Panics if LLVM API returns a null pointer.

-

Emit a fmul instruction.

+

Emit a fmul instruction.

Panics

Panics if LLVM API returns a null pointer.

-

Emit a fcmpult instruction.

+

Emit a fcmpult instruction.

Panics

Panics if LLVM API returns a null pointer.

-

Emit a fcmpone instruction.

+

Emit a fcmpone instruction.

Panics

Panics if LLVM API returns a null pointer.

-

Emit a uitofp instruction.

+

Emit a uitofp instruction.

Panics

Panics if LLVM API returns a null pointer.

-

Emit a call instruction.

+

Emit a call instruction.

Panics

Panics if LLVM API returns a null pointer.

-

Emit a ret instruction.

+

Emit a ret instruction.

Panics

Panics if LLVM API returns a null pointer.

-

Emit an unconditional br instruction.

+

Emit an unconditional br instruction.

Panics

Panics if LLVM API returns a null pointer.

-

Emit a conditional br instruction.

+

Emit a conditional br instruction.

Panics

Panics if LLVM API returns a null pointer.

-

Emit a phi instruction.

+

Emit a phi instruction.

Panics

Panics if LLVM API returns a null pointer.

-

Trait Implementations

Executes the destructor for this type. Read more

-

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

-

Immutably borrows from an owned value. Read more

-

Mutably borrows from an owned value. Read more

-

Returns the argument unchanged.

-

Calls U::from(self).

+

Trait Implementations

Executes the destructor for this type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

+

Calls U::from(self).

That is, this conversion is whatever the implementation of -From<T> for U chooses to do.

-

The type returned in the event of a conversion error.

-

Performs the conversion.

-

The type returned in the event of a conversion error.

-

Performs the conversion.

-
- \ No newline at end of file +From<T> for U chooses to do.

+
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
\ No newline at end of file diff --git a/llvm_kaleidoscope_rs/llvm/struct.LLJit.html b/llvm_kaleidoscope_rs/llvm/struct.LLJit.html index a68558b..35fced9 100644 --- a/llvm_kaleidoscope_rs/llvm/struct.LLJit.html +++ b/llvm_kaleidoscope_rs/llvm/struct.LLJit.html @@ -1,34 +1,19 @@ -LLJit in llvm_kaleidoscope_rs::llvm - Rust -
pub struct LLJit { /* private fields */ }
Expand description

Wrapper for a LLVM LLJIT.

-

Implementations

Create a new LLJit instance.

+LLJit in llvm_kaleidoscope_rs::llvm - Rust
pub struct LLJit { /* private fields */ }
Expand description

Wrapper for a LLVM LLJIT.

+

Implementations

Create a new LLJit instance.

Panics

Panics if LLVM API returns a null pointer or an error.

-

Add an LLVM IR module to the JIT. Return a ResourceTracker, which when dropped, will +

Add an LLVM IR module to the JIT. Return a ResourceTracker, which when dropped, will remove the code of the LLVM IR module from the JIT.

Panics

Panics if LLVM API returns a null pointer or an error.

-

Find the symbol with the name sym in the JIT.

+

Find the symbol with the name sym in the JIT.

Panics

Panics if the symbol is not found in the JIT.

-

Enable lookup of dynamic symbols available in the current process from the JIT.

+

Enable lookup of dynamic symbols available in the current process from the JIT.

Panics

Panics if LLVM API returns an error.

-

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

-

Immutably borrows from an owned value. Read more

-

Mutably borrows from an owned value. Read more

-

Returns the argument unchanged.

-

Calls U::from(self).

+

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

+

Calls U::from(self).

That is, this conversion is whatever the implementation of -From<T> for U chooses to do.

-

The type returned in the event of a conversion error.

-

Performs the conversion.

-

The type returned in the event of a conversion error.

-

Performs the conversion.

-
- \ No newline at end of file +From<T> for U chooses to do.

+
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
\ No newline at end of file diff --git a/llvm_kaleidoscope_rs/llvm/struct.Module.html b/llvm_kaleidoscope_rs/llvm/struct.Module.html index a402750..5a3d463 100644 --- a/llvm_kaleidoscope_rs/llvm/struct.Module.html +++ b/llvm_kaleidoscope_rs/llvm/struct.Module.html @@ -1,50 +1,34 @@ -Module in llvm_kaleidoscope_rs::llvm - Rust -
pub struct Module { /* private fields */ }
Expand description

Wrapper for a LLVM Module with its own LLVM Context.

-

Implementations

Create a new Module instance.

+Module in llvm_kaleidoscope_rs::llvm - Rust
pub struct Module { /* private fields */ }
Expand description

Wrapper for a LLVM Module with its own LLVM Context.

+

Implementations

Create a new Module instance.

Panics

Panics if creating the context or the module fails.

-

Dump LLVM IR emitted into the Module to stdout.

-

Get a type reference representing a f64 float.

+

Dump LLVM IR emitted into the Module to stdout.

+

Get a type reference representing a f64 float.

Panics

Panics if LLVM API returns a null pointer.

-

Get a type reference representing a fn(args) -> ret function.

+

Get a type reference representing a fn(args) -> ret function.

Panics

Panics if LLVM API returns a null pointer.

-

Add a function with the given name and fn_type to the module and return a value +

Add a function with the given name and fn_type to the module and return a value reference representing the function.

Panics

Panics if LLVM API returns a null pointer or name could not be converted to a SmallCStr.

-

Get a function value reference to the function with the given name if it was previously +

Get a function value reference to the function with the given name if it was previously added to the module with add_fn.

Panics

Panics if name could not be converted to a SmallCStr.

-

Append a Basic Block to the end of the function referenced by the value reference +

Append a Basic Block to the end of the function referenced by the value reference fn_value.

Panics

Panics if LLVM API returns a null pointer.

-

Create a free-standing Basic Block without adding it to a function. +

Create a free-standing Basic Block without adding it to a function. This can be added to a function at a later point in time with FnValue::append_basic_block.

Panics

Panics if LLVM API returns a null pointer.

-

Trait Implementations

Executes the destructor for this type. Read more

-

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

-

Immutably borrows from an owned value. Read more

-

Mutably borrows from an owned value. Read more

-

Returns the argument unchanged.

-

Calls U::from(self).

+

Trait Implementations

Executes the destructor for this type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

+

Calls U::from(self).

That is, this conversion is whatever the implementation of -From<T> for U chooses to do.

-

The type returned in the event of a conversion error.

-

Performs the conversion.

-

The type returned in the event of a conversion error.

-

Performs the conversion.

-
- \ No newline at end of file +From<T> for U chooses to do.

+
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
\ No newline at end of file diff --git a/llvm_kaleidoscope_rs/llvm/struct.PhiValue.html b/llvm_kaleidoscope_rs/llvm/struct.PhiValue.html index d7f53b0..bfbd3f0 100644 --- a/llvm_kaleidoscope_rs/llvm/struct.PhiValue.html +++ b/llvm_kaleidoscope_rs/llvm/struct.PhiValue.html @@ -1,41 +1,19 @@ -PhiValue in llvm_kaleidoscope_rs::llvm - Rust -
#[repr(transparent)]
pub struct PhiValue<'llvm>(_);
Expand description

Wrapper for a LLVM Value Reference specialized for contexts where phi values are needed.

-

Implementations

Add an incoming value to the end of a PHI list.

-

Methods from Deref<Target = Value<'llvm>>

Dump the LLVM Value to stdout.

-

Get a type reference representing for the given value reference.

+PhiValue in llvm_kaleidoscope_rs::llvm - Rust
#[repr(transparent)]
pub struct PhiValue<'llvm>(_);
Expand description

Wrapper for a LLVM Value Reference specialized for contexts where phi values are needed.

+

Implementations

Add an incoming value to the end of a PHI list.

+

Methods from Deref<Target = Value<'llvm>>

Dump the LLVM Value to stdout.

+

Get a type reference representing for the given value reference.

Panics

Panics if LLVM API returns a null pointer.

-

Set the name for the given value reference.

+

Set the name for the given value reference.

Panics

Panics if LLVM API returns a null pointer.

-

Get the name for the given value reference.

+

Get the name for the given value reference.

Panics

Panics if LLVM API returns a null pointer.

-

Check if value is of f64 type.

-

Check if value is of integer type.

-

Trait Implementations

Returns a copy of the value. Read more

-

Performs copy-assignment from source. Read more

-

The resulting type after dereferencing.

-

Dereferences the value.

-

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

-

Immutably borrows from an owned value. Read more

-

Mutably borrows from an owned value. Read more

-

Returns the argument unchanged.

-

Calls U::from(self).

+

Check if value is of f64 type.

+

Check if value is of integer type.

+

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
The resulting type after dereferencing.
Dereferences the value.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

+

Calls U::from(self).

That is, this conversion is whatever the implementation of -From<T> for U chooses to do.

-

The resulting type after obtaining ownership.

-

Creates owned data from borrowed data, usually by cloning. Read more

-

Uses borrowed data to replace owned data, usually by cloning. Read more

-

The type returned in the event of a conversion error.

-

Performs the conversion.

-

The type returned in the event of a conversion error.

-

Performs the conversion.

-
- \ No newline at end of file +From<T> for U chooses to do.

+
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
\ No newline at end of file diff --git a/llvm_kaleidoscope_rs/llvm/struct.ResourceTracker.html b/llvm_kaleidoscope_rs/llvm/struct.ResourceTracker.html index 7a8118d..2c4e72f 100644 --- a/llvm_kaleidoscope_rs/llvm/struct.ResourceTracker.html +++ b/llvm_kaleidoscope_rs/llvm/struct.ResourceTracker.html @@ -1,24 +1,8 @@ -ResourceTracker in llvm_kaleidoscope_rs::llvm - Rust -
pub struct ResourceTracker<'jit>(_, _);
Expand description

A resource handle for code added to an LLJit instance.

+ResourceTracker in llvm_kaleidoscope_rs::llvm - Rust
pub struct ResourceTracker<'jit>(_, _);
Expand description

A resource handle for code added to an LLJit instance.

When a ResourceTracker handle is dropped, the code corresponding to the handle will be removed from the JIT.

-

Trait Implementations

Executes the destructor for this type. Read more

-

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

-

Immutably borrows from an owned value. Read more

-

Mutably borrows from an owned value. Read more

-

Returns the argument unchanged.

-

Calls U::from(self).

+

Trait Implementations

Executes the destructor for this type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

+

Calls U::from(self).

That is, this conversion is whatever the implementation of -From<T> for U chooses to do.

-

The type returned in the event of a conversion error.

-

Performs the conversion.

-

The type returned in the event of a conversion error.

-

Performs the conversion.

-
- \ No newline at end of file +From<T> for U chooses to do.

+
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
\ No newline at end of file diff --git a/llvm_kaleidoscope_rs/llvm/struct.Type.html b/llvm_kaleidoscope_rs/llvm/struct.Type.html index 83c5c44..678e905 100644 --- a/llvm_kaleidoscope_rs/llvm/struct.Type.html +++ b/llvm_kaleidoscope_rs/llvm/struct.Type.html @@ -1,30 +1,10 @@ -Type in llvm_kaleidoscope_rs::llvm - Rust -
#[repr(transparent)]
pub struct Type<'llvm>(_, _);
Expand description

Wrapper for a LLVM Type Reference.

-

Implementations

Dump the LLVM Type to stdout.

-

Get a value reference representing the const f64 value.

+Type in llvm_kaleidoscope_rs::llvm - Rust
#[repr(transparent)]
pub struct Type<'llvm>(_, _);
Expand description

Wrapper for a LLVM Type Reference.

+

Implementations

Dump the LLVM Type to stdout.

+

Get a value reference representing the const f64 value.

Panics

Panics if LLVM API returns a null pointer.

-

Trait Implementations

Returns a copy of the value. Read more

-

Performs copy-assignment from source. Read more

-

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

-

Immutably borrows from an owned value. Read more

-

Mutably borrows from an owned value. Read more

-

Returns the argument unchanged.

-

Calls U::from(self).

+

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

+

Calls U::from(self).

That is, this conversion is whatever the implementation of -From<T> for U chooses to do.

-

The resulting type after obtaining ownership.

-

Creates owned data from borrowed data, usually by cloning. Read more

-

Uses borrowed data to replace owned data, usually by cloning. Read more

-

The type returned in the event of a conversion error.

-

Performs the conversion.

-

The type returned in the event of a conversion error.

-

Performs the conversion.

-
- \ No newline at end of file +From<T> for U chooses to do.

+
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
\ No newline at end of file diff --git a/llvm_kaleidoscope_rs/llvm/struct.Value.html b/llvm_kaleidoscope_rs/llvm/struct.Value.html index 0079678..cb3ab2a 100644 --- a/llvm_kaleidoscope_rs/llvm/struct.Value.html +++ b/llvm_kaleidoscope_rs/llvm/struct.Value.html @@ -1,38 +1,18 @@ -Value in llvm_kaleidoscope_rs::llvm - Rust -
#[repr(transparent)]
pub struct Value<'llvm>(_, _);
Expand description

Wrapper for a LLVM Value Reference.

-

Implementations

Dump the LLVM Value to stdout.

-

Get a type reference representing for the given value reference.

+Value in llvm_kaleidoscope_rs::llvm - Rust
#[repr(transparent)]
pub struct Value<'llvm>(_, _);
Expand description

Wrapper for a LLVM Value Reference.

+

Implementations

Dump the LLVM Value to stdout.

+

Get a type reference representing for the given value reference.

Panics

Panics if LLVM API returns a null pointer.

-

Set the name for the given value reference.

+

Set the name for the given value reference.

Panics

Panics if LLVM API returns a null pointer.

-

Get the name for the given value reference.

+

Get the name for the given value reference.

Panics

Panics if LLVM API returns a null pointer.

-

Check if value is of f64 type.

-

Check if value is of integer type.

-

Trait Implementations

Returns a copy of the value. Read more

-

Performs copy-assignment from source. Read more

-

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

-

Immutably borrows from an owned value. Read more

-

Mutably borrows from an owned value. Read more

-

Returns the argument unchanged.

-

Calls U::from(self).

+

Check if value is of f64 type.

+

Check if value is of integer type.

+

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

+

Calls U::from(self).

That is, this conversion is whatever the implementation of -From<T> for U chooses to do.

-

The resulting type after obtaining ownership.

-

Creates owned data from borrowed data, usually by cloning. Read more

-

Uses borrowed data to replace owned data, usually by cloning. Read more

-

The type returned in the event of a conversion error.

-

Performs the conversion.

-

The type returned in the event of a conversion error.

-

Performs the conversion.

-
- \ No newline at end of file +From<T> for U chooses to do.

+
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
\ No newline at end of file diff --git a/llvm_kaleidoscope_rs/parser/enum.ExprAST.html b/llvm_kaleidoscope_rs/parser/enum.ExprAST.html index b4c86fb..b716736 100644 --- a/llvm_kaleidoscope_rs/parser/enum.ExprAST.html +++ b/llvm_kaleidoscope_rs/parser/enum.ExprAST.html @@ -1,47 +1,30 @@ -ExprAST in llvm_kaleidoscope_rs::parser - Rust -
pub enum ExprAST {
-    Number(f64),
-    Variable(String),
-    Binary(charBox<ExprAST>, Box<ExprAST>),
-    Call(StringVec<ExprAST>),
+ExprAST in llvm_kaleidoscope_rs::parser - Rust
pub enum ExprAST {
+    Number(f64),
+    Variable(String),
+    Binary(charBox<ExprAST>, Box<ExprAST>),
+    Call(StringVec<ExprAST>),
     If {
-        cond: Box<ExprAST>,
-        then: Box<ExprAST>,
-        else_: Box<ExprAST>,
+        cond: Box<ExprAST>,
+        then: Box<ExprAST>,
+        else_: Box<ExprAST>,
     },
     For {
-        var: String,
-        start: Box<ExprAST>,
-        end: Box<ExprAST>,
-        step: Option<Box<ExprAST>>,
-        body: Box<ExprAST>,
+        var: String,
+        start: Box<ExprAST>,
+        end: Box<ExprAST>,
+        step: Option<Box<ExprAST>>,
+        body: Box<ExprAST>,
     },
-}

Variants

Number(f64)

Number - Expression class for numeric literals like “1.0”.

-

Variable(String)

Variable - Expression class for referencing a variable, like “a”.

-

Binary(charBox<ExprAST>, Box<ExprAST>)

Binary - Expression class for a binary operator.

-

Call(StringVec<ExprAST>)

Call - Expression class for function calls.

-

If

Fields

cond: Box<ExprAST>
then: Box<ExprAST>
else_: Box<ExprAST>

If - Expression class for if/then/else.

-

For

Fields

var: String
start: Box<ExprAST>
end: Box<ExprAST>
step: Option<Box<ExprAST>>
body: Box<ExprAST>

ForExprAST - Expression class for for/in.

-

Trait Implementations

Formats the value using the given formatter. Read more

-

This method tests for self and other values to be equal, and is used -by ==. Read more

-

This method tests for !=.

-

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

-

Immutably borrows from an owned value. Read more

-

Mutably borrows from an owned value. Read more

-

Returns the argument unchanged.

-

Calls U::from(self).

+}

Variants

Number(f64)

Number - Expression class for numeric literals like “1.0”.

+

Variable(String)

Variable - Expression class for referencing a variable, like “a”.

+

Binary(charBox<ExprAST>, Box<ExprAST>)

Binary - Expression class for a binary operator.

+

Call(StringVec<ExprAST>)

Call - Expression class for function calls.

+

If

Fields

cond: Box<ExprAST>
then: Box<ExprAST>
else_: Box<ExprAST>

If - Expression class for if/then/else.

+

For

Fields

var: String
start: Box<ExprAST>
end: Box<ExprAST>
step: Option<Box<ExprAST>>
body: Box<ExprAST>

ForExprAST - Expression class for for/in.

+

Trait Implementations

Formats the value using the given formatter. Read more
This method tests for self and other values to be equal, and is used +by ==. Read more
This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

+

Calls U::from(self).

That is, this conversion is whatever the implementation of -From<T> for U chooses to do.

-

The type returned in the event of a conversion error.

-

Performs the conversion.

-

The type returned in the event of a conversion error.

-

Performs the conversion.

-
- \ No newline at end of file +From<T> for U chooses to do.

+
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
\ No newline at end of file diff --git a/llvm_kaleidoscope_rs/parser/index.html b/llvm_kaleidoscope_rs/parser/index.html index 98e8b0a..c30a5ab 100644 --- a/llvm_kaleidoscope_rs/parser/index.html +++ b/llvm_kaleidoscope_rs/parser/index.html @@ -1,16 +1,3 @@ -llvm_kaleidoscope_rs::parser - Rust -

Structs

-

FunctionAST - This class represents a function definition itself.

-

Parser for the kaleidoscope language.

-

PrototypeAST - This class represents the “prototype” for a function, +llvm_kaleidoscope_rs::parser - Rust

Structs

FunctionAST - This class represents a function definition itself.
Parser for the kaleidoscope language.
PrototypeAST - This class represents the “prototype” for a function, which captures its name, and its argument names (thus implicitly the number -of arguments the function takes).

-

Enums

-
- \ No newline at end of file +of arguments the function takes).

Enums

\ No newline at end of file diff --git a/llvm_kaleidoscope_rs/parser/struct.FunctionAST.html b/llvm_kaleidoscope_rs/parser/struct.FunctionAST.html index 6c396d4..b0fd251 100644 --- a/llvm_kaleidoscope_rs/parser/struct.FunctionAST.html +++ b/llvm_kaleidoscope_rs/parser/struct.FunctionAST.html @@ -1,25 +1,8 @@ -FunctionAST in llvm_kaleidoscope_rs::parser - Rust -
pub struct FunctionAST(pub PrototypeAST, pub ExprAST);
Expand description

FunctionAST - This class represents a function definition itself.

-

Tuple Fields

0: PrototypeAST1: ExprAST

Trait Implementations

Formats the value using the given formatter. Read more

-

This method tests for self and other values to be equal, and is used -by ==. Read more

-

This method tests for !=.

-

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

-

Immutably borrows from an owned value. Read more

-

Mutably borrows from an owned value. Read more

-

Returns the argument unchanged.

-

Calls U::from(self).

+FunctionAST in llvm_kaleidoscope_rs::parser - Rust
pub struct FunctionAST(pub PrototypeAST, pub ExprAST);
Expand description

FunctionAST - This class represents a function definition itself.

+

Tuple Fields

0: PrototypeAST1: ExprAST

Trait Implementations

Formats the value using the given formatter. Read more
This method tests for self and other values to be equal, and is used +by ==. Read more
This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

+

Calls U::from(self).

That is, this conversion is whatever the implementation of -From<T> for U chooses to do.

-

The type returned in the event of a conversion error.

-

Performs the conversion.

-

The type returned in the event of a conversion error.

-

Performs the conversion.

-
- \ No newline at end of file +From<T> for U chooses to do.

+
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
\ No newline at end of file diff --git a/llvm_kaleidoscope_rs/parser/struct.Parser.html b/llvm_kaleidoscope_rs/parser/struct.Parser.html index cb9e4b9..0014f06 100644 --- a/llvm_kaleidoscope_rs/parser/struct.Parser.html +++ b/llvm_kaleidoscope_rs/parser/struct.Parser.html @@ -1,32 +1,17 @@ -Parser in llvm_kaleidoscope_rs::parser - Rust -
pub struct Parser<I> where
    I: Iterator<Item = char>, 
{ /* private fields */ }
Expand description

Parser for the kaleidoscope language.

-

Implementations

Implement the global variable int CurTok; from the tutorial.

+Parser in llvm_kaleidoscope_rs::parser - Rust
pub struct Parser<I>where
    I: Iterator<Item = char>,
{ /* private fields */ }
Expand description

Parser for the kaleidoscope language.

+

Implementations

Implement the global variable int CurTok; from the tutorial.

Panics

Panics if the parser doesn’t have a current token.

-

Advance the cur_tok by getting the next token from the lexer.

+

Advance the cur_tok by getting the next token from the lexer.

Implement the fucntion int getNextToken(); from the tutorial.

-

definition ::= ‘def’ prototype expression

+

definition ::= ‘def’ prototype expression

Implement std::unique_ptr<FunctionAST> ParseDefinition(); from the tutorial.

-

external ::= ‘extern’ prototype

+

external ::= ‘extern’ prototype

Implement std::unique_ptr<PrototypeAST> ParseExtern(); from the tutorial.

-

toplevelexpr ::= expression

+

toplevelexpr ::= expression

Implement std::unique_ptr<FunctionAST> ParseTopLevelExpr(); from the tutorial.

-

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

-

Immutably borrows from an owned value. Read more

-

Mutably borrows from an owned value. Read more

-

Returns the argument unchanged.

-

Calls U::from(self).

+

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

+

Calls U::from(self).

That is, this conversion is whatever the implementation of -From<T> for U chooses to do.

-

The type returned in the event of a conversion error.

-

Performs the conversion.

-

The type returned in the event of a conversion error.

-

Performs the conversion.

-
- \ No newline at end of file +From<T> for U chooses to do.

+
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
\ No newline at end of file diff --git a/llvm_kaleidoscope_rs/parser/struct.PrototypeAST.html b/llvm_kaleidoscope_rs/parser/struct.PrototypeAST.html index f34140c..875bd3e 100644 --- a/llvm_kaleidoscope_rs/parser/struct.PrototypeAST.html +++ b/llvm_kaleidoscope_rs/parser/struct.PrototypeAST.html @@ -1,32 +1,10 @@ -PrototypeAST in llvm_kaleidoscope_rs::parser - Rust -
pub struct PrototypeAST(pub String, pub Vec<String>);
Expand description

PrototypeAST - This class represents the “prototype” for a function, +PrototypeAST in llvm_kaleidoscope_rs::parser - Rust

pub struct PrototypeAST(pub String, pub Vec<String>);
Expand description

PrototypeAST - This class represents the “prototype” for a function, which captures its name, and its argument names (thus implicitly the number of arguments the function takes).

-

Tuple Fields

0: String1: Vec<String>

Trait Implementations

Returns a copy of the value. Read more

-

Performs copy-assignment from source. Read more

-

Formats the value using the given formatter. Read more

-

This method tests for self and other values to be equal, and is used -by ==. Read more

-

This method tests for !=.

-

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

-

Immutably borrows from an owned value. Read more

-

Mutably borrows from an owned value. Read more

-

Returns the argument unchanged.

-

Calls U::from(self).

+

Tuple Fields

0: String1: Vec<String>

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
This method tests for self and other values to be equal, and is used +by ==. Read more
This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

+

Calls U::from(self).

That is, this conversion is whatever the implementation of -From<T> for U chooses to do.

-

The resulting type after obtaining ownership.

-

Creates owned data from borrowed data, usually by cloning. Read more

-

Uses borrowed data to replace owned data, usually by cloning. Read more

-

The type returned in the event of a conversion error.

-

Performs the conversion.

-

The type returned in the event of a conversion error.

-

Performs the conversion.

-
- \ No newline at end of file +From<T> for U chooses to do.

+
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
\ No newline at end of file diff --git a/llvm_kaleidoscope_rs/struct.SmallCStr.html b/llvm_kaleidoscope_rs/struct.SmallCStr.html index 034ffe7..f5ea2d8 100644 --- a/llvm_kaleidoscope_rs/struct.SmallCStr.html +++ b/llvm_kaleidoscope_rs/struct.SmallCStr.html @@ -1,31 +1,12 @@ -SmallCStr in llvm_kaleidoscope_rs - Rust -
pub struct SmallCStr(_);
Expand description

Small C string on the stack with fixed size SMALL_STR_SIZE.

+SmallCStr in llvm_kaleidoscope_rs - Rust
pub struct SmallCStr(_);
Expand description

Small C string on the stack with fixed size SMALL_STR_SIZE.

This is specially crafted to interact with the LLVM C API and get rid of some heap allocations.

-

Implementations

Create a new C string from src. -Returns None if src exceeds the fixed size or contains any \0 bytes.

-

Return pointer to C string.

-

Trait Implementations

Formats the value using the given formatter. Read more

-

This method tests for self and other values to be equal, and is used -by ==. Read more

-

This method tests for !=.

-

The type returned in the event of a conversion error.

-

Performs the conversion.

-

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

-

Immutably borrows from an owned value. Read more

-

Mutably borrows from an owned value. Read more

-

Returns the argument unchanged.

-

Calls U::from(self).

+

Implementations

Create a new C string from src. +Returns None if src exceeds the fixed size or contains any \0 bytes.

+

Return pointer to C string.

+

Trait Implementations

Formats the value using the given formatter. Read more
This method tests for self and other values to be equal, and is used +by ==. Read more
This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason. Read more
The type returned in the event of a conversion error.
Performs the conversion.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

+

Calls U::from(self).

That is, this conversion is whatever the implementation of -From<T> for U chooses to do.

-

The type returned in the event of a conversion error.

-

Performs the conversion.

-

The type returned in the event of a conversion error.

-

Performs the conversion.

-
- \ No newline at end of file +From<T> for U chooses to do.

+
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
\ No newline at end of file diff --git a/main.js b/main.js index a756f49..2981663 100644 --- a/main.js +++ b/main.js @@ -1,8 +1,8 @@ -"use strict";if(!String.prototype.startsWith){String.prototype.startsWith=function(searchString,position){position=position||0;return this.indexOf(searchString,position)===position}}if(!String.prototype.endsWith){String.prototype.endsWith=function(suffix,length){const l=length||this.length;return this.indexOf(suffix,l-suffix.length)!==-1}}if(!DOMTokenList.prototype.add){DOMTokenList.prototype.add=function(className){if(className&&!hasClass(this,className)){if(this.className&&this.className.length>0){this.className+=" "+className}else{this.className=className}}}}if(!DOMTokenList.prototype.remove){DOMTokenList.prototype.remove=function(className){if(className&&this.className){this.className=(" "+this.className+" ").replace(" "+className+" "," ").trim()}}}function getVar(name){const el=document.getElementById("rustdoc-vars");if(el){return el.attributes["data-"+name].value}else{return null}}function resourcePath(basename,extension){return getVar("root-path")+basename+getVar("resource-suffix")+extension}function hideMain(){addClass(document.getElementById(MAIN_ID),"hidden")}function showMain(){removeClass(document.getElementById(MAIN_ID),"hidden")}(function(){window.rootPath=getVar("root-path");window.currentCrate=getVar("current-crate")}());function setMobileTopbar(){const mobileLocationTitle=document.querySelector(".mobile-topbar h2.location");const locationTitle=document.querySelector(".sidebar h2.location");if(mobileLocationTitle&&locationTitle){mobileLocationTitle.innerHTML=locationTitle.innerHTML}}function getVirtualKey(ev){if("key"in ev&&typeof ev.key!=="undefined"){return ev.key}const c=ev.charCode||ev.keyCode;if(c===27){return"Escape"}return String.fromCharCode(c)}const MAIN_ID="main-content";const SETTINGS_BUTTON_ID="settings-menu";const ALTERNATIVE_DISPLAY_ID="alternative-display";const NOT_DISPLAYED_ID="not-displayed";function getSettingsButton(){return document.getElementById(SETTINGS_BUTTON_ID)}function getNakedUrl(){return window.location.href.split("?")[0].split("#")[0]}window.hideSettings=()=>{};function insertAfter(newNode,referenceNode){referenceNode.parentNode.insertBefore(newNode,referenceNode.nextSibling)}function getOrCreateSection(id,classes){let el=document.getElementById(id);if(!el){el=document.createElement("section");el.id=id;el.className=classes;insertAfter(el,document.getElementById(MAIN_ID))}return el}function getAlternativeDisplayElem(){return getOrCreateSection(ALTERNATIVE_DISPLAY_ID,"content hidden")}function getNotDisplayedElem(){return getOrCreateSection(NOT_DISPLAYED_ID,"hidden")}function switchDisplayedElement(elemToDisplay){const el=getAlternativeDisplayElem();if(el.children.length>0){getNotDisplayedElem().appendChild(el.firstElementChild)}if(elemToDisplay===null){addClass(el,"hidden");showMain();return}el.appendChild(elemToDisplay);hideMain();removeClass(el,"hidden")}function browserSupportsHistoryApi(){return window.history&&typeof window.history.pushState==="function"}function loadCss(cssFileName){const link=document.createElement("link");link.href=resourcePath(cssFileName,".css");link.type="text/css";link.rel="stylesheet";document.getElementsByTagName("head")[0].appendChild(link)}(function(){function loadScript(url){const script=document.createElement("script");script.src=url;document.head.append(script)}getSettingsButton().onclick=event=>{addClass(getSettingsButton(),"rotate");event.preventDefault();loadCss("settings");loadScript(resourcePath("settings",".js"))};window.searchState={loadingText:"Loading search results...",input:document.getElementsByClassName("search-input")[0],outputElement:()=>{let el=document.getElementById("search");if(!el){el=document.createElement("section");el.id="search";getNotDisplayedElem().appendChild(el)}return el},title:document.title,titleBeforeSearch:document.title,timeout:null,currentTab:0,focusedByTab:[null,null,null],clearInputTimeout:()=>{if(searchState.timeout!==null){clearTimeout(searchState.timeout);searchState.timeout=null}},isDisplayed:()=>searchState.outputElement().parentElement.id===ALTERNATIVE_DISPLAY_ID,focus:()=>{searchState.input.focus()},defocus:()=>{searchState.input.blur()},showResults:search=>{if(search===null||typeof search==="undefined"){search=searchState.outputElement()}switchDisplayedElement(search);searchState.mouseMovedAfterSearch=false;document.title=searchState.title},hideResults:()=>{switchDisplayedElement(null);document.title=searchState.titleBeforeSearch;if(browserSupportsHistoryApi()){history.replaceState(null,window.currentCrate+" - Rust",getNakedUrl()+window.location.hash)}},getQueryStringParams:()=>{const params={};window.location.search.substring(1).split("&").map(s=>{const pair=s.split("=");params[decodeURIComponent(pair[0])]=typeof pair[1]==="undefined"?null:decodeURIComponent(pair[1])});return params},setup:()=>{const search_input=searchState.input;if(!searchState.input){return}let searchLoaded=false;function loadSearch(){if(!searchLoaded){searchLoaded=true;loadScript(resourcePath("search",".js"));loadScript(resourcePath("search-index",".js"))}}search_input.addEventListener("focus",()=>{search_input.origPlaceholder=search_input.placeholder;search_input.placeholder="Type your search here.";loadSearch()});if(search_input.value!==""){loadSearch()}const params=searchState.getQueryStringParams();if(params.search!==undefined){const search=searchState.outputElement();search.innerHTML="

"+searchState.loadingText+"

";searchState.showResults(search);loadSearch()}},};function getPageId(){if(window.location.hash){const tmp=window.location.hash.replace(/^#/,"");if(tmp.length>0){return tmp}}return null}const toggleAllDocsId="toggle-all-docs";let savedHash="";function handleHashes(ev){if(ev!==null&&searchState.isDisplayed()&&ev.newURL){switchDisplayedElement(null);const hash=ev.newURL.slice(ev.newURL.indexOf("#")+1);if(browserSupportsHistoryApi()){history.replaceState(null,"",getNakedUrl()+window.location.search+"#"+hash)}const elem=document.getElementById(hash);if(elem){elem.scrollIntoView()}}if(savedHash!==window.location.hash){savedHash=window.location.hash;if(savedHash.length===0){return}expandSection(savedHash.slice(1))}}function onHashChange(ev){const sidebar=document.getElementsByClassName("sidebar")[0];removeClass(sidebar,"shown");handleHashes(ev)}function openParentDetails(elem){while(elem){if(elem.tagName==="DETAILS"){elem.open=true}elem=elem.parentNode}}function expandSection(id){openParentDetails(document.getElementById(id))}function getHelpElement(build){if(build){buildHelperPopup()}return document.getElementById("help")}function displayHelp(display,ev,help){if(display){help=help?help:getHelpElement(true);if(hasClass(help,"hidden")){ev.preventDefault();removeClass(help,"hidden");addClass(document.body,"blur")}}else{help=help?help:getHelpElement(false);if(help&&!hasClass(help,"hidden")){ev.preventDefault();addClass(help,"hidden");removeClass(document.body,"blur")}}}function handleEscape(ev){searchState.clearInputTimeout();const help=getHelpElement(false);if(help&&!hasClass(help,"hidden")){displayHelp(false,ev,help)}else{switchDisplayedElement(null);if(browserSupportsHistoryApi()){history.replaceState(null,window.currentCrate+" - Rust",getNakedUrl()+window.location.hash)}ev.preventDefault()}searchState.defocus();window.hideSettings()}const disableShortcuts=getSettingValue("disable-shortcuts")==="true";function handleShortcut(ev){if(ev.ctrlKey||ev.altKey||ev.metaKey||disableShortcuts){return}if(document.activeElement.tagName==="INPUT"){switch(getVirtualKey(ev)){case"Escape":handleEscape(ev);break}}else{switch(getVirtualKey(ev)){case"Escape":handleEscape(ev);break;case"s":case"S":displayHelp(false,ev);ev.preventDefault();searchState.focus();break;case"+":case"-":ev.preventDefault();toggleAllDocs();break;case"?":displayHelp(true,ev);break;default:break}}}document.addEventListener("keypress",handleShortcut);document.addEventListener("keydown",handleShortcut);function addSidebarItems(){if(!window.SIDEBAR_ITEMS){return}const sidebar=document.getElementsByClassName("sidebar-elems")[0];function block(shortty,id,longty){const filtered=window.SIDEBAR_ITEMS[shortty];if(!filtered){return}const div=document.createElement("div");div.className="block "+shortty;const h3=document.createElement("h3");h3.innerHTML=`${longty}`;div.appendChild(h3);const ul=document.createElement("ul");for(const item of filtered){const name=item[0];const desc=item[1];let klass=shortty;let path;if(shortty==="mod"){path=name+"/index.html"}else{path=shortty+"."+name+".html"}const current_page=document.location.href.split("/").pop();if(path===current_page){klass+=" current"}const link=document.createElement("a");link.href=path;link.title=desc;link.className=klass;link.textContent=name;const li=document.createElement("li");li.appendChild(link);ul.appendChild(li)}div.appendChild(ul);sidebar.appendChild(div)}if(sidebar){const isModule=hasClass(document.body,"mod");if(!isModule){block("primitive","primitives","Primitive Types");block("mod","modules","Modules");block("macro","macros","Macros");block("struct","structs","Structs");block("enum","enums","Enums");block("union","unions","Unions");block("constant","constants","Constants");block("static","static","Statics");block("trait","traits","Traits");block("fn","functions","Functions");block("type","types","Type Definitions");block("foreigntype","foreign-types","Foreign Types");block("keyword","keywords","Keywords");block("traitalias","trait-aliases","Trait Aliases")}}}window.register_implementors=imp=>{const implementors=document.getElementById("implementors-list");const synthetic_implementors=document.getElementById("synthetic-implementors-list");const inlined_types=new Set();if(synthetic_implementors){onEachLazy(synthetic_implementors.getElementsByClassName("impl"),el=>{const aliases=el.getAttribute("data-aliases");if(!aliases){return}aliases.split(",").forEach(alias=>{inlined_types.add(alias)})})}let currentNbImpls=implementors.getElementsByClassName("impl").length;const traitName=document.querySelector("h1.fqn > .in-band > .trait").textContent;const baseIdName="impl-"+traitName+"-";const libs=Object.getOwnPropertyNames(imp);const ignoreExternCrates=document.querySelector("script[data-ignore-extern-crates]").getAttribute("data-ignore-extern-crates");for(const lib of libs){if(lib===window.currentCrate||ignoreExternCrates.indexOf(lib)!==-1){continue}const structs=imp[lib];struct_loop:for(const struct of structs){const list=struct.synthetic?synthetic_implementors:implementors;if(struct.synthetic){for(const struct_type of struct.types){if(inlined_types.has(struct_type)){continue struct_loop}inlined_types.add(struct_type)}}const code=document.createElement("h3");code.innerHTML=struct.text;addClass(code,"code-header");addClass(code,"in-band");onEachLazy(code.getElementsByTagName("a"),elem=>{const href=elem.getAttribute("href");if(href&&href.indexOf("http")!==0){elem.setAttribute("href",window.rootPath+href)}});const currentId=baseIdName+currentNbImpls;const anchor=document.createElement("a");anchor.href="#"+currentId;addClass(anchor,"anchor");const display=document.createElement("div");display.id=currentId;addClass(display,"impl");display.appendChild(anchor);display.appendChild(code);list.appendChild(display);currentNbImpls+=1}}};if(window.pending_implementors){window.register_implementors(window.pending_implementors)}function addSidebarCrates(){if(!window.ALL_CRATES){return}const sidebarElems=document.getElementsByClassName("sidebar-elems")[0];if(!sidebarElems){return}const div=document.createElement("div");div.className="block crate";div.innerHTML="

Crates

";const ul=document.createElement("ul");div.appendChild(ul);for(const crate of window.ALL_CRATES){let klass="crate";if(window.rootPath!=="./"&&crate===window.currentCrate){klass+=" current"}const link=document.createElement("a");link.href=window.rootPath+crate+"/index.html";link.className=klass;link.textContent=crate;const li=document.createElement("li");li.appendChild(link);ul.appendChild(li)}sidebarElems.appendChild(div)}function labelForToggleButton(sectionIsCollapsed){if(sectionIsCollapsed){return"+"}return"\u2212"}function toggleAllDocs(){const innerToggle=document.getElementById(toggleAllDocsId);if(!innerToggle){return}let sectionIsCollapsed=false;if(hasClass(innerToggle,"will-expand")){removeClass(innerToggle,"will-expand");onEachLazy(document.getElementsByClassName("rustdoc-toggle"),e=>{if(!hasClass(e,"type-contents-toggle")){e.open=true}});innerToggle.title="collapse all docs"}else{addClass(innerToggle,"will-expand");onEachLazy(document.getElementsByClassName("rustdoc-toggle"),e=>{if(e.parentNode.id!=="implementations-list"||(!hasClass(e,"implementors-toggle")&&!hasClass(e,"type-contents-toggle"))){e.open=false}});sectionIsCollapsed=true;innerToggle.title="expand all docs"}innerToggle.children[0].innerText=labelForToggleButton(sectionIsCollapsed)}(function(){const toggles=document.getElementById(toggleAllDocsId);if(toggles){toggles.onclick=toggleAllDocs}const hideMethodDocs=getSettingValue("auto-hide-method-docs")==="true";const hideImplementations=getSettingValue("auto-hide-trait-implementations")==="true";const hideLargeItemContents=getSettingValue("auto-hide-large-items")!=="false";function setImplementorsTogglesOpen(id,open){const list=document.getElementById(id);if(list!==null){onEachLazy(list.getElementsByClassName("implementors-toggle"),e=>{e.open=open})}}if(hideImplementations){setImplementorsTogglesOpen("trait-implementations-list",false);setImplementorsTogglesOpen("blanket-implementations-list",false)}onEachLazy(document.getElementsByClassName("rustdoc-toggle"),e=>{if(!hideLargeItemContents&&hasClass(e,"type-contents-toggle")){e.open=true}if(hideMethodDocs&&hasClass(e,"method-toggle")){e.open=false}});const pageId=getPageId();if(pageId!==null){expandSection(pageId)}}());(function(){let lineNumbersFunc=()=>{};if(getSettingValue("line-numbers")==="true"){lineNumbersFunc=x=>{const count=x.textContent.split("\n").length;const elems=[];for(let i=0;i{if(hasClass(e,"compile_fail")){e.addEventListener("mouseover",function(){this.parentElement.previousElementSibling.childNodes[0].style.color="#f00"});e.addEventListener("mouseout",function(){this.parentElement.previousElementSibling.childNodes[0].style.color=""})}else if(hasClass(e,"ignore")){e.addEventListener("mouseover",function(){this.parentElement.previousElementSibling.childNodes[0].style.color="#ff9200"});e.addEventListener("mouseout",function(){this.parentElement.previousElementSibling.childNodes[0].style.color=""})}lineNumbersFunc(e)})}());function hideSidebar(){const sidebar=document.getElementsByClassName("sidebar")[0];removeClass(sidebar,"shown")}function handleClick(id,f){const elem=document.getElementById(id);if(elem){elem.addEventListener("click",f)}}handleClick("help-button",ev=>{displayHelp(true,ev)});handleClick(MAIN_ID,()=>{hideSidebar()});onEachLazy(document.getElementsByTagName("a"),el=>{if(el.hash){el.addEventListener("click",()=>{expandSection(el.hash.slice(1));hideSidebar()})}});onEachLazy(document.querySelectorAll(".rustdoc-toggle > summary:not(.hideme)"),el=>{el.addEventListener("click",e=>{if(e.target.tagName!=="SUMMARY"&&e.target.tagName!=="A"){e.preventDefault()}})});onEachLazy(document.getElementsByClassName("notable-traits"),e=>{e.onclick=function(){this.getElementsByClassName("notable-traits-tooltiptext")[0].classList.toggle("force-tooltip")}});const sidebar_menu_toggle=document.getElementsByClassName("sidebar-menu-toggle")[0];if(sidebar_menu_toggle){sidebar_menu_toggle.addEventListener("click",()=>{const sidebar=document.getElementsByClassName("sidebar")[0];if(!hasClass(sidebar,"shown")){addClass(sidebar,"shown")}else{removeClass(sidebar,"shown")}})}let buildHelperPopup=()=>{const popup=document.createElement("aside");addClass(popup,"hidden");popup.id="help";popup.addEventListener("click",ev=>{if(ev.target===popup){displayHelp(false,ev)}});const book_info=document.createElement("span");book_info.className="top";book_info.innerHTML="You can find more information in \ - the rustdoc book.";const container=document.createElement("div");const shortcuts=[["?","Show this help dialog"],["S","Focus the search field"],["↑","Move up in search results"],["↓","Move down in search results"],["← / →","Switch result tab (when results focused)"],["⏎","Go to active search result"],["+","Expand all sections"],["-","Collapse all sections"],].map(x=>"
"+x[0].split(" ").map((y,index)=>((index&1)===0?""+y+"":" "+y+" ")).join("")+"
"+x[1]+"
").join("");const div_shortcuts=document.createElement("div");addClass(div_shortcuts,"shortcuts");div_shortcuts.innerHTML="

Keyboard Shortcuts

"+shortcuts+"
";const infos=["Prefix searches with a type followed by a colon (e.g., fn:) to \ +"use strict";function getVar(name){const el=document.getElementById("rustdoc-vars");if(el){return el.attributes["data-"+name].value}else{return null}}function resourcePath(basename,extension){return getVar("root-path")+basename+getVar("resource-suffix")+extension}function hideMain(){addClass(document.getElementById(MAIN_ID),"hidden")}function showMain(){removeClass(document.getElementById(MAIN_ID),"hidden")}function elemIsInParent(elem,parent){while(elem&&elem!==document.body){if(elem===parent){return true}elem=elem.parentElement}return false}function blurHandler(event,parentElem,hideCallback){if(!elemIsInParent(document.activeElement,parentElem)&&!elemIsInParent(event.relatedTarget,parentElem)){hideCallback()}}(function(){window.rootPath=getVar("root-path");window.currentCrate=getVar("current-crate")}());function setMobileTopbar(){const mobileLocationTitle=document.querySelector(".mobile-topbar h2.location");const locationTitle=document.querySelector(".sidebar h2.location");if(mobileLocationTitle&&locationTitle){mobileLocationTitle.innerHTML=locationTitle.innerHTML}}function getVirtualKey(ev){if("key"in ev&&typeof ev.key!=="undefined"){return ev.key}const c=ev.charCode||ev.keyCode;if(c===27){return"Escape"}return String.fromCharCode(c)}const MAIN_ID="main-content";const SETTINGS_BUTTON_ID="settings-menu";const ALTERNATIVE_DISPLAY_ID="alternative-display";const NOT_DISPLAYED_ID="not-displayed";const HELP_BUTTON_ID="help-button";function getSettingsButton(){return document.getElementById(SETTINGS_BUTTON_ID)}function getHelpButton(){return document.getElementById(HELP_BUTTON_ID)}function getNakedUrl(){return window.location.href.split("?")[0].split("#")[0]}function insertAfter(newNode,referenceNode){referenceNode.parentNode.insertBefore(newNode,referenceNode.nextSibling)}function getOrCreateSection(id,classes){let el=document.getElementById(id);if(!el){el=document.createElement("section");el.id=id;el.className=classes;insertAfter(el,document.getElementById(MAIN_ID))}return el}function getAlternativeDisplayElem(){return getOrCreateSection(ALTERNATIVE_DISPLAY_ID,"content hidden")}function getNotDisplayedElem(){return getOrCreateSection(NOT_DISPLAYED_ID,"hidden")}function switchDisplayedElement(elemToDisplay){const el=getAlternativeDisplayElem();if(el.children.length>0){getNotDisplayedElem().appendChild(el.firstElementChild)}if(elemToDisplay===null){addClass(el,"hidden");showMain();return}el.appendChild(elemToDisplay);hideMain();removeClass(el,"hidden")}function browserSupportsHistoryApi(){return window.history&&typeof window.history.pushState==="function"}function loadCss(cssFileName){const link=document.createElement("link");link.href=resourcePath(cssFileName,".css");link.type="text/css";link.rel="stylesheet";document.getElementsByTagName("head")[0].appendChild(link)}(function(){function loadScript(url){const script=document.createElement("script");script.src=url;document.head.append(script)}getSettingsButton().onclick=event=>{addClass(getSettingsButton(),"rotate");event.preventDefault();loadCss("settings");loadScript(resourcePath("settings",".js"))};window.searchState={loadingText:"Loading search results...",input:document.getElementsByClassName("search-input")[0],outputElement:()=>{let el=document.getElementById("search");if(!el){el=document.createElement("section");el.id="search";getNotDisplayedElem().appendChild(el)}return el},title:document.title,titleBeforeSearch:document.title,timeout:null,currentTab:0,focusedByTab:[null,null,null],clearInputTimeout:()=>{if(searchState.timeout!==null){clearTimeout(searchState.timeout);searchState.timeout=null}},isDisplayed:()=>searchState.outputElement().parentElement.id===ALTERNATIVE_DISPLAY_ID,focus:()=>{searchState.input.focus()},defocus:()=>{searchState.input.blur()},showResults:search=>{if(search===null||typeof search==="undefined"){search=searchState.outputElement()}switchDisplayedElement(search);searchState.mouseMovedAfterSearch=false;document.title=searchState.title},hideResults:()=>{switchDisplayedElement(null);document.title=searchState.titleBeforeSearch;if(browserSupportsHistoryApi()){history.replaceState(null,window.currentCrate+" - Rust",getNakedUrl()+window.location.hash)}},getQueryStringParams:()=>{const params={};window.location.search.substring(1).split("&").map(s=>{const pair=s.split("=");params[decodeURIComponent(pair[0])]=typeof pair[1]==="undefined"?null:decodeURIComponent(pair[1])});return params},setup:()=>{const search_input=searchState.input;if(!searchState.input){return}let searchLoaded=false;function loadSearch(){if(!searchLoaded){searchLoaded=true;loadScript(resourcePath("search",".js"));loadScript(resourcePath("search-index",".js"))}}search_input.addEventListener("focus",()=>{search_input.origPlaceholder=search_input.placeholder;search_input.placeholder="Type your search here.";loadSearch()});if(search_input.value!==""){loadSearch()}const params=searchState.getQueryStringParams();if(params.search!==undefined){const search=searchState.outputElement();search.innerHTML="

"+searchState.loadingText+"

";searchState.showResults(search);loadSearch()}},};function getPageId(){if(window.location.hash){const tmp=window.location.hash.replace(/^#/,"");if(tmp.length>0){return tmp}}return null}const toggleAllDocsId="toggle-all-docs";let savedHash="";function handleHashes(ev){if(ev!==null&&searchState.isDisplayed()&&ev.newURL){switchDisplayedElement(null);const hash=ev.newURL.slice(ev.newURL.indexOf("#")+1);if(browserSupportsHistoryApi()){history.replaceState(null,"",getNakedUrl()+window.location.search+"#"+hash)}const elem=document.getElementById(hash);if(elem){elem.scrollIntoView()}}if(savedHash!==window.location.hash){savedHash=window.location.hash;if(savedHash.length===0){return}expandSection(savedHash.slice(1))}}function onHashChange(ev){hideSidebar();handleHashes(ev)}function openParentDetails(elem){while(elem){if(elem.tagName==="DETAILS"){elem.open=true}elem=elem.parentNode}}function expandSection(id){openParentDetails(document.getElementById(id))}function handleEscape(ev){searchState.clearInputTimeout();switchDisplayedElement(null);if(browserSupportsHistoryApi()){history.replaceState(null,window.currentCrate+" - Rust",getNakedUrl()+window.location.hash)}ev.preventDefault();searchState.defocus();window.hidePopoverMenus()}function handleShortcut(ev){const disableShortcuts=getSettingValue("disable-shortcuts")==="true";if(ev.ctrlKey||ev.altKey||ev.metaKey||disableShortcuts){return}if(document.activeElement.tagName==="INPUT"&&document.activeElement.type!=="checkbox"){switch(getVirtualKey(ev)){case"Escape":handleEscape(ev);break}}else{switch(getVirtualKey(ev)){case"Escape":handleEscape(ev);break;case"s":case"S":ev.preventDefault();searchState.focus();break;case"+":case"-":ev.preventDefault();toggleAllDocs();break;case"?":showHelp();break;default:break}}}document.addEventListener("keypress",handleShortcut);document.addEventListener("keydown",handleShortcut);function addSidebarItems(){if(!window.SIDEBAR_ITEMS){return}const sidebar=document.getElementsByClassName("sidebar-elems")[0];function block(shortty,id,longty){const filtered=window.SIDEBAR_ITEMS[shortty];if(!filtered){return}const div=document.createElement("div");div.className="block "+shortty;const h3=document.createElement("h3");h3.innerHTML=`${longty}`;div.appendChild(h3);const ul=document.createElement("ul");for(const item of filtered){const name=item[0];const desc=item[1];let klass=shortty;let path;if(shortty==="mod"){path=name+"/index.html"}else{path=shortty+"."+name+".html"}const current_page=document.location.href.split("/").pop();if(path===current_page){klass+=" current"}const link=document.createElement("a");link.href=path;link.title=desc;link.className=klass;link.textContent=name;const li=document.createElement("li");li.appendChild(link);ul.appendChild(li)}div.appendChild(ul);sidebar.appendChild(div)}if(sidebar){block("primitive","primitives","Primitive Types");block("mod","modules","Modules");block("macro","macros","Macros");block("struct","structs","Structs");block("enum","enums","Enums");block("union","unions","Unions");block("constant","constants","Constants");block("static","static","Statics");block("trait","traits","Traits");block("fn","functions","Functions");block("type","types","Type Definitions");block("foreigntype","foreign-types","Foreign Types");block("keyword","keywords","Keywords");block("traitalias","trait-aliases","Trait Aliases")}}window.register_implementors=imp=>{const implementors=document.getElementById("implementors-list");const synthetic_implementors=document.getElementById("synthetic-implementors-list");const inlined_types=new Set();const TEXT_IDX=0;const SYNTHETIC_IDX=1;const TYPES_IDX=2;if(synthetic_implementors){onEachLazy(synthetic_implementors.getElementsByClassName("impl"),el=>{const aliases=el.getAttribute("data-aliases");if(!aliases){return}aliases.split(",").forEach(alias=>{inlined_types.add(alias)})})}let currentNbImpls=implementors.getElementsByClassName("impl").length;const traitName=document.querySelector("h1.fqn > .in-band > .trait").textContent;const baseIdName="impl-"+traitName+"-";const libs=Object.getOwnPropertyNames(imp);const script=document.querySelector("script[data-ignore-extern-crates]");const ignoreExternCrates=script?script.getAttribute("data-ignore-extern-crates"):"";for(const lib of libs){if(lib===window.currentCrate||ignoreExternCrates.indexOf(lib)!==-1){continue}const structs=imp[lib];struct_loop:for(const struct of structs){const list=struct[SYNTHETIC_IDX]?synthetic_implementors:implementors;if(struct[SYNTHETIC_IDX]){for(const struct_type of struct[TYPES_IDX]){if(inlined_types.has(struct_type)){continue struct_loop}inlined_types.add(struct_type)}}const code=document.createElement("h3");code.innerHTML=struct[TEXT_IDX];addClass(code,"code-header");addClass(code,"in-band");onEachLazy(code.getElementsByTagName("a"),elem=>{const href=elem.getAttribute("href");if(href&&href.indexOf("http")!==0){elem.setAttribute("href",window.rootPath+href)}});const currentId=baseIdName+currentNbImpls;const anchor=document.createElement("a");anchor.href="#"+currentId;addClass(anchor,"anchor");const display=document.createElement("div");display.id=currentId;addClass(display,"impl");display.appendChild(anchor);display.appendChild(code);list.appendChild(display);currentNbImpls+=1}}};if(window.pending_implementors){window.register_implementors(window.pending_implementors)}function addSidebarCrates(){if(!window.ALL_CRATES){return}const sidebarElems=document.getElementsByClassName("sidebar-elems")[0];if(!sidebarElems){return}const div=document.createElement("div");div.className="block crate";div.innerHTML="

Crates

";const ul=document.createElement("ul");div.appendChild(ul);for(const crate of window.ALL_CRATES){let klass="crate";if(window.rootPath!=="./"&&crate===window.currentCrate){klass+=" current"}const link=document.createElement("a");link.href=window.rootPath+crate+"/index.html";link.className=klass;link.textContent=crate;const li=document.createElement("li");li.appendChild(link);ul.appendChild(li)}sidebarElems.appendChild(div)}function labelForToggleButton(sectionIsCollapsed){if(sectionIsCollapsed){return"+"}return"\u2212"}function toggleAllDocs(){const innerToggle=document.getElementById(toggleAllDocsId);if(!innerToggle){return}let sectionIsCollapsed=false;if(hasClass(innerToggle,"will-expand")){removeClass(innerToggle,"will-expand");onEachLazy(document.getElementsByClassName("rustdoc-toggle"),e=>{if(!hasClass(e,"type-contents-toggle")){e.open=true}});innerToggle.title="collapse all docs"}else{addClass(innerToggle,"will-expand");onEachLazy(document.getElementsByClassName("rustdoc-toggle"),e=>{if(e.parentNode.id!=="implementations-list"||(!hasClass(e,"implementors-toggle")&&!hasClass(e,"type-contents-toggle"))){e.open=false}});sectionIsCollapsed=true;innerToggle.title="expand all docs"}innerToggle.children[0].innerText=labelForToggleButton(sectionIsCollapsed)}(function(){const toggles=document.getElementById(toggleAllDocsId);if(toggles){toggles.onclick=toggleAllDocs}const hideMethodDocs=getSettingValue("auto-hide-method-docs")==="true";const hideImplementations=getSettingValue("auto-hide-trait-implementations")==="true";const hideLargeItemContents=getSettingValue("auto-hide-large-items")!=="false";function setImplementorsTogglesOpen(id,open){const list=document.getElementById(id);if(list!==null){onEachLazy(list.getElementsByClassName("implementors-toggle"),e=>{e.open=open})}}if(hideImplementations){setImplementorsTogglesOpen("trait-implementations-list",false);setImplementorsTogglesOpen("blanket-implementations-list",false)}onEachLazy(document.getElementsByClassName("rustdoc-toggle"),e=>{if(!hideLargeItemContents&&hasClass(e,"type-contents-toggle")){e.open=true}if(hideMethodDocs&&hasClass(e,"method-toggle")){e.open=false}});const pageId=getPageId();if(pageId!==null){expandSection(pageId)}}());(function(){if(getSettingValue("line-numbers")==="true"){onEachLazy(document.getElementsByClassName("rust-example-rendered"),x=>{const count=x.textContent.split("\n").length;const elems=[];for(let i=0;i{if(window.innerWidth>=window.RUSTDOC_MOBILE_BREAKPOINT&&oldSidebarScrollPosition!==null){hideSidebar()}});function handleClick(id,f){const elem=document.getElementById(id);if(elem){elem.addEventListener("click",f)}}handleClick(MAIN_ID,()=>{hideSidebar()});onEachLazy(document.getElementsByTagName("a"),el=>{if(el.hash){el.addEventListener("click",()=>{expandSection(el.hash.slice(1));hideSidebar()})}});onEachLazy(document.querySelectorAll(".rustdoc-toggle > summary:not(.hideme)"),el=>{el.addEventListener("click",e=>{if(e.target.tagName!=="SUMMARY"&&e.target.tagName!=="A"){e.preventDefault()}})});onEachLazy(document.getElementsByClassName("notable-traits"),e=>{e.onclick=function(){this.getElementsByClassName("notable-traits-tooltiptext")[0].classList.toggle("force-tooltip")}});const sidebar_menu_toggle=document.getElementsByClassName("sidebar-menu-toggle")[0];if(sidebar_menu_toggle){sidebar_menu_toggle.addEventListener("click",()=>{const sidebar=document.getElementsByClassName("sidebar")[0];if(!hasClass(sidebar,"shown")){showSidebar()}else{hideSidebar()}})}function helpBlurHandler(event){blurHandler(event,getHelpButton(),window.hidePopoverMenus)}function buildHelpMenu(){const book_info=document.createElement("span");book_info.className="top";book_info.innerHTML="You can find more information in \ + the rustdoc book.";const shortcuts=[["?","Show this help dialog"],["S","Focus the search field"],["↑","Move up in search results"],["↓","Move down in search results"],["← / →","Switch result tab (when results focused)"],["⏎","Go to active search result"],["+","Expand all sections"],["-","Collapse all sections"],].map(x=>"
"+x[0].split(" ").map((y,index)=>((index&1)===0?""+y+"":" "+y+" ")).join("")+"
"+x[1]+"
").join("");const div_shortcuts=document.createElement("div");addClass(div_shortcuts,"shortcuts");div_shortcuts.innerHTML="

Keyboard Shortcuts

"+shortcuts+"
";const infos=["Prefix searches with a type followed by a colon (e.g., fn:) to \ restrict the search to a given item kind.","Accepted kinds are: fn, mod, struct, \ enum, trait, type, macro, \ and const.","Search functions by type signature (e.g., vec -> usize or \ - * -> vec)","Search multiple things at once by splitting your query with comma (e.g., \ + -> vec)","Search multiple things at once by splitting your query with comma (e.g., \ str,u8 or String,struct:Vec,test)","You can look for items with an exact name by putting double quotes around \ - your request: \"string\"","Look for items inside another one by searching for a path: vec::Vec",].map(x=>"

"+x+"

").join("");const div_infos=document.createElement("div");addClass(div_infos,"infos");div_infos.innerHTML="

Search Tricks

"+infos;container.appendChild(book_info);container.appendChild(div_shortcuts);container.appendChild(div_infos);const rustdoc_version=document.createElement("span");rustdoc_version.className="bottom";const rustdoc_version_code=document.createElement("code");rustdoc_version_code.innerText="rustdoc "+getVar("rustdoc-version");rustdoc_version.appendChild(rustdoc_version_code);container.appendChild(rustdoc_version);popup.appendChild(container);insertAfter(popup,document.querySelector("main"));buildHelperPopup=()=>{}};setMobileTopbar();addSidebarItems();addSidebarCrates();onHashChange(null);window.addEventListener("hashchange",onHashChange);searchState.setup()}());(function(){let reset_button_timeout=null;window.copy_path=but=>{const parent=but.parentElement;const path=[];onEach(parent.childNodes,child=>{if(child.tagName==="A"){path.push(child.textContent)}});const el=document.createElement("textarea");el.value=path.join("::");el.setAttribute("readonly","");el.style.position="absolute";el.style.left="-9999px";document.body.appendChild(el);el.select();document.execCommand("copy");document.body.removeChild(el);but.children[0].style.display="none";let tmp;if(but.childNodes.length<2){tmp=document.createTextNode("✓");but.appendChild(tmp)}else{onEachLazy(but.childNodes,e=>{if(e.nodeType===Node.TEXT_NODE){tmp=e;return true}});tmp.textContent="✓"}if(reset_button_timeout!==null){window.clearTimeout(reset_button_timeout)}function reset_button(){tmp.textContent="";reset_button_timeout=null;but.children[0].style.display=""}reset_button_timeout=window.setTimeout(reset_button,1000)}}()) \ No newline at end of file + your request: \"string\"","Look for items inside another one by searching for a path: vec::Vec",].map(x=>"

"+x+"

").join("");const div_infos=document.createElement("div");addClass(div_infos,"infos");div_infos.innerHTML="

Search Tricks

"+infos;const rustdoc_version=document.createElement("span");rustdoc_version.className="bottom";const rustdoc_version_code=document.createElement("code");rustdoc_version_code.innerText="rustdoc "+getVar("rustdoc-version");rustdoc_version.appendChild(rustdoc_version_code);const container=document.createElement("div");container.className="popover";container.style.display="none";const side_by_side=document.createElement("div");side_by_side.className="side-by-side";side_by_side.appendChild(div_shortcuts);side_by_side.appendChild(div_infos);container.appendChild(book_info);container.appendChild(side_by_side);container.appendChild(rustdoc_version);const help_button=getHelpButton();help_button.appendChild(container);container.onblur=helpBlurHandler;container.onclick=event=>{event.preventDefault()};help_button.onblur=helpBlurHandler;help_button.children[0].onblur=helpBlurHandler;return container}window.hidePopoverMenus=function(){onEachLazy(document.querySelectorAll(".search-container .popover"),elem=>{elem.style.display="none"})};function getHelpMenu(buildNeeded){let menu=getHelpButton().querySelector(".popover");if(!menu&&buildNeeded){menu=buildHelpMenu()}return menu}function showHelp(){const menu=getHelpMenu(true);if(menu.style.display==="none"){window.hidePopoverMenus();menu.style.display=""}}document.querySelector(`#${HELP_BUTTON_ID} > button`).addEventListener("click",event=>{const target=event.target;if(target.tagName!=="BUTTON"||target.parentElement.id!==HELP_BUTTON_ID){return}const menu=getHelpMenu(true);const shouldShowHelp=menu.style.display==="none";if(shouldShowHelp){showHelp()}else{window.hidePopoverMenus()}});setMobileTopbar();addSidebarItems();addSidebarCrates();onHashChange(null);window.addEventListener("hashchange",onHashChange);searchState.setup()}());(function(){let reset_button_timeout=null;window.copy_path=but=>{const parent=but.parentElement;const path=[];onEach(parent.childNodes,child=>{if(child.tagName==="A"){path.push(child.textContent)}});const el=document.createElement("textarea");el.value=path.join("::");el.setAttribute("readonly","");el.style.position="absolute";el.style.left="-9999px";document.body.appendChild(el);el.select();document.execCommand("copy");document.body.removeChild(el);but.children[0].style.display="none";let tmp;if(but.childNodes.length<2){tmp=document.createTextNode("✓");but.appendChild(tmp)}else{onEachLazy(but.childNodes,e=>{if(e.nodeType===Node.TEXT_NODE){tmp=e;return true}});tmp.textContent="✓"}if(reset_button_timeout!==null){window.clearTimeout(reset_button_timeout)}function reset_button(){tmp.textContent="";reset_button_timeout=null;but.children[0].style.display=""}reset_button_timeout=window.setTimeout(reset_button,1000)}}()) \ No newline at end of file diff --git a/rustdoc.css b/rustdoc.css index 26904c7..6157c9a 100644 --- a/rustdoc.css +++ b/rustdoc.css @@ -1 +1 @@ - @font-face {font-family:'Fira Sans';font-style:normal;font-weight:400;src:local('Fira Sans'),url("FiraSans-Regular.woff2") format("woff2");font-display:swap;}@font-face {font-family:'Fira Sans';font-style:normal;font-weight:500;src:local('Fira Sans Medium'),url("FiraSans-Medium.woff2") format("woff2");font-display:swap;}@font-face {font-family:'Source Serif 4';font-style:normal;font-weight:400;src:local('Source Serif 4'),url("SourceSerif4-Regular.ttf.woff2") format("woff2");font-display:swap;}@font-face {font-family:'Source Serif 4';font-style:italic;font-weight:400;src:local('Source Serif 4 Italic'),url("SourceSerif4-It.ttf.woff2") format("woff2");font-display:swap;}@font-face {font-family:'Source Serif 4';font-style:normal;font-weight:700;src:local('Source Serif 4 Bold'),url("SourceSerif4-Bold.ttf.woff2") format("woff2");font-display:swap;}@font-face {font-family:'Source Code Pro';font-style:normal;font-weight:400;src:url("SourceCodePro-Regular.ttf.woff2") format("woff2");font-display:swap;}@font-face {font-family:'Source Code Pro';font-style:italic;font-weight:400;src:url("SourceCodePro-It.ttf.woff2") format("woff2");font-display:swap;}@font-face {font-family:'Source Code Pro';font-style:normal;font-weight:600;src:url("SourceCodePro-Semibold.ttf.woff2") format("woff2");font-display:swap;}@font-face {font-family:'NanumBarunGothic';src:url("NanumBarunGothic.ttf.woff2") format("woff2");font-display:swap;unicode-range:U+AC00-D7AF,U+1100-11FF,U+3130-318F,U+A960-A97F,U+D7B0-D7FF;}*{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;}html{content:"";}@media (prefers-color-scheme:light){html{content:"light";}}@media (prefers-color-scheme:dark){html{content:"dark";}}body{font:1rem/1.5 "Source Serif 4",NanumBarunGothic,serif;margin:0;position:relative;overflow-wrap:break-word;overflow-wrap:anywhere;-webkit-font-feature-settings:"kern","liga";-moz-font-feature-settings:"kern","liga";font-feature-settings:"kern","liga";}h1{font-size:1.5rem;}h2{font-size:1.375rem;}h3{font-size:1.25rem;}h1,h2,h3,h4,h5,h6{font-weight:500;}h1,h2,h3,h4{margin:20px 0 15px 0;padding-bottom:6px;}.docblock h3,.docblock h4,h5,h6{margin:15px 0 5px 0;}h1.fqn{margin:0;padding:0;}.main-heading{display:flex;flex-wrap:wrap;justify-content:space-between;padding-bottom:6px;margin-bottom:15px;}.main-heading a:hover{text-decoration:underline;}#toggle-all-docs{text-decoration:none;}h2,.top-doc h3,.top-doc h4{border-bottom:1px solid;}h3.code-header{font-size:1.125rem;}h4.code-header{font-size:1rem;}.code-header{font-weight:600;border-bottom-style:none;margin:0;padding:0;margin-top:0.6em;margin-bottom:0.4em;}.impl,.impl-items .method,.methods .method,.impl-items .type,.methods .type,.impl-items .associatedconstant,.methods .associatedconstant,.impl-items .associatedtype,.methods .associatedtype{flex-basis:100%;font-weight:600;position:relative;}div.impl-items>div{padding-left:0;}h1,h2,h3,h4,h5,h6,.sidebar,.mobile-topbar,a.source,.search-input,.search-results .result-name,.content table td:first-child>a,.item-left>a,.out-of-band,span.since,#source-sidebar,#sidebar-toggle,details.rustdoc-toggle>summary::before,div.impl-items>div:not(.docblock):not(.item-info),.content ul.crate a.crate,a.srclink,#main-content>ul.docblock>li>a{font-family:"Fira Sans",Arial,NanumBarunGothic,sans-serif;}ol,ul{padding-left:24px;}ul ul,ol ul,ul ol,ol ol{margin-bottom:.625em;}p{margin:0 0 .75em 0;}summary{outline:none;}td,th{padding:0;}table{border-collapse:collapse;}button,input,optgroup,select,textarea{color:inherit;font:inherit;margin:0;}button{padding:1px 6px;}.rustdoc{display:flex;flex-direction:row;flex-wrap:nowrap;}main{position:relative;flex-grow:1;padding:10px 15px 40px 45px;min-width:0;}.source main{padding:15px;}.width-limiter{max-width:960px;margin-right:auto;}.source .width-limiter{max-width:unset;}details:not(.rustdoc-toggle) summary{margin-bottom:.6em;}code,pre,a.test-arrow,.code-header{font-family:"Source Code Pro",monospace;}.docblock code,.docblock-short code{border-radius:3px;padding:0 0.125em;}.docblock pre code,.docblock-short pre code{padding:0;}pre{padding:14px;}.docblock.item-decl{margin-left:0;}.item-decl pre{overflow-x:auto;}.source .content pre{padding:20px;}img{max-width:100%;}li{position:relative;}.source .content{max-width:none;overflow:visible;margin-left:0px;}nav.sub{position:relative;font-size:1rem;}.sub-container{display:flex;flex-direction:row;flex-wrap:nowrap;}.sub-logo-container{display:none;margin-right:20px;}.source .sub-logo-container{display:block;}.source .sub-logo-container>img{height:60px;width:60px;object-fit:contain;}.sidebar{font-size:0.875rem;width:250px;min-width:200px;overflow-y:scroll;position:sticky;height:100vh;top:0;left:0;}.sidebar-elems,.sidebar>.location{padding-left:24px;}.sidebar .location{overflow-wrap:anywhere;}.rustdoc.source .sidebar{width:50px;min-width:0px;max-width:300px;flex-grow:0;flex-shrink:0;flex-basis:auto;border-right:1px solid;overflow-x:hidden;overflow-y:hidden;}.rustdoc.source .sidebar .sidebar-logo{display:none;}.source .sidebar>*:not(#sidebar-toggle){opacity:0;visibility:hidden;}.source-sidebar-expanded .source .sidebar{overflow-y:auto;}.source-sidebar-expanded .source .sidebar>*:not(#sidebar-toggle){opacity:1;visibility:visible;}#all-types{margin-top:1em;}*{scrollbar-width:initial;}.sidebar{scrollbar-width:thin;}::-webkit-scrollbar{width:12px;}.sidebar::-webkit-scrollbar{width:8px;}::-webkit-scrollbar-track{-webkit-box-shadow:inset 0;}.hidden{display:none !important;}.sidebar .logo-container{display:flex;margin-top:10px;margin-bottom:10px;justify-content:center;}.version{overflow-wrap:break-word;}.logo-container>img{height:100px;width:100px;}.location:empty{border:none;}.location a:first-of-type{font-weight:500;}.block{padding:0;}.block ul,.block li{padding:0;margin:0;list-style:none;}.block a,h2.location a{display:block;padding:0.25rem;margin-left:-0.25rem;text-overflow:ellipsis;overflow:hidden;}.sidebar h2{border-bottom:none;font-weight:500;padding:0;margin:0;margin-top:0.7rem;margin-bottom:0.7rem;}.sidebar h3{font-size:1.125rem;font-weight:500;padding:0;margin:0;}.sidebar-elems .block{margin-bottom:2em;}.sidebar-elems .block li a{white-space:nowrap;}.mobile-topbar{display:none;}.source .content pre.rust{white-space:pre;overflow:auto;padding-left:0;}.rustdoc .example-wrap{display:inline-flex;margin-bottom:10px;}.example-wrap{position:relative;width:100%;}.example-wrap>pre.line-number{overflow:initial;border:1px solid;padding:13px 8px;text-align:right;border-top-left-radius:5px;border-bottom-left-radius:5px;}.example-wrap>pre.rust a:hover{text-decoration:underline;}.line-numbers{text-align:right;}.rustdoc:not(.source) .example-wrap>pre:not(.line-number){width:100%;overflow-x:auto;}.rustdoc:not(.source) .example-wrap>pre.line-numbers{width:auto;overflow-x:visible;}.rustdoc .example-wrap>pre{margin:0;}#search{position:relative;}.search-loading{text-align:center;}#results>table{width:100%;table-layout:fixed;}.content>.example-wrap pre.line-numbers{position:relative;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;}.line-numbers span{cursor:pointer;}.docblock-short{overflow-wrap:break-word;overflow-wrap:anywhere;}.docblock-short p{display:inline;}.docblock-short p{overflow:hidden;text-overflow:ellipsis;margin:0;}.docblock>:not(pre)>code,.docblock-short>:not(pre)>code{white-space:pre-wrap;}.top-doc .docblock h2{font-size:1.375rem;}.top-doc .docblock h3{font-size:1.25;}.top-doc .docblock h4,.top-doc .docblock h5{font-size:1.125rem;}.top-doc .docblock h6{font-size:1rem;}.docblock h5{font-size:1rem;}.docblock h6{font-size:0.875rem;}.docblock{margin-left:24px;position:relative;}.docblock>:not(.information):not(.more-examples-toggle){max-width:100%;overflow-x:auto;}.content .out-of-band{flex-grow:0;font-size:1.125rem;font-weight:normal;float:right;}.method>.code-header,.trait-impl>.code-header{max-width:calc(100% - 41px);display:block;}.invisible{width:100%;display:inline-block;}.content .in-band{flex-grow:1;margin:0px;padding:0px;overflow-wrap:break-word;overflow-wrap:anywhere;}.in-band>code,.in-band>.code-header{display:inline-block;}#main-content{position:relative;}#main-content>.since{top:inherit;font-family:"Fira Sans",Arial,sans-serif;}.content table:not(.table-display){border-spacing:0 5px;}.content td{vertical-align:top;}.content td:first-child{padding-right:20px;}.content td p:first-child{margin-top:0;}.content td h1,.content td h2{margin-left:0;font-size:1.125rem;}.content tr:first-child td{border-top:0;}.docblock table{margin:.5em 0;width:calc(100% - 2px);overflow-x:auto;display:block;}.docblock table td{padding:.5em;border:1px dashed;}.docblock table th{padding:.5em;text-align:left;border:1px solid;}.fields+table{margin-bottom:1em;}.content .item-list{list-style-type:none;padding:0;}.content .multi-column{-moz-column-count:5;-moz-column-gap:2.5em;-webkit-column-count:5;-webkit-column-gap:2.5em;column-count:5;column-gap:2.5em;}.content .multi-column li{width:100%;display:inline-block;}.content>.methods>.method{font-size:1rem;position:relative;}.content .method .where,.content .fn .where,.content .where.fmt-newline{display:block;font-size:0.875rem;}.content .methods>div:not(.notable-traits):not(.method){margin-left:40px;margin-bottom:15px;}.content .docblock>.impl-items{margin-left:20px;margin-top:-34px;}.content .docblock>.impl-items .table-display{margin:0;}.content .docblock>.impl-items table td{padding:0;}.content .docblock>.impl-items .table-display,.impl-items table td{border:none;}.item-info{display:block;}.content .item-info code{font-size:0.875rem;}.content .item-info{position:relative;margin-left:24px;}.sub-variant>div>.item-info{margin-top:initial;}.content .impl-items .docblock,.content .impl-items .item-info{margin-bottom:.6em;}.content .impl-items>.item-info{margin-left:40px;}.methods>.item-info,.content .impl-items>.item-info{margin-top:-8px;}.impl-items{flex-basis:100%;}#main-content>.item-info{margin-top:0;margin-left:0;}nav.sub{flex-grow:1;margin-bottom:25px;}.source nav.sub{margin-left:32px;}nav.main{padding:20px 0;text-align:center;}nav.main .current{border-top:1px solid;border-bottom:1px solid;}nav.main .separator{border:1px solid;display:inline-block;height:23px;margin:0 20px;}nav.sum{text-align:right;}nav.sub form{display:inline;}a{text-decoration:none;background:transparent;}.small-section-header{display:flex;justify-content:space-between;position:relative;}.small-section-header:hover>.anchor{display:initial;}.in-band:hover>.anchor,.impl:hover>.anchor,.method.trait-impl:hover>.anchor,.type.trait-impl:hover>.anchor,.associatedconstant.trait-impl:hover>.anchor,.associatedtype.trait-impl:hover>.anchor{display:inline-block;position:absolute;}.anchor{display:none;position:absolute;left:-0.5em;background:none !important;}.anchor.field{left:-5px;}.small-section-header>.anchor{left:-15px;padding-right:8px;}h2.small-section-header>.anchor{padding-right:6px;}.anchor::before{content:'§';}.docblock a:not(.srclink):not(.test-arrow):not(.scrape-help):hover,.docblock-short a:not(.srclink):not(.test-arrow):not(.scrape-help):hover,.item-info a{text-decoration:underline;}.block a.current.crate{font-weight:500;}table,.item-table{overflow-wrap:break-word;}.item-table{display:table;}.item-row{display:table-row;}.item-left,.item-right{display:table-cell;}.item-left{padding-right:1.25rem;}.search-container{position:relative;display:flex;height:34px;}.search-container>*{height:100%;}.search-results-title{display:inline;}#search-settings{font-size:1.5rem;font-weight:500;margin-bottom:20px;}#crate-search{min-width:115px;margin-top:5px;margin-left:0.25em;padding-left:0.3125em;padding-right:23px;border:1px solid;border-radius:4px;outline:none;cursor:pointer;-moz-appearance:none;-webkit-appearance:none;text-indent:0.01px;text-overflow:"";background-repeat:no-repeat;background-color:transparent;background-size:20px;background-position:calc(100% - 1px) 56%;background-image:url("down-arrow.svg");}.search-container{margin-top:4px;}.search-input{-webkit-appearance:none;-moz-box-sizing:border-box !important;box-sizing:border-box !important;outline:none;border:1px solid;border-radius:2px;padding:8px;font-size:1rem;transition:border-color 300ms ease;width:100%;}.search-results{display:none;padding-bottom:2em;}.search-results.active{display:block;clear:both;}.search-results .desc>span{white-space:nowrap;text-overflow:ellipsis;overflow:hidden;display:block;}.search-results>a{display:block;width:100%;margin-left:2px;margin-right:2px;border-bottom:1px solid #aaa3;}.search-results>a>div{display:flex;flex-flow:row wrap;}.search-results .result-name,.search-results div.desc,.search-results .result-description{width:50%;}.search-results .result-name{padding-right:1em;}.search-results .result-name>span{display:inline-block;margin:0;font-weight:normal;}body.blur>:not(#help){filter:blur(8px);-webkit-filter:blur(8px);opacity:.7;}#help{width:100%;height:100vh;position:fixed;top:0;left:0;display:flex;justify-content:center;align-items:center;}#help>div{flex:0 0 auto;box-shadow:0 0 6px rgba(0,0,0,.2);width:550px;height:auto;border:1px solid;}#help dt{float:left;clear:left;display:block;margin-right:0.5rem;}#help span.top,#help span.bottom{text-align:center;display:block;font-size:1.125rem;}#help span.top{text-align:center;display:block;margin:10px 0;border-bottom:1px solid;padding-bottom:4px;margin-bottom:6px;}#help span.bottom{clear:both;border-top:1px solid;}#help dd{margin:5px 35px;}#help .infos{padding-left:0;}#help h1,#help h2{margin-top:0;}#help>div div{width:50%;float:left;padding:0 20px 20px 17px;;}.item-info .stab{display:inline-block;}.stab{padding:3px;margin-bottom:5px;font-size:0.875rem;font-weight:normal;}.stab p{display:inline;}.stab .emoji{font-size:1.25rem;}.emoji{text-shadow:1px 0 0 black,-1px 0 0 black,0 1px 0 black,0 -1px 0 black;}.module-item .stab,.import-item .stab{border-radius:3px;display:inline-block;font-size:0.875rem;line-height:1.2;margin-bottom:0;margin-left:0.3125em;padding:2px;vertical-align:text-bottom;}.module-item.unstable,.import-item.unstable{opacity:0.65;}.since{font-weight:normal;font-size:initial;}.rightside{padding-left:12px;padding-right:2px;position:initial;}.impl-items .srclink,.impl .srclink,.methods .srclink{font-weight:normal;font-size:1rem;}.rightside{float:right;}.variants_table{width:100%;}.variants_table tbody tr td:first-child{width:1%;}td.summary-column{width:100%;}.summary{padding-right:0px;}pre.rust .question-mark{font-weight:bold;}a.test-arrow{display:inline-block;visibility:hidden;position:absolute;padding:5px 10px 5px 10px;border-radius:5px;font-size:1.375rem;top:5px;right:5px;z-index:1;}.example-wrap:hover .test-arrow{visibility:visible;}a.test-arrow:hover{text-decoration:none;}.code-attribute{font-weight:300;}.item-spacer{width:100%;height:12px;}.out-of-band>span.since{position:initial;font-size:1.25rem;}h3.variant{font-weight:600;font-size:1.125rem;margin-bottom:10px;border-bottom:none;}.sub-variant h4{font-size:1rem;font-weight:400;border-bottom:none;margin-top:0;margin-bottom:0;}.sub-variant{margin-left:24px;margin-bottom:40px;}.sub-variant>.sub-variant-field{margin-left:24px;}.toggle-label{display:inline-block;margin-left:4px;margin-top:3px;}:target>code,:target>.code-header{opacity:1;}:target{padding-right:3px;}.information{position:absolute;left:-25px;margin-top:7px;z-index:1;}.tooltip{position:relative;display:inline-block;cursor:pointer;}.tooltip::after{display:none;text-align:center;padding:5px 3px 3px 3px;border-radius:6px;margin-left:5px;font-size:1rem;}.tooltip.ignore::after{content:"This example is not tested";}.tooltip.compile_fail::after{content:"This example deliberately fails to compile";}.tooltip.should_panic::after{content:"This example panics";}.tooltip.edition::after{content:"This code runs with edition " attr(data-edition);}.tooltip::before{content:" ";position:absolute;top:50%;left:16px;margin-top:-5px;border-width:5px;border-style:solid;display:none;}.tooltip:hover::before,.tooltip:hover::after{display:inline;}.tooltip.compile_fail,.tooltip.should_panic,.tooltip.ignore{font-weight:bold;font-size:1.25rem;}.notable-traits-tooltip{display:inline-block;cursor:pointer;}.notable-traits:hover .notable-traits-tooltiptext,.notable-traits .notable-traits-tooltiptext.force-tooltip{display:inline-block;}.notable-traits .notable-traits-tooltiptext{display:none;padding:5px 3px 3px 3px;border-radius:6px;margin-left:5px;z-index:10;font-size:1rem;cursor:default;position:absolute;border:1px solid;}.notable-traits-tooltip::after{content:"\00a0\00a0\00a0";}.notable-traits .notable,.notable-traits .docblock{margin:0;}.notable-traits .notable{margin:0;margin-bottom:13px;font-size:1.1875rem;font-weight:600;display:block;}.notable-traits .docblock code.content{margin:0;padding:0;font-size:1.25rem;}pre.rust.rust-example-rendered{position:relative;}pre.rust{tab-size:4;-moz-tab-size:4;}.search-failed{text-align:center;margin-top:20px;display:none;}.search-failed.active{display:block;}.search-failed>ul{text-align:left;max-width:570px;margin-left:auto;margin-right:auto;}#titles{height:35px;}#titles>button{float:left;width:33.3%;text-align:center;font-size:1.125rem;cursor:pointer;border:0;border-top:2px solid;}#titles>button:first-child:last-child{margin-right:1px;width:calc(100% - 1px);}#titles>button:not(:last-child){margin-right:1px;width:calc(33.3% - 1px);}#titles>button>div.count{display:inline-block;font-size:1rem;}.notable-traits{cursor:pointer;z-index:2;margin-left:5px;}#sidebar-toggle{position:sticky;top:0;left:0;cursor:pointer;font-weight:bold;font-size:1.25rem;border-bottom:1px solid;display:flex;height:40px;justify-content:center;align-items:center;z-index:10;}#source-sidebar{width:100%;z-index:1;overflow:auto;}#source-sidebar>.title{font-size:1.5rem;text-align:center;border-bottom:1px solid;margin-bottom:6px;}#settings-menu,#help-button{margin-left:4px;outline:none;}#copy-path{height:34px;}#settings-menu>a,#help-button,#copy-path{padding:5px;width:33px;border:1px solid;border-radius:2px;cursor:pointer;}#settings-menu{padding:0;}#settings-menu>a{padding:5px;width:100%;height:100%;display:block;}@keyframes rotating{from{transform:rotate(0deg);}to{transform:rotate(360deg);}}#settings-menu.rotate>a img{animation:rotating 2s linear infinite;}#help-button{font-family:"Fira Sans",Arial,sans-serif;text-align:center;font-size:20px;padding-top:2px;}#copy-path{background:initial;margin-left:10px;padding:0;padding-left:2px;border:0;}#theme-choices{display:none;position:absolute;left:0;top:28px;border:1px solid;border-radius:3px;z-index:1;cursor:pointer;}#theme-choices>button{border:none;width:100%;padding:4px 8px;text-align:center;background:rgba(0,0,0,0);overflow-wrap:normal;}#theme-choices>button:not(:first-child){border-top:1px solid;}kbd{display:inline-block;padding:3px 5px;font:15px monospace;line-height:10px;vertical-align:middle;border:solid 1px;border-radius:3px;cursor:default;}.hidden-by-impl-hider,.hidden-by-usual-hider{display:none !important;}#implementations-list>h3>span.in-band{width:100%;}.table-display{width:100%;border:0;border-collapse:collapse;border-spacing:0;font-size:1rem;}.table-display tr td:first-child{padding-right:0;}.table-display tr td:last-child{float:right;}.table-display .out-of-band{position:relative;font-size:1.125rem;display:block;}.table-display td:hover .anchor{display:block;top:2px;left:-5px;}#main-content>ul{padding-left:10px;}#main-content>ul>li{list-style:none;}.non-exhaustive{margin-bottom:1em;}div.children{padding-left:27px;display:none;}div.name{cursor:pointer;position:relative;margin-left:16px;}div.files>a{display:block;padding:0 3px;}div.files>a:hover,div.name:hover{background-color:#a14b4b;}div.name.expand+.children{display:block;}div.name::before{content:"\25B6";padding-left:4px;font-size:0.625rem;position:absolute;left:-16px;top:4px;}div.name.expand::before{transform:rotate(90deg);left:-15px;top:2px;}details.rustdoc-toggle>summary.hideme{cursor:pointer;}details.rustdoc-toggle>summary{list-style:none;}details.rustdoc-toggle>summary::-webkit-details-marker,details.rustdoc-toggle>summary::marker{display:none;}details.rustdoc-toggle>summary.hideme>span{margin-left:9px;}details.rustdoc-toggle>summary::before{content:"";cursor:pointer;width:16px;height:16px;background-repeat:no-repeat;background-position:top left;display:inline-block;vertical-align:middle;opacity:.5;}details.rustdoc-toggle>summary::after{content:"Expand";overflow:hidden;width:0;height:0;position:absolute;}details.rustdoc-toggle>summary.hideme::after{content:"";}details.rustdoc-toggle>summary:focus::before,details.rustdoc-toggle>summary:hover::before{opacity:1;}details.rustdoc-toggle.top-doc>summary,details.rustdoc-toggle.top-doc>summary::before,details.rustdoc-toggle.non-exhaustive>summary,details.rustdoc-toggle.non-exhaustive>summary::before{font-family:'Fira Sans';font-size:1rem;}details.non-exhaustive{margin-bottom:8px;}details.rustdoc-toggle>summary.hideme::before{position:relative;}details.rustdoc-toggle>summary:not(.hideme)::before{position:absolute;left:-24px;top:4px;}.impl-items>details.rustdoc-toggle>summary:not(.hideme)::before{position:absolute;left:-24px;}details.rustdoc-toggle[open] >summary.hideme{position:absolute;}details.rustdoc-toggle{position:relative;}details.rustdoc-toggle[open] >summary.hideme>span{display:none;}details.undocumented[open] >summary::before,details.rustdoc-toggle[open] >summary::before,details.rustdoc-toggle[open] >summary.hideme::before{background-image:url("toggle-minus.svg");}details.undocumented>summary::before,details.rustdoc-toggle>summary::before{background-image:url("toggle-plus.svg");}details.rustdoc-toggle[open] >summary::before,details.rustdoc-toggle[open] >summary.hideme::before{width:16px;height:16px;background-repeat:no-repeat;background-position:top left;display:inline-block;content:"";}details.rustdoc-toggle[open] >summary::after,details.rustdoc-toggle[open] >summary.hideme::after{content:"Collapse";}@media (min-width:701px){.docblock>.information:first-child>.tooltip{margin-top:16px;}.source-sidebar-expanded .source .sidebar+main .width-limiter .sub-logo-container.rust-logo{display:none;}.source-sidebar-expanded .source .sidebar{width:300px;}}@media (max-width:700px){*[id]{scroll-margin-top:45px;}.rustdoc{padding-top:0px;display:block;}main{padding-left:15px;padding-top:0px;}.rustdoc,.main-heading{flex-direction:column;}.content .out-of-band{text-align:left;margin-left:initial;padding:initial;}.content .out-of-band .since::before{content:"Since ";}#copy-path{display:none;}.sidebar .sidebar-logo,.sidebar .location{display:none;}.sidebar-elems{margin-top:1em;}.sidebar{position:fixed;top:45px;left:-1000px;margin-left:0;background-color:rgba(0,0,0,0);margin:0;padding:0;z-index:11;height:calc(100vh - 45px);}.source main,.source .sidebar{top:0;padding:0;}.sidebar.shown,.source-sidebar-expanded .source .sidebar,.sidebar:focus-within{left:0;}.rustdoc.source>.sidebar{position:fixed;margin:0;z-index:11;width:0;}.mobile-topbar .location a{padding:0;margin:0;}.mobile-topbar .location{border:none;padding:0;margin:auto 0.5em auto auto;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;font-size:24px;}.mobile-topbar .logo-container{max-height:45px;}.mobile-topbar .logo-container>img{max-width:35px;max-height:35px;margin-left:20px;margin-top:5px;margin-bottom:5px;}.mobile-topbar{display:flex;flex-direction:row;position:sticky;z-index:10;font-size:2rem;height:45px;width:100%;left:0;top:0;}.source .mobile-topbar{display:none;}.sidebar-menu-toggle{width:45px;font-size:32px;border:none;}.source nav:not(.sidebar).sub{margin-left:32px;}.content{margin-left:0px;}.source .content{margin-top:10px;}#search{margin-left:0;padding:0;}.anchor{display:none !important;}.notable-traits{position:absolute;left:-22px;top:24px;}#titles>button>div.count{float:left;width:100%;}#titles{height:50px;}#sidebar-filler{position:fixed;left:45px;width:calc(100% - 45px);top:0;height:45px;z-index:-1;border-bottom:1px solid;}#main-content>details.rustdoc-toggle>summary::before,#main-content>div>details.rustdoc-toggle>summary::before{left:-11px;}#sidebar-toggle{position:fixed;left:1px;top:100px;width:30px;font-size:1.5rem;text-align:center;padding:0;z-index:10;border-top-right-radius:3px;border-bottom-right-radius:3px;cursor:pointer;font-weight:bold;border:1px solid;border-left:0;}.source-sidebar-expanded #sidebar-toggle{left:unset;top:unset;width:unset;border-top-right-radius:unset;border-bottom-right-radius:unset;}#source-sidebar{z-index:11;}#main-content>.line-numbers{margin-top:0;}.notable-traits .notable-traits-tooltiptext{left:0;top:100%;}#help-button{display:none;}.item-table{display:block;}.item-row{display:flex;flex-flow:column wrap;}.item-left,.item-right{width:100%;}.search-results>a{border-bottom:1px solid #aaa9;padding:5px 0px;}.search-results .result-name,.search-results div.desc,.search-results .result-description{width:100%;}.search-results div.desc,.search-results .result-description,.item-right{padding-left:2em;}.source-sidebar-expanded .source .sidebar{max-width:100vw;width:100vw;}details.rustdoc-toggle:not(.top-doc)>summary{margin-left:10px;}.impl-items>details.rustdoc-toggle>summary:not(.hideme)::before,#main-content>details.rustdoc-toggle:not(.top-doc)>summary::before,#main-content>div>details.rustdoc-toggle>summary::before{left:-11px;}}@media print{nav.sub,.content .out-of-band{display:none;}}@media (max-width:464px){#titles,#titles>button{height:73px;}#main-content>table:not(.table-display) td{word-break:break-word;width:50%;}#crate-search{border-radius:4px;}.docblock{margin-left:12px;}.docblock code{overflow-wrap:break-word;overflow-wrap:anywhere;}.sub-container{flex-direction:column;}.sub-logo-container{align-self:center;}.source .sub-logo-container>img{height:35px;width:35px;}#sidebar-toggle{top:10px;}.source-sidebar-expanded #sidebar-toggle{top:unset;}}.method-toggle summary,.implementors-toggle summary,.impl{margin-bottom:0.75em;}.method-toggle[open]{margin-bottom:2em;}.implementors-toggle[open]{margin-bottom:2em;}#trait-implementations-list .method-toggle,#synthetic-implementations-list .method-toggle,#blanket-implementations-list .method-toggle{margin-bottom:1em;}.scraped-example-list .scrape-help{margin-left:10px;padding:0 4px;font-weight:normal;font-size:12px;position:relative;bottom:1px;background:transparent;border-width:1px;border-style:solid;border-radius:50px;}.scraped-example-title{font-family:'Fira Sans';}.scraped-example .code-wrapper{position:relative;display:flex;flex-direction:row;flex-wrap:wrap;width:100%;}.scraped-example:not(.expanded) .code-wrapper{max-height:240px;}.scraped-example:not(.expanded) .code-wrapper pre{overflow-y:hidden;max-height:240px;padding-bottom:0;}.scraped-example:not(.expanded) .code-wrapper pre.line-numbers{overflow-x:hidden;}.scraped-example .code-wrapper .prev{position:absolute;top:0.25em;right:2.25em;z-index:100;cursor:pointer;}.scraped-example .code-wrapper .next{position:absolute;top:0.25em;right:1.25em;z-index:100;cursor:pointer;}.scraped-example .code-wrapper .expand{position:absolute;top:0.25em;right:0.25em;z-index:100;cursor:pointer;}.scraped-example:not(.expanded) .code-wrapper:before{content:" ";width:100%;height:5px;position:absolute;z-index:100;top:0;}.scraped-example:not(.expanded) .code-wrapper:after{content:" ";width:100%;height:5px;position:absolute;z-index:100;bottom:0;}.scraped-example .code-wrapper .line-numbers{margin:0;padding:14px 0;}.scraped-example .code-wrapper .line-numbers span{padding:0 14px;}.scraped-example .code-wrapper .example-wrap{flex:1;overflow-x:auto;overflow-y:hidden;margin-bottom:0;}.scraped-example:not(.expanded) .code-wrapper .example-wrap{overflow-x:hidden;}.scraped-example .code-wrapper .example-wrap pre.rust{overflow-x:inherit;width:inherit;overflow-y:hidden;}.more-examples-toggle{max-width:calc(100% + 25px);margin-top:10px;margin-left:-25px;}.more-examples-toggle .hide-more{margin-left:25px;margin-bottom:5px;cursor:pointer;}.more-examples-toggle summary,.more-examples-toggle .hide-more{font-family:'Fira Sans';}.more-scraped-examples{margin-left:5px;display:flex;flex-direction:row;}.more-scraped-examples-inner{width:calc(100% - 20px);}.toggle-line{align-self:stretch;margin-right:10px;margin-top:5px;padding:0 4px;cursor:pointer;}.toggle-line-inner{min-width:2px;height:100%;}.more-scraped-examples .scraped-example{margin-bottom:20px;}.more-scraped-examples .scraped-example:last-child{margin-bottom:0;}.example-links a{margin-top:20px;font-family:'Fira Sans';}.example-links ul{margin-bottom:0;} \ No newline at end of file + @font-face {font-family:'Fira Sans';font-style:normal;font-weight:400;src:local('Fira Sans'),url("FiraSans-Regular.woff2") format("woff2");font-display:swap;}@font-face {font-family:'Fira Sans';font-style:normal;font-weight:500;src:local('Fira Sans Medium'),url("FiraSans-Medium.woff2") format("woff2");font-display:swap;}@font-face {font-family:'Source Serif 4';font-style:normal;font-weight:400;src:local('Source Serif 4'),url("SourceSerif4-Regular.ttf.woff2") format("woff2");font-display:swap;}@font-face {font-family:'Source Serif 4';font-style:italic;font-weight:400;src:local('Source Serif 4 Italic'),url("SourceSerif4-It.ttf.woff2") format("woff2");font-display:swap;}@font-face {font-family:'Source Serif 4';font-style:normal;font-weight:700;src:local('Source Serif 4 Bold'),url("SourceSerif4-Bold.ttf.woff2") format("woff2");font-display:swap;}@font-face {font-family:'Source Code Pro';font-style:normal;font-weight:400;src:url("SourceCodePro-Regular.ttf.woff2") format("woff2");font-display:swap;}@font-face {font-family:'Source Code Pro';font-style:italic;font-weight:400;src:url("SourceCodePro-It.ttf.woff2") format("woff2");font-display:swap;}@font-face {font-family:'Source Code Pro';font-style:normal;font-weight:600;src:url("SourceCodePro-Semibold.ttf.woff2") format("woff2");font-display:swap;}@font-face {font-family:'NanumBarunGothic';src:url("NanumBarunGothic.ttf.woff2") format("woff2");font-display:swap;unicode-range:U+AC00-D7AF,U+1100-11FF,U+3130-318F,U+A960-A97F,U+D7B0-D7FF;}*{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;}html{content:"";}@media (prefers-color-scheme:light){html{content:"light";}}@media (prefers-color-scheme:dark){html{content:"dark";}}body{font:1rem/1.5 "Source Serif 4",NanumBarunGothic,serif;margin:0;position:relative;overflow-wrap:break-word;overflow-wrap:anywhere;-webkit-font-feature-settings:"kern","liga";-moz-font-feature-settings:"kern","liga";font-feature-settings:"kern","liga";background-color:var(--main-background-color);color:var(--main-color);}h1{font-size:1.5rem;}h2{font-size:1.375rem;}h3{font-size:1.25rem;}h1,h2,h3,h4,h5,h6{font-weight:500;}h1,h2,h3,h4{margin:20px 0 15px 0;padding-bottom:6px;}.docblock h3,.docblock h4,h5,h6{margin:15px 0 5px 0;}h1.fqn{margin:0;padding:0;border-bottom-color:var(--headings-border-bottom-color);}h2,h3,h4{border-bottom-color:var(--headings-border-bottom-color);}.main-heading{display:flex;flex-wrap:wrap;justify-content:space-between;padding-bottom:6px;margin-bottom:15px;}.main-heading a:hover{text-decoration:underline;}#toggle-all-docs{text-decoration:none;}h2,.top-doc .docblock>h3,.top-doc .docblock>h4{border-bottom:1px solid var(--headings-border-bottom-color);}h3.code-header{font-size:1.125rem;}h4.code-header{font-size:1rem;}.code-header{font-weight:600;border-bottom-style:none;margin:0;padding:0;margin-top:0.6em;margin-bottom:0.4em;}.impl,.impl-items .method,.methods .method,.impl-items .type,.methods .type,.impl-items .associatedconstant,.methods .associatedconstant,.impl-items .associatedtype,.methods .associatedtype{flex-basis:100%;font-weight:600;position:relative;}h1,h2,h3,h4,h5,h6,.sidebar,.mobile-topbar,a.source,.search-input,.search-results .result-name,.item-left>a,.out-of-band,span.since,details.rustdoc-toggle>summary::before,.content ul.crate a.crate,a.srclink,#help-button>button,details.rustdoc-toggle.top-doc>summary,details.rustdoc-toggle.top-doc>summary::before,details.rustdoc-toggle.non-exhaustive>summary,details.rustdoc-toggle.non-exhaustive>summary::before,.scraped-example-title,.more-examples-toggle summary,.more-examples-toggle .hide-more,.example-links a,#main-content>ul.docblock>li>a{font-family:"Fira Sans",Arial,NanumBarunGothic,sans-serif;}a#toggle-all-docs,a.anchor,.small-section-header a,#source-sidebar a,pre.rust a,.sidebar h2 a,.sidebar h3 a,.mobile-topbar h2 a,.in-band a,.search-results a,.module-item .stab,.import-item .stab,.result-name .primitive>i,.result-name .keyword>i,.content .method .where,.content .fn .where,.content .where.fmt-newline{color:var(--main-color);}.content span.enum,.content a.enum,.content span.struct,.content a.struct,.content span.union,.content a.union,.content span.primitive,.content a.primitive,.content span.type,.content a.type,.content span.foreigntype,.content a.foreigntype{color:var(--type-link-color);}.content span.trait,.content a.trait,.content span.traitalias,.content a.traitalias{color:var(--trait-link-color);}.content span.associatedtype,.content a.associatedtype,.content span.constant,.content a.constant,.content span.static,.content a.static{color:var(--assoc-item-link-color);}.content span.fn,.content a.fn,.content .fnname,.content span.method,.content a.method,.content span.tymethod,.content a.tymethod{color:var(--function-link-color);}.content span.attr,.content a.attr,.content span.derive,.content a.derive,.content span.macro,.content a.macro{color:var(--macro-link-color);}.content span.mod,.content a.mod,.block a.current.mod{color:var(--mod-link-color);}.content span.keyword,.content a.keyword{color:var(--keyword-link-color);}a{color:var(--link-color);}ol,ul{padding-left:24px;}ul ul,ol ul,ul ol,ol ol{margin-bottom:.625em;}p{margin:0 0 .75em 0;}summary{outline:none;}td,th{padding:0;}table{border-collapse:collapse;}button,input,optgroup,select,textarea{color:inherit;font:inherit;margin:0;}button{padding:1px 6px;}.rustdoc{display:flex;flex-direction:row;flex-wrap:nowrap;}main{position:relative;flex-grow:1;padding:10px 15px 40px 45px;min-width:0;}.source main{padding:15px;}.width-limiter{max-width:960px;margin-right:auto;}.source .width-limiter{max-width:unset;}details:not(.rustdoc-toggle) summary{margin-bottom:.6em;}code,pre,a.test-arrow,.code-header{font-family:"Source Code Pro",monospace;}.docblock code,.docblock-short code{border-radius:3px;padding:0 0.125em;}.docblock pre code,.docblock-short pre code{padding:0;}pre{padding:14px;}.docblock.item-decl{margin-left:0;}.item-decl pre{overflow-x:auto;}.source .content pre{padding:20px;}img{max-width:100%;}.source .content{overflow:visible;}.sub-container{display:flex;flex-direction:row;flex-wrap:nowrap;}.sub-logo-container{display:none;margin-right:20px;}.source .sub-logo-container{display:block;}.source .sub-logo-container>img{height:60px;width:60px;object-fit:contain;}.sidebar,.mobile-topbar,.sidebar-menu-toggle{background-color:var(--sidebar-background-color);}.sidebar{font-size:0.875rem;width:250px;min-width:200px;overflow-y:scroll;position:sticky;height:100vh;top:0;left:0;}.sidebar-elems,.sidebar>.location{padding-left:24px;}.sidebar .location{overflow-wrap:anywhere;}.rustdoc.source .sidebar{width:50px;min-width:0px;max-width:300px;flex-grow:0;flex-shrink:0;flex-basis:auto;border-right:1px solid;overflow-x:hidden;overflow-y:hidden;}.rustdoc.source .sidebar .sidebar-logo{display:none;}.source .sidebar,#sidebar-toggle,#source-sidebar{background-color:var(--sidebar-background-color);}#sidebar-toggle>button:hover,#sidebar-toggle>button:focus{background-color:var(--sidebar-background-color-hover);}.source .sidebar>*:not(#sidebar-toggle){opacity:0;visibility:hidden;}.source-sidebar-expanded .source .sidebar{overflow-y:auto;}.source-sidebar-expanded .source .sidebar>*:not(#sidebar-toggle){opacity:1;visibility:visible;}#all-types{margin-top:1em;}*{scrollbar-width:initial;scrollbar-color:var(--scrollbar-color);}.sidebar{scrollbar-width:thin;scrollbar-color:var(--scrollbar-color);}::-webkit-scrollbar{width:12px;}.sidebar::-webkit-scrollbar{width:8px;}::-webkit-scrollbar-track{-webkit-box-shadow:inset 0;background-color:var(--scrollbar-track-background-color);}.sidebar::-webkit-scrollbar-track{background-color:var(--scrollbar-track-background-color);}::-webkit-scrollbar-thumb,.sidebar::-webkit-scrollbar-thumb{background-color:var(--scrollbar-thumb-background-color);}.hidden{display:none !important;}.sidebar .logo-container{display:flex;margin-top:10px;margin-bottom:10px;justify-content:center;}.version{overflow-wrap:break-word;}.logo-container>img{height:100px;width:100px;}.location:empty{border:none;}.location a:first-of-type{font-weight:500;}.block ul,.block li{padding:0;margin:0;list-style:none;}.block a,h2.location a{display:block;padding:0.25rem;margin-left:-0.25rem;text-overflow:ellipsis;overflow:hidden;}.sidebar h2{border-bottom:none;font-weight:500;padding:0;margin:0;margin-top:0.7rem;margin-bottom:0.7rem;}.sidebar h3{font-size:1.125rem;font-weight:500;padding:0;margin:0;}.sidebar-elems .block{margin-bottom:2em;}.sidebar-elems .block li a{white-space:nowrap;}.mobile-topbar{display:none;}.source .content pre.rust{white-space:pre;overflow:auto;padding-left:0;}.rustdoc .example-wrap{display:inline-flex;margin-bottom:10px;}.example-wrap{position:relative;width:100%;}.example-wrap>pre.line-number{overflow:initial;border:1px solid;padding:13px 8px;text-align:right;border-top-left-radius:5px;border-bottom-left-radius:5px;}.example-wrap>pre.rust a:hover{text-decoration:underline;}.line-numbers{text-align:right;}.rustdoc:not(.source) .example-wrap>pre:not(.line-number){width:100%;overflow-x:auto;}.rustdoc:not(.source) .example-wrap>pre.line-numbers{width:auto;overflow-x:visible;}.rustdoc .example-wrap>pre{margin:0;}.search-loading{text-align:center;}.content>.example-wrap pre.line-numbers{position:relative;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;}.line-numbers span{cursor:pointer;}.docblock-short{overflow-wrap:break-word;overflow-wrap:anywhere;overflow:hidden;text-overflow:ellipsis;}.docblock>:not(pre)>code,.docblock-short>code{white-space:pre-wrap;}.top-doc .docblock h2{font-size:1.375rem;}.top-doc .docblock h3{font-size:1.25rem;}.top-doc .docblock h4,.top-doc .docblock h5{font-size:1.125rem;}.top-doc .docblock h6{font-size:1rem;}.docblock h5{font-size:1rem;}.docblock h6{font-size:0.875rem;}.docblock h1,.docblock h2,.docblock h3,.docblock h4,.docblock h5,.docblock h6{border-bottom-color:var(--headings-border-bottom-color);}.docblock{margin-left:24px;position:relative;}.docblock>:not(.more-examples-toggle):not(.example-wrap){max-width:100%;overflow-x:auto;}.content .out-of-band{flex-grow:0;font-size:1.125rem;font-weight:normal;float:right;}.method>.code-header,.trait-impl>.code-header{max-width:calc(100% - 41px);display:block;}.content .in-band{flex-grow:1;margin:0px;padding:0px;overflow-wrap:break-word;overflow-wrap:anywhere;background-color:var(--main-background-color);}.in-band>code,.in-band>.code-header{display:inline-block;}.docblock code,.docblock-short code,pre,.rustdoc.source .example-wrap{background-color:var(--code-block-background-color);}#main-content{position:relative;}.docblock table{margin:.5em 0;width:calc(100% - 2px);overflow-x:auto;display:block;}.docblock table td{padding:.5em;border:1px dashed var(--border-color);vertical-align:top;}.docblock table th{padding:.5em;text-align:left;border:1px solid var(--border-color);}.content .item-list{list-style-type:none;padding:0;}.content>.methods>.method{font-size:1rem;position:relative;}.content .method .where,.content .fn .where,.content .where.fmt-newline{display:block;font-size:0.875rem;}.item-info{display:block;}.content .item-info code{font-size:0.875rem;}.content .item-info{position:relative;margin-left:24px;}.content .impl-items .docblock,.content .impl-items .item-info{margin-bottom:.6em;}#main-content>.item-info{margin-top:0;margin-left:0;}nav.sub{position:relative;font-size:1rem;flex-grow:1;margin-bottom:25px;}.source nav.sub{margin-left:32px;}nav.sum{text-align:right;}nav.sub form{display:inline;}a{text-decoration:none;}.small-section-header{display:flex;justify-content:space-between;position:relative;}.small-section-header:hover>.anchor{display:initial;}.in-band:hover>.anchor,.impl:hover>.anchor,.method.trait-impl:hover>.anchor,.type.trait-impl:hover>.anchor,.associatedconstant.trait-impl:hover>.anchor,.associatedtype.trait-impl:hover>.anchor{display:inline-block;position:absolute;}.anchor{display:none;position:absolute;left:-0.5em;background:none !important;}.anchor.field{left:-5px;}.small-section-header>.anchor{left:-15px;padding-right:8px;}h2.small-section-header>.anchor{padding-right:6px;}.anchor::before{content:'§';}.docblock a:not(.srclink):not(.test-arrow):not(.scrape-help):hover,.docblock-short a:not(.srclink):not(.test-arrow):not(.scrape-help):hover,.item-info a{text-decoration:underline;}.block a.current.crate{font-weight:500;}table,.item-table{overflow-wrap:break-word;}.item-table{display:table;}.item-row{display:table-row;}.item-left,.item-right{display:table-cell;}.item-left{padding-right:1.25rem;}.search-container{position:relative;display:flex;height:34px;margin-top:4px;}.search-container>*{height:100%;}.search-results-title{margin-top:0;white-space:nowrap;display:inline-flex;max-width:100%;align-items:baseline;}#crate-search-div{display:inline-block;position:relative;min-width:5em;}#crate-search{min-width:115px;padding:0;padding-left:4px;padding-right:23px;max-width:100%;text-overflow:ellipsis;border:1px solid var(--border-color);border-radius:4px;outline:none;cursor:pointer;-moz-appearance:none;-webkit-appearance:none;text-indent:0.01px;background-color:var(--main-background-color);}@-moz-document url-prefix(){#crate-search{padding-left:0px;padding-right:19px;}}#crate-search-div::after{pointer-events:none;width:100%;height:100%;position:absolute;top:0;left:0;content:"";background-repeat:no-repeat;background-size:20px;background-position:calc(100% - 2px) 56%;background-image:url("down-arrow.svg");}#crate-search>option{font-size:1rem;}.search-input{-webkit-appearance:none;-moz-box-sizing:border-box !important;box-sizing:border-box !important;outline:none;border:1px solid var(--border-color);border-radius:2px;padding:8px;font-size:1rem;width:100%;background-color:var(--button-background-color);}.search-input:focus{border-color:var(--search-input-focused-border-color);}.search-results{display:none;padding-bottom:2em;}.search-results.active{display:block;clear:both;}.search-results .desc>span{white-space:nowrap;text-overflow:ellipsis;overflow:hidden;display:block;}.search-results>a{display:block;margin-left:2px;margin-right:2px;border-bottom:1px solid #aaa3;}.search-results>a>div{display:flex;flex-flow:row wrap;}.search-results .result-name,.search-results div.desc,.search-results .result-description{width:50%;}.search-results .result-name{padding-right:1em;}.popover{font-size:1rem;position:absolute;right:0;z-index:2;display:block;margin-top:7px;border-radius:3px;border:1px solid var(--border-color);font-size:1rem;}.popover::before{content:'';position:absolute;right:11px;border:solid var(--border-color);border-width:1px 1px 0 0;display:inline-block;padding:4px;transform:rotate(-45deg);top:-5px;}.popover,.popover::before{background-color:var(--main-background-color);color:var(--main-color);}#help-button .popover{max-width:600px;}#help-button .popover::before{right:48px;}#help-button dt{float:left;clear:left;display:block;margin-right:0.5rem;}#help-button span.top,#help-button span.bottom{text-align:center;display:block;font-size:1.125rem;}#help-button span.top{text-align:center;display:block;margin:10px 0;border-bottom:1px solid var(--border-color);padding-bottom:4px;margin-bottom:6px;}#help-button span.bottom{clear:both;border-top:1px solid var(--border-color);}.side-by-side{text-align:initial;}.side-by-side>div{width:50%;float:left;padding:0 20px 20px 17px;}.item-info .stab{width:fit-content;min-height:36px;display:flex;align-items:center;white-space:pre-wrap;}.stab{padding:3px;margin-bottom:5px;font-size:0.875rem;font-weight:normal;}.stab p{display:inline;margin:0;}.stab .emoji{font-size:1.25rem;margin-right:0.3rem;}.emoji{text-shadow:1px 0 0 black,-1px 0 0 black,0 1px 0 black,0 -1px 0 black;}.module-item .stab,.import-item .stab{border-radius:3px;display:inline-block;font-size:0.875rem;line-height:1.2;margin-bottom:0;margin-left:0.3125em;padding:2px;vertical-align:text-bottom;}.module-item.unstable,.import-item.unstable{opacity:0.65;}.since{font-weight:normal;font-size:initial;}.rightside{padding-left:12px;padding-right:2px;position:initial;float:right;}.rightside:not(a),.out-of-band{color:var(--right-side-color);}.impl-items .srclink,.impl .srclink,.methods .srclink{font-weight:normal;font-size:1rem;}td.summary-column{width:100%;}.summary{padding-right:0px;}pre.rust .question-mark{font-weight:bold;}.example-wrap.compile_fail,.example-wrap.should_panic{border-left:2px solid var(--codeblock-error-color);}.ignore.example-wrap{border-left:2px solid var(--codeblock-ignore-color);}.example-wrap.compile_fail:hover,.example-wrap.should_panic:hover{border-left:2px solid var(--codeblock-error-hover-color);}.example-wrap.ignore:hover{border-left:2px solid var(--codeblock-ignore-hover-color);}.example-wrap.compile_fail .tooltip,.example-wrap.should_panic .tooltip{color:var(--codeblock-error-color);}.example-wrap.ignore .tooltip{color:var(--codeblock-ignore-color);}.example-wrap.compile_fail:hover .tooltip,.example-wrap.should_panic:hover .tooltip{color:var(--codeblock-error-hover-color);}.example-wrap.ignore:hover .tooltip{color:var(--codeblock-ignore-hover-color);}.example-wrap .tooltip{position:absolute;display:block;cursor:pointer;left:-25px;top:5px;}.example-wrap .tooltip::after{display:none;text-align:center;padding:5px 3px 3px 3px;border-radius:6px;margin-left:5px;font-size:1rem;border:1px solid var(--border-color);position:absolute;width:max-content;top:-2px;z-index:1;}.example-wrap .tooltip::before{content:" ";position:absolute;top:50%;left:16px;margin-top:-5px;border-width:5px;border-style:solid;display:none;z-index:1;}.example-wrap.ignore .tooltip::after{content:"This example is not tested";}.example-wrap.compile_fail .tooltip::after{content:"This example deliberately fails to compile";}.example-wrap.should_panic .tooltip::after{content:"This example panics";}.example-wrap.edition .tooltip::after{content:"This code runs with edition " attr(data-edition);}.example-wrap .tooltip:hover::before,.example-wrap .tooltip:hover::after{display:inline;}.example-wrap.compile_fail .tooltip,.example-wrap.should_panic .tooltip,.example-wrap.ignore .tooltip{font-weight:bold;font-size:1.25rem;}a.test-arrow{display:inline-block;visibility:hidden;position:absolute;padding:5px 10px 5px 10px;border-radius:5px;font-size:1.375rem;top:5px;right:5px;z-index:1;}.example-wrap:hover .test-arrow{visibility:visible;}a.test-arrow:hover{text-decoration:none;}.code-attribute{font-weight:300;color:var(--code-attribute-color);}.item-spacer{width:100%;height:12px;}.out-of-band>span.since{font-size:1.25rem;}h3.variant{font-weight:600;font-size:1.125rem;margin-bottom:10px;border-bottom:none;}.sub-variant h4{font-size:1rem;font-weight:400;border-bottom:none;margin-top:0;margin-bottom:0;}.sub-variant{margin-left:24px;margin-bottom:40px;}.sub-variant>.sub-variant-field{margin-left:24px;}:target>code,:target>.code-header{opacity:1;}:target{padding-right:3px;}.notable-traits-tooltip{display:inline-block;cursor:pointer;}.notable-traits:hover .notable-traits-tooltiptext,.notable-traits .notable-traits-tooltiptext.force-tooltip{display:inline-block;}.notable-traits .notable-traits-tooltiptext{display:none;padding:5px 3px 3px 3px;border-radius:6px;margin-left:5px;z-index:10;font-size:1rem;cursor:default;position:absolute;border:1px solid;}.notable-traits-tooltip::after{content:"\00a0\00a0\00a0";}.notable-traits .notable,.notable-traits .docblock{margin:0;}.notable-traits .notable{margin:0;margin-bottom:13px;font-size:1.1875rem;font-weight:600;display:block;}.notable-traits .docblock code.content{margin:0;padding:0;font-size:1.25rem;}pre.rust.rust-example-rendered{position:relative;}pre.rust{tab-size:4;-moz-tab-size:4;}.search-failed{text-align:center;margin-top:20px;display:none;}.search-failed.active{display:block;}.search-failed>ul{text-align:left;max-width:570px;margin-left:auto;margin-right:auto;}#titles{display:flex;flex-direction:row;gap:1px;margin-bottom:4px;}#titles>button{text-align:center;font-size:1.125rem;cursor:pointer;border:0;border-top:2px solid;flex:1;}#titles>button>div.count{display:inline-block;font-size:1rem;}.notable-traits{cursor:pointer;z-index:2;margin-left:5px;}#sidebar-toggle{position:sticky;top:0;left:0;font-weight:bold;font-size:1.25rem;border-bottom:1px solid;display:flex;height:40px;justify-content:center;align-items:center;z-index:10;}#source-sidebar{width:100%;z-index:1;overflow:auto;}#source-sidebar>.title{font-size:1.5rem;text-align:center;border-bottom:1px solid var(--border-color);margin-bottom:6px;}#sidebar-toggle>button{background:none;color:inherit;cursor:pointer;text-align:center;border:none;outline:none;position:absolute;top:0;bottom:0;left:0;right:0;width:100%;-webkit-appearance:none;opacity:1;}#settings-menu,#help-button{margin-left:4px;outline:none;}#settings-menu>a,#help-button>button,#copy-path{padding:5px;width:33px;border:1px solid var(--border-color);border-radius:2px;cursor:pointer;}#settings-menu>a,#help-button>button{padding:5px;height:100%;display:block;background-color:var(--button-background-color);}#copy-path{color:var(--copy-path-button-color);}#copy-path>img{filter:var(--copy-path-img-filter);}#copy-path:hover>img{filter:var(--copy-path-img-hover-filter);}@keyframes rotating{from{transform:rotate(0deg);}to{transform:rotate(360deg);}}#settings-menu.rotate>a img{animation:rotating 2s linear infinite;}.setting-line .radio-line input:checked{box-shadow:inset 0 0 0 3px var(--main-background-color);background-color:var(--settings-input-color);}.setting-line .radio-line input:focus{box-shadow:0 0 1px 1px var(--settings-input-color);}.setting-line .radio-line input:checked:focus{box-shadow:inset 0 0 0 3px var(--main-background-color),0 0 2px 2px var(--settings-input-color);}.setting-line .radio-line input:hover{border-color:var(--settings-input-color) !important;}input:checked+.slider{background-color:var(--settings-input-color);}#help-button>button{text-align:center;font-size:20px;padding-top:2px;}#copy-path{height:34px;background-color:var(--main-background-color);margin-left:10px;padding:0;padding-left:2px;border:0;}kbd{display:inline-block;padding:3px 5px;font:15px monospace;line-height:10px;vertical-align:middle;border:solid 1px var(--border-color);border-radius:3px;cursor:default;}#main-content>ul{padding-left:10px;}#main-content>ul>li{list-style:none;}.non-exhaustive{margin-bottom:1em;}details.dir-entry{padding-left:4px;}details.dir-entry>summary{margin:0 0 0 13px;list-style-position:outside;cursor:pointer;}details.dir-entry div.folders,details.dir-entry div.files{padding-left:23px;}details.dir-entry a{display:block;}details.rustdoc-toggle>summary.hideme{cursor:pointer;}details.rustdoc-toggle>summary{list-style:none;}details.rustdoc-toggle>summary::-webkit-details-marker,details.rustdoc-toggle>summary::marker{display:none;}details.rustdoc-toggle>summary.hideme>span{margin-left:9px;}details.rustdoc-toggle>summary::before{content:"";cursor:pointer;width:16px;height:16px;background-repeat:no-repeat;background-position:top left;display:inline-block;vertical-align:middle;opacity:.5;}details.rustdoc-toggle>summary.hideme>span,details.rustdoc-toggle>summary::before,.more-examples-toggle summary,.more-examples-toggle .hide-more{color:var(--toggles-color);}details.rustdoc-toggle>summary::after{content:"Expand";overflow:hidden;width:0;height:0;position:absolute;}details.rustdoc-toggle>summary.hideme::after{content:"";}details.rustdoc-toggle>summary:focus::before,details.rustdoc-toggle>summary:hover::before{opacity:1;}details.rustdoc-toggle.top-doc>summary,details.rustdoc-toggle.top-doc>summary::before,details.rustdoc-toggle.non-exhaustive>summary,details.rustdoc-toggle.non-exhaustive>summary::before{font-size:1rem;}details.non-exhaustive{margin-bottom:8px;}details.rustdoc-toggle>summary.hideme::before{position:relative;}details.rustdoc-toggle>summary:not(.hideme)::before{position:absolute;left:-24px;top:4px;}.impl-items>details.rustdoc-toggle>summary:not(.hideme)::before{position:absolute;left:-24px;}details.rustdoc-toggle[open] >summary.hideme{position:absolute;}details.rustdoc-toggle{position:relative;}details.rustdoc-toggle[open] >summary.hideme>span{display:none;}details.rustdoc-toggle[open] >summary::before,details.rustdoc-toggle[open] >summary.hideme::before{background-image:url("toggle-minus.svg");}details.rustdoc-toggle>summary::before{background-image:url("toggle-plus.svg");}details.rustdoc-toggle[open] >summary::before,details.rustdoc-toggle[open] >summary.hideme::before{width:16px;height:16px;background-repeat:no-repeat;background-position:top left;display:inline-block;content:"";}details.rustdoc-toggle[open] >summary::after,details.rustdoc-toggle[open] >summary.hideme::after{content:"Collapse";}.docblock summary>*{display:inline-block;}@media (min-width:701px){.docblock>.example-wrap:first-child .tooltip{margin-top:16px;}.source-sidebar-expanded .source .sidebar+main .width-limiter .sub-logo-container.rust-logo{display:none;}.source-sidebar-expanded .source .sidebar{width:300px;}}@media (max-width:700px){*[id]{scroll-margin-top:45px;}.rustdoc{padding-top:0px;display:block;}main{padding-left:15px;padding-top:0px;}.main-heading{flex-direction:column;}.content .out-of-band{text-align:left;margin-left:initial;padding:initial;}.content .out-of-band .since::before{content:"Since ";}#copy-path{display:none;}.sidebar .sidebar-logo,.sidebar .location{display:none;}.sidebar{position:fixed;top:45px;left:-1000px;margin-left:0;margin:0;padding:0;z-index:11;height:calc(100vh - 45px);}.source main,.rustdoc.source .sidebar{top:0;padding:0;height:100vh;border:0;}.sidebar.shown,.source-sidebar-expanded .source .sidebar,.sidebar:focus-within{left:0;}.rustdoc.source>.sidebar{position:fixed;margin:0;z-index:11;width:0;}.mobile-topbar .location a{padding:0;margin:0;}.mobile-topbar .location{border:none;padding:0;margin:auto 0.5em auto auto;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;font-size:24px;}.mobile-topbar .logo-container{max-height:45px;}.mobile-topbar .logo-container>img{max-width:35px;max-height:35px;margin-left:20px;margin-top:5px;margin-bottom:5px;}.mobile-topbar{display:flex;flex-direction:row;position:sticky;z-index:10;font-size:2rem;height:45px;width:100%;left:0;top:0;}.source .mobile-topbar{display:none;}.sidebar-menu-toggle{width:45px;font-size:32px;border:none;}.sidebar-elems{margin-top:1em;background-color:var(--sidebar-background-color);}.content{margin-left:0px;}.source .content{margin-top:10px;}.anchor{display:none !important;}#titles>button>div.count{display:block;}#sidebar-filler{position:fixed;left:45px;width:calc(100% - 45px);top:0;height:45px;z-index:-1;border-bottom:1px solid;}#main-content>details.rustdoc-toggle>summary::before,#main-content>div>details.rustdoc-toggle>summary::before{left:-11px;}#sidebar-toggle{position:fixed;left:1px;top:100px;width:30px;font-size:1.5rem;text-align:center;padding:0;z-index:10;border-top-right-radius:3px;border-bottom-right-radius:3px;cursor:pointer;font-weight:bold;border:1px solid;border-left:0;}.source-sidebar-expanded #sidebar-toggle{left:unset;top:unset;width:unset;border-top-right-radius:unset;border-bottom-right-radius:unset;position:sticky;border:0;border-bottom:1px solid;}#source-sidebar{z-index:11;}#main-content>.line-numbers{margin-top:0;}.notable-traits .notable-traits-tooltiptext{left:0;top:100%;}#help-button{display:none;}.item-table{display:block;}.item-row{display:flex;flex-flow:column wrap;}.item-left,.item-right{width:100%;}.search-results>a{border-bottom:1px solid #aaa9;padding:5px 0px;}.search-results .result-name,.search-results div.desc,.search-results .result-description{width:100%;}.search-results div.desc,.search-results .result-description,.item-right{padding-left:2em;}.source-sidebar-expanded .source .sidebar{max-width:100vw;width:100vw;}details.rustdoc-toggle:not(.top-doc)>summary{margin-left:10px;}.impl-items>details.rustdoc-toggle>summary:not(.hideme)::before,#main-content>details.rustdoc-toggle:not(.top-doc)>summary::before,#main-content>div>details.rustdoc-toggle>summary::before{left:-11px;}.content .impl-items>.item-info{margin-left:34px;}}@media print{nav.sidebar,nav.sub,.content .out-of-band,a.srclink,#copy-path,details.rustdoc-toggle[open] >summary::before,details.rustdoc-toggle>summary::before,details.rustdoc-toggle.top-doc>summary{display:none;}.docblock{margin-left:0;}main{padding:10px;}}@media (max-width:464px){#crate-search{border-radius:4px;}.docblock{margin-left:12px;}.docblock code{overflow-wrap:break-word;overflow-wrap:anywhere;}.sub-container{flex-direction:column;}.sub-logo-container{align-self:center;}.source .sub-logo-container>img{height:35px;width:35px;}#sidebar-toggle{top:10px;}.source-sidebar-expanded #sidebar-toggle{top:unset;}}.method-toggle summary,.implementors-toggle summary,.impl{margin-bottom:0.75em;}.method-toggle[open]{margin-bottom:2em;}.implementors-toggle[open]{margin-bottom:2em;}#trait-implementations-list .method-toggle,#synthetic-implementations-list .method-toggle,#blanket-implementations-list .method-toggle{margin-bottom:1em;}.scraped-example-list .scrape-help{margin-left:10px;padding:0 4px;font-weight:normal;font-size:12px;position:relative;bottom:1px;background:transparent;border-width:1px;border-style:solid;border-radius:50px;}.scraped-example .code-wrapper{position:relative;display:flex;flex-direction:row;flex-wrap:wrap;width:100%;}.scraped-example:not(.expanded) .code-wrapper{max-height:240px;}.scraped-example:not(.expanded) .code-wrapper pre{overflow-y:hidden;max-height:240px;padding-bottom:0;}.scraped-example:not(.expanded) .code-wrapper pre.line-numbers{overflow-x:hidden;}.scraped-example .code-wrapper .prev{position:absolute;top:0.25em;right:2.25em;z-index:100;cursor:pointer;}.scraped-example .code-wrapper .next{position:absolute;top:0.25em;right:1.25em;z-index:100;cursor:pointer;}.scraped-example .code-wrapper .expand{position:absolute;top:0.25em;right:0.25em;z-index:100;cursor:pointer;}.scraped-example:not(.expanded) .code-wrapper:before{content:" ";width:100%;height:5px;position:absolute;z-index:100;top:0;}.scraped-example:not(.expanded) .code-wrapper:after{content:" ";width:100%;height:5px;position:absolute;z-index:100;bottom:0;}.scraped-example .code-wrapper .line-numbers{margin:0;padding:14px 0;}.scraped-example .code-wrapper .line-numbers span{padding:0 14px;}.scraped-example .code-wrapper .example-wrap{flex:1;overflow-x:auto;overflow-y:hidden;margin-bottom:0;}.scraped-example:not(.expanded) .code-wrapper .example-wrap{overflow-x:hidden;}.scraped-example .code-wrapper .example-wrap pre.rust{overflow-x:inherit;width:inherit;overflow-y:hidden;}.more-examples-toggle{max-width:calc(100% + 25px);margin-top:10px;margin-left:-25px;}.more-examples-toggle .hide-more{margin-left:25px;margin-bottom:5px;cursor:pointer;}.more-scraped-examples{margin-left:5px;display:flex;flex-direction:row;}.more-scraped-examples-inner{width:calc(100% - 20px);}.toggle-line{align-self:stretch;margin-right:10px;margin-top:5px;padding:0 4px;cursor:pointer;}.toggle-line-inner{min-width:2px;height:100%;}.more-scraped-examples .scraped-example{margin-bottom:20px;}.more-scraped-examples .scraped-example:last-child{margin-bottom:0;}.example-links a{margin-top:20px;}.example-links ul{margin-bottom:0;} \ No newline at end of file diff --git a/search-index.js b/search-index.js index 68230ca..fd67f0c 100644 --- a/search-index.js +++ b/search-index.js @@ -1,5 +1,5 @@ var searchIndex = JSON.parse('{\ -"llvm_kaleidoscope_rs":{"doc":"","t":[13,13,4,17,3,11,11,11,11,11,0,11,11,11,11,11,11,0,0,11,11,0,11,11,11,11,11,11,11,12,12,3,11,11,11,11,11,11,11,11,13,13,13,13,13,13,13,13,13,3,13,13,4,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,12,12,12,3,3,3,3,3,3,3,3,3,3,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,5,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,5,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,12,12,12,12,13,13,4,13,3,13,13,3,3,13,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12],"n":["A","B","Either","SMALL_STR_SIZE","SmallCStr","as_ptr","borrow","borrow","borrow_mut","borrow_mut","codegen","eq","fmt","from","from","into","into","lexer","llvm","ne","new","parser","try_from","try_from","try_from","try_into","try_into","type_id","type_id","0","0","Codegen","borrow","borrow_mut","compile","from","into","try_from","try_into","type_id","Char","Def","Else","Eof","Extern","For","Identifier","If","In","Lexer","Number","Then","Token","borrow","borrow","borrow_mut","borrow_mut","eq","fmt","from","from","gettok","into","into","ne","new","try_from","try_from","try_into","try_into","type_id","type_id","0","0","0","BasicBlock","FnValue","FunctionPassManager","IRBuilder","LLJit","Module","PhiValue","ResourceTracker","Type","Value","add_fn","add_incoming","add_module","append_basic_block","append_basic_block","arg","args","basic_blocks","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","br","call","clone","clone","clone","clone","clone","clone_into","clone_into","clone_into","clone_into","clone_into","cond_br","const_f64","create_basic_block","deref","deref","drop","drop","drop","drop","dump","dump","dump","enable_process_symbols","fadd","fcmpone","fcmpult","find_symbol","fmul","from","from","from","from","from","from","from","from","from","from","fsub","get_fn","get_insert_block","get_name","get_parent","initialize_native_taget","into","into","into","into","into","into","into","into","into","into","is_f64","is_int","new","new","phi","pos_at_end","ret","ret_type","run","set_name","shutdown","to_owned","to_owned","to_owned","to_owned","to_owned","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","type_f64","type_fn","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_of","uitofp","verify","with_ctx","with_ctx","0","0","1","1","Binary","Call","ExprAST","For","FunctionAST","If","Number","Parser","PrototypeAST","Variable","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","clone","clone_into","cur_tok","eq","eq","eq","fmt","fmt","fmt","from","from","from","from","get_next_token","into","into","into","into","ne","ne","ne","new","parse_definition","parse_extern","parse_top_level_expr","to_owned","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","0","0","0","0","1","1","2","body","cond","else_","end","start","step","then","var"],"q":["llvm_kaleidoscope_rs","","","","","","","","","","","","","","","","","","","","","","","","","","","","","llvm_kaleidoscope_rs::Either","","llvm_kaleidoscope_rs::codegen","","","","","","","","","llvm_kaleidoscope_rs::lexer","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","llvm_kaleidoscope_rs::lexer::Token","","","llvm_kaleidoscope_rs::llvm","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","llvm_kaleidoscope_rs::parser","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","llvm_kaleidoscope_rs::parser::ExprAST","","","","","","","","","","","","","",""],"d":["","","Either type, for APIs accepting two types.","Fixed size of SmallCStr including the trailing \\\\0 byte.","Small C string on the stack with fixed size SMALL_STR_SIZE.","Return pointer to C string.","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Calls U::from(self).","Calls U::from(self).","","Safe wrapper around the LLVM C API.","","Create a new C string from src. Returns None if src …","","","","","","","","","","","Code generator from kaleidoscope AST to LLVM IR.","","","Compile either a PrototypeAST or a FunctionAST into the …","Returns the argument unchanged.","Calls U::from(self).","","","","","","","","","","","","","","","","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Lex and return the next token.","Calls U::from(self).","Calls U::from(self).","","","","","","","","","","","","Wrapper for a LLVM Basic Block.","Wrapper for a LLVM Value Reference specialized for …","Wrapper for a LLVM Function PassManager (legacy).","Wrapper for a LLVM IR Builder.","Wrapper for a LLVM LLJIT.","Wrapper for a LLVM Module with its own LLVM Context.","Wrapper for a LLVM Value Reference specialized for …","A resource handle for code added to an LLJit instance.","Wrapper for a LLVM Type Reference.","Wrapper for a LLVM Value Reference.","Add a function with the given name and fn_type to the …","Add an incoming value to the end of a PHI list.","Add an LLVM IR module to the JIT. Return a ResourceTracker…","Append a Basic Block to the end of the function referenced …","Append a Basic Block to the end of the function value.","Get a value reference for the function argument at index …","Get the number of function arguments for the given …","Get the number of Basic Blocks for the given function …","","","","","","","","","","","","","","","","","","","","","Emit an unconditional br instruction.","Emit a call instruction.","","","","","","","","","","","Emit a conditional br instruction.","Get a value reference representing the const f64 value.","Create a free-standing Basic Block without adding it to a …","","","","","","","Dump LLVM IR emitted into the Module to stdout.","Dump the LLVM Type to stdout.","Dump the LLVM Value to stdout.","Enable lookup of dynamic symbols available in the current …","Emit a fadd instruction.","Emit a fcmpone instruction.","Emit a fcmpult instruction.","Find the symbol with the name sym in the JIT.","Emit a fmul instruction.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Emit a fsub instruction.","Get a function value reference to the function with the …","Get the BasicBlock the IRBuilder currently inputs into.","Get the name for the given value reference.","Get the function to which the basic block belongs.","Initialize native target for corresponding to host (useful …","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Check if value is of f64 type.","Check if value is of integer type.","Create a new LLJit instance.","Create a new Module instance.","Emit a phi instruction.","Position the IR Builder at the end of the given Basic …","Emit a ret instruction.","Get a type reference representing the return value of the …","Run the optimization passes registered with the Function …","Set the name for the given value reference.","Deallocate and destroy all “ManagedStatic” variables.","","","","","","","","","","","","","","","","","","","","","","","","","","Get a type reference representing a f64 float.","Get a type reference representing a fn(args) -> ret …","","","","","","","","","","","Get a type reference representing for the given value …","Emit a uitofp instruction.","Verify that the given function is valid.","Create a new LLVM IR Builder with the modules context.","Create a new Function PassManager with the following …","","","","","Binary - Expression class for a binary operator.","Call - Expression class for function calls.","","ForExprAST - Expression class for for/in.","FunctionAST - This class represents a function definition …","If - Expression class for if/then/else.","Number - Expression class for numeric literals like “1.0…","Parser for the kaleidoscope language.","PrototypeAST - This class represents the “prototype” …","Variable - Expression class for referencing a variable, …","","","","","","","","","","","Implement the global variable int CurTok; from the …","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Advance the cur_tok by getting the next token from the …","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","","","","","definition ::= ‘def’ prototype expression","external ::= ‘extern’ prototype","toplevelexpr ::= expression","","","","","","","","","","","","","","","","","","","","","","","","","","","",""],"i":[1,1,0,0,0,2,1,2,1,2,0,2,2,1,2,1,2,0,0,2,2,0,1,2,2,1,2,1,2,3,4,0,5,5,5,5,5,5,5,5,6,6,6,6,6,6,6,6,6,0,6,6,0,7,6,7,6,6,6,7,6,7,7,6,6,7,7,6,7,6,7,6,8,9,10,0,0,0,0,0,0,0,0,0,0,11,12,13,11,14,14,14,14,15,13,16,11,17,18,19,20,14,12,15,13,16,11,17,18,19,20,14,12,15,15,18,19,20,14,12,18,19,20,14,12,15,19,11,14,12,15,16,11,17,11,19,20,13,15,15,15,13,15,15,13,16,11,17,18,19,20,14,12,15,11,15,20,18,0,15,13,16,11,17,18,19,20,14,12,20,20,13,11,15,15,15,14,17,20,0,18,19,20,14,12,15,13,16,11,17,18,19,20,14,12,15,13,16,11,17,18,19,20,14,12,11,11,15,13,16,11,17,18,19,20,14,12,20,15,14,15,17,21,22,21,22,23,23,0,23,0,23,23,0,0,23,24,23,21,22,24,23,21,22,21,21,24,23,21,22,23,21,22,24,23,21,22,24,24,23,21,22,23,21,22,24,24,24,24,21,24,23,21,22,24,23,21,22,24,23,21,22,25,26,27,28,27,28,27,29,30,30,29,29,29,30,29],"f":[null,null,null,null,null,[[["smallcstr",3]],["c_char",0]],[[["",0]],["",0]],[[["",0]],["",0]],[[["",0]],["",0]],[[["",0]],["",0]],null,[[["smallcstr",3],["smallcstr",3]],["bool",0]],[[["smallcstr",3],["formatter",3]],["result",6]],[[]],[[]],[[]],[[]],null,null,[[["smallcstr",3],["smallcstr",3]],["bool",0]],[[["",0]],["option",4,[["smallcstr",3]]]],null,[[],["result",4]],[[["str",0]],["result",4,[["smallcstr",3]]]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[["",0]],["typeid",3]],[[["",0]],["typeid",3]],null,null,null,[[["",0]],["",0]],[[["",0]],["",0]],[[["module",3],["hashmap",3],["either",4,[["prototypeast",3],["functionast",3]]]],["result",4,[["fnvalue",3],["string",3]]]],[[]],[[]],[[],["result",4]],[[],["result",4]],[[["",0]],["typeid",3]],null,null,null,null,null,null,null,null,null,null,null,null,null,[[["",0]],["",0]],[[["",0]],["",0]],[[["",0]],["",0]],[[["",0]],["",0]],[[["token",4],["token",4]],["bool",0]],[[["token",4],["formatter",3]],["result",6]],[[]],[[]],[[["lexer",3]],["token",4]],[[]],[[]],[[["token",4],["token",4]],["bool",0]],[[],["lexer",3]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[["",0]],["typeid",3]],[[["",0]],["typeid",3]],null,null,null,null,null,null,null,null,null,null,null,null,null,[[["module",3],["str",0],["type",3]],["fnvalue",3]],[[["phivalue",3],["value",3],["basicblock",3]]],[[["lljit",3],["module",3]],["resourcetracker",3]],[[["module",3],["fnvalue",3]],["basicblock",3]],[[["fnvalue",3],["basicblock",3]]],[[["fnvalue",3],["usize",0]],["value",3]],[[["fnvalue",3]],["usize",0]],[[["fnvalue",3]],["usize",0]],[[["",0]],["",0]],[[["",0]],["",0]],[[["",0]],["",0]],[[["",0]],["",0]],[[["",0]],["",0]],[[["",0]],["",0]],[[["",0]],["",0]],[[["",0]],["",0]],[[["",0]],["",0]],[[["",0]],["",0]],[[["",0]],["",0]],[[["",0]],["",0]],[[["",0]],["",0]],[[["",0]],["",0]],[[["",0]],["",0]],[[["",0]],["",0]],[[["",0]],["",0]],[[["",0]],["",0]],[[["",0]],["",0]],[[["",0]],["",0]],[[["irbuilder",3],["basicblock",3]]],[[["irbuilder",3],["fnvalue",3]],["value",3]],[[["basicblock",3]],["basicblock",3]],[[["type",3]],["type",3]],[[["value",3]],["value",3]],[[["fnvalue",3]],["fnvalue",3]],[[["phivalue",3]],["phivalue",3]],[[["",0],["",0]]],[[["",0],["",0]]],[[["",0],["",0]]],[[["",0],["",0]]],[[["",0],["",0]]],[[["irbuilder",3],["value",3],["basicblock",3],["basicblock",3]]],[[["type",3],["f64",0]],["value",3]],[[["module",3]],["basicblock",3]],[[["fnvalue",3]]],[[["phivalue",3]]],[[["irbuilder",3]]],[[["resourcetracker",3]]],[[["module",3]]],[[["functionpassmanager",3]]],[[["module",3]]],[[["type",3]]],[[["value",3]]],[[["lljit",3]]],[[["irbuilder",3],["value",3],["value",3]],["value",3]],[[["irbuilder",3],["value",3],["value",3]],["value",3]],[[["irbuilder",3],["value",3],["value",3]],["value",3]],[[["lljit",3],["str",0]],["jitfn",8]],[[["irbuilder",3],["value",3],["value",3]],["value",3]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[["irbuilder",3],["value",3],["value",3]],["value",3]],[[["module",3],["str",0]],["option",4,[["fnvalue",3]]]],[[["irbuilder",3]],["basicblock",3]],[[["value",3]],["str",0]],[[["basicblock",3]],["fnvalue",3]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[["value",3]],["bool",0]],[[["value",3]],["bool",0]],[[],["lljit",3]],[[],["module",3]],[[["irbuilder",3],["type",3]],["phivalue",3]],[[["irbuilder",3],["basicblock",3]]],[[["irbuilder",3],["value",3]]],[[["fnvalue",3]],["type",3]],[[["functionpassmanager",3],["fnvalue",3]]],[[["value",3],["str",0]]],[[]],[[["",0]]],[[["",0]]],[[["",0]]],[[["",0]]],[[["",0]]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[["module",3]],["type",3]],[[["module",3],["type",3]],["type",3]],[[["",0]],["typeid",3]],[[["",0]],["typeid",3]],[[["",0]],["typeid",3]],[[["",0]],["typeid",3]],[[["",0]],["typeid",3]],[[["",0]],["typeid",3]],[[["",0]],["typeid",3]],[[["",0]],["typeid",3]],[[["",0]],["typeid",3]],[[["",0]],["typeid",3]],[[["value",3]],["type",3]],[[["irbuilder",3],["value",3],["type",3]],["value",3]],[[["fnvalue",3]],["bool",0]],[[["module",3]],["irbuilder",3]],[[["module",3]],["functionpassmanager",3]],null,null,null,null,null,null,null,null,null,null,null,null,null,null,[[["",0]],["",0]],[[["",0]],["",0]],[[["",0]],["",0]],[[["",0]],["",0]],[[["",0]],["",0]],[[["",0]],["",0]],[[["",0]],["",0]],[[["",0]],["",0]],[[["prototypeast",3]],["prototypeast",3]],[[["",0],["",0]]],[[["parser",3]],["token",4]],[[["exprast",4],["exprast",4]],["bool",0]],[[["prototypeast",3],["prototypeast",3]],["bool",0]],[[["functionast",3],["functionast",3]],["bool",0]],[[["exprast",4],["formatter",3]],["result",6]],[[["prototypeast",3],["formatter",3]],["result",6]],[[["functionast",3],["formatter",3]],["result",6]],[[]],[[]],[[]],[[]],[[["parser",3]]],[[]],[[]],[[]],[[]],[[["exprast",4],["exprast",4]],["bool",0]],[[["prototypeast",3],["prototypeast",3]],["bool",0]],[[["functionast",3],["functionast",3]],["bool",0]],[[["lexer",3]],["parser",3]],[[["parser",3]],["result",4,[["functionast",3],["string",3]]]],[[["parser",3]],["result",4,[["prototypeast",3],["string",3]]]],[[["parser",3]],["result",4,[["functionast",3],["string",3]]]],[[["",0]]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[],["result",4]],[[["",0]],["typeid",3]],[[["",0]],["typeid",3]],[[["",0]],["typeid",3]],[[["",0]],["typeid",3]],null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],"p":[[4,"Either"],[3,"SmallCStr"],[13,"A"],[13,"B"],[3,"Codegen"],[4,"Token"],[3,"Lexer"],[13,"Identifier"],[13,"Number"],[13,"Char"],[3,"Module"],[3,"PhiValue"],[3,"LLJit"],[3,"FnValue"],[3,"IRBuilder"],[3,"ResourceTracker"],[3,"FunctionPassManager"],[3,"BasicBlock"],[3,"Type"],[3,"Value"],[3,"PrototypeAST"],[3,"FunctionAST"],[4,"ExprAST"],[3,"Parser"],[13,"Number"],[13,"Variable"],[13,"Binary"],[13,"Call"],[13,"For"],[13,"If"]]}\ +"llvm_kaleidoscope_rs":{"doc":"","t":[13,13,4,17,3,11,11,11,11,11,0,11,11,11,11,11,11,0,0,11,0,11,11,11,11,11,11,11,12,12,3,11,11,11,11,11,11,11,11,13,13,13,13,13,13,13,13,13,3,13,13,4,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,12,12,12,3,3,3,3,3,3,3,3,3,3,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,5,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,5,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,12,12,12,12,13,13,4,13,3,13,13,3,3,13,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12],"n":["A","B","Either","SMALL_STR_SIZE","SmallCStr","as_ptr","borrow","borrow","borrow_mut","borrow_mut","codegen","eq","fmt","from","from","into","into","lexer","llvm","new","parser","try_from","try_from","try_from","try_into","try_into","type_id","type_id","0","0","Codegen","borrow","borrow_mut","compile","from","into","try_from","try_into","type_id","Char","Def","Else","Eof","Extern","For","Identifier","If","In","Lexer","Number","Then","Token","borrow","borrow","borrow_mut","borrow_mut","eq","fmt","from","from","gettok","into","into","new","try_from","try_from","try_into","try_into","type_id","type_id","0","0","0","BasicBlock","FnValue","FunctionPassManager","IRBuilder","LLJit","Module","PhiValue","ResourceTracker","Type","Value","add_fn","add_incoming","add_module","append_basic_block","append_basic_block","arg","args","basic_blocks","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","br","call","clone","clone","clone","clone","clone","clone_into","clone_into","clone_into","clone_into","clone_into","cond_br","const_f64","create_basic_block","deref","deref","drop","drop","drop","drop","dump","dump","dump","enable_process_symbols","fadd","fcmpone","fcmpult","find_symbol","fmul","from","from","from","from","from","from","from","from","from","from","fsub","get_fn","get_insert_block","get_name","get_parent","initialize_native_taget","into","into","into","into","into","into","into","into","into","into","is_f64","is_int","new","new","phi","pos_at_end","ret","ret_type","run","set_name","shutdown","to_owned","to_owned","to_owned","to_owned","to_owned","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","type_f64","type_fn","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_of","uitofp","verify","with_ctx","with_ctx","0","0","1","1","Binary","Call","ExprAST","For","FunctionAST","If","Number","Parser","PrototypeAST","Variable","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","clone","clone_into","cur_tok","eq","eq","eq","fmt","fmt","fmt","from","from","from","from","get_next_token","into","into","into","into","new","parse_definition","parse_extern","parse_top_level_expr","to_owned","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","0","0","0","0","1","1","2","body","cond","else_","end","start","step","then","var"],"q":["llvm_kaleidoscope_rs","","","","","","","","","","","","","","","","","","","","","","","","","","","","llvm_kaleidoscope_rs::Either","","llvm_kaleidoscope_rs::codegen","","","","","","","","","llvm_kaleidoscope_rs::lexer","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","llvm_kaleidoscope_rs::lexer::Token","","","llvm_kaleidoscope_rs::llvm","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","llvm_kaleidoscope_rs::parser","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","llvm_kaleidoscope_rs::parser::ExprAST","","","","","","","","","","","","","",""],"d":["","","Either type, for APIs accepting two types.","Fixed size of SmallCStr including the trailing \\\\0 byte.","Small C string on the stack with fixed size SMALL_STR_SIZE.","Return pointer to C string.","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Calls U::from(self).","Calls U::from(self).","","Safe wrapper around the LLVM C API.","Create a new C string from src. Returns None if src …","","","","","","","","","","","Code generator from kaleidoscope AST to LLVM IR.","","","Compile either a PrototypeAST or a FunctionAST into the …","Returns the argument unchanged.","Calls U::from(self).","","","","","","","","","","","","","","","","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Lex and return the next token.","Calls U::from(self).","Calls U::from(self).","","","","","","","","","","","Wrapper for a LLVM Basic Block.","Wrapper for a LLVM Value Reference specialized for …","Wrapper for a LLVM Function PassManager (legacy).","Wrapper for a LLVM IR Builder.","Wrapper for a LLVM LLJIT.","Wrapper for a LLVM Module with its own LLVM Context.","Wrapper for a LLVM Value Reference specialized for …","A resource handle for code added to an LLJit instance.","Wrapper for a LLVM Type Reference.","Wrapper for a LLVM Value Reference.","Add a function with the given name and fn_type to the …","Add an incoming value to the end of a PHI list.","Add an LLVM IR module to the JIT. Return a ResourceTracker…","Append a Basic Block to the end of the function referenced …","Append a Basic Block to the end of the function value.","Get a value reference for the function argument at index …","Get the number of function arguments for the given …","Get the number of Basic Blocks for the given function …","","","","","","","","","","","","","","","","","","","","","Emit an unconditional br instruction.","Emit a call instruction.","","","","","","","","","","","Emit a conditional br instruction.","Get a value reference representing the const f64 value.","Create a free-standing Basic Block without adding it to a …","","","","","","","Dump LLVM IR emitted into the Module to stdout.","Dump the LLVM Type to stdout.","Dump the LLVM Value to stdout.","Enable lookup of dynamic symbols available in the current …","Emit a fadd instruction.","Emit a fcmpone instruction.","Emit a fcmpult instruction.","Find the symbol with the name sym in the JIT.","Emit a fmul instruction.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Emit a fsub instruction.","Get a function value reference to the function with the …","Get the BasicBlock the IRBuilder currently inputs into.","Get the name for the given value reference.","Get the function to which the basic block belongs.","Initialize native target for corresponding to host (useful …","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Check if value is of f64 type.","Check if value is of integer type.","Create a new LLJit instance.","Create a new Module instance.","Emit a phi instruction.","Position the IR Builder at the end of the given Basic …","Emit a ret instruction.","Get a type reference representing the return value of the …","Run the optimization passes registered with the Function …","Set the name for the given value reference.","Deallocate and destroy all “ManagedStatic” variables.","","","","","","","","","","","","","","","","","","","","","","","","","","Get a type reference representing a f64 float.","Get a type reference representing a fn(args) -> ret …","","","","","","","","","","","Get a type reference representing for the given value …","Emit a uitofp instruction.","Verify that the given function is valid.","Create a new LLVM IR Builder with the modules context.","Create a new Function PassManager with the following …","","","","","Binary - Expression class for a binary operator.","Call - Expression class for function calls.","","ForExprAST - Expression class for for/in.","FunctionAST - This class represents a function definition …","If - Expression class for if/then/else.","Number - Expression class for numeric literals like “1.0…","Parser for the kaleidoscope language.","PrototypeAST - This class represents the “prototype” …","Variable - Expression class for referencing a variable, …","","","","","","","","","","","Implement the global variable int CurTok; from the …","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Advance the cur_tok by getting the next token from the …","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","","definition ::= ‘def’ prototype expression","external ::= ‘extern’ prototype","toplevelexpr ::= expression","","","","","","","","","","","","","","","","","","","","","","","","","","","",""],"i":[14,14,0,0,0,1,14,1,14,1,0,1,1,14,1,14,1,0,0,1,0,14,1,1,14,1,14,1,31,32,0,33,33,33,33,33,33,33,33,17,17,17,17,17,17,17,17,17,0,17,17,0,18,17,18,17,17,17,18,17,18,18,17,18,18,17,18,17,18,17,34,35,36,0,0,0,0,0,0,0,0,0,0,10,20,23,10,15,15,15,15,26,23,24,10,28,22,19,21,15,20,26,23,24,10,28,22,19,21,15,20,26,26,22,19,21,15,20,22,19,21,15,20,26,19,10,15,20,26,24,10,28,10,19,21,23,26,26,26,23,26,26,23,24,10,28,22,19,21,15,20,26,10,26,21,22,0,26,23,24,10,28,22,19,21,15,20,21,21,23,10,26,26,26,15,28,21,0,22,19,21,15,20,26,23,24,10,28,22,19,21,15,20,26,23,24,10,28,22,19,21,15,20,10,10,26,23,24,10,28,22,19,21,15,20,21,26,15,26,28,12,13,12,13,30,30,0,30,0,30,30,0,0,30,29,30,12,13,29,30,12,13,12,12,29,30,12,13,30,12,13,29,30,12,13,29,29,30,12,13,29,29,29,29,12,29,30,12,13,29,30,12,13,29,30,12,13,37,38,39,40,39,40,39,41,42,42,41,41,41,42,41],"f":[0,0,0,0,0,[1,2],[[]],[[]],[[]],[[]],0,[[1,1],3],[[1,4],5],[[]],[[]],[[]],[[]],0,0,[[],[[6,[1]]]],0,[[],7],[8,[[7,[1]]]],[[],7],[[],7],[[],7],[[],9],[[],9],0,0,0,[[]],[[]],[[10,11,[14,[12,13]]],[[7,[15,16]]]],[[]],[[]],[[],7],[[],7],[[],9],0,0,0,0,0,0,0,0,0,0,0,0,0,[[]],[[]],[[]],[[]],[[17,17],3],[[17,4],5],[[]],[[]],[18,17],[[]],[[]],[[],18],[[],7],[[],7],[[],7],[[],7],[[],9],[[],9],0,0,0,0,0,0,0,0,0,0,0,0,0,[[10,8,19],15],[[20,21,22]],[[23,10],24],[[10,15],22],[[15,22]],[[15,25],21],[15,25],[15,25],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[26,22]],[[26,15],21],[22,22],[19,19],[21,21],[15,15],[20,20],[[]],[[]],[[]],[[]],[[]],[[26,21,22,22]],[[19,27],21],[10,22],[15],[20],[26],[24],[10],[28],[10],[19],[21],[23],[[26,21,21],21],[[26,21,21],21],[[26,21,21],21],0,[[26,21,21],21],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[26,21,21],21],[[10,8],[[6,[15]]]],[26,22],[21,8],[22,15],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[21,3],[21,3],[[],23],[[],10],[[26,19],20],[[26,22]],[[26,21]],[15,19],[[28,15]],[[21,8]],[[]],[[]],[[]],[[]],[[]],[[]],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[10,19],[[10,19],19],[[],9],[[],9],[[],9],[[],9],[[],9],[[],9],[[],9],[[],9],[[],9],[[],9],[21,19],[[26,21,19],21],[15,3],[10,26],[10,28],0,0,0,0,0,0,0,0,0,0,0,0,0,0,[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[12,12],[[]],[29,17],[[30,30],3],[[12,12],3],[[13,13],3],[[30,4],5],[[12,4],5],[[13,4],5],[[]],[[]],[[]],[[]],[29],[[]],[[]],[[]],[[]],[18,29],[29,[[7,[13,16]]]],[29,[[7,[12,16]]]],[29,[[7,[13,16]]]],[[]],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],9],[[],9],[[],9],[[],9],0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"p":[[3,"SmallCStr"],[6,"c_char"],[15,"bool"],[3,"Formatter"],[6,"Result"],[4,"Option"],[4,"Result"],[15,"str"],[3,"TypeId"],[3,"Module"],[3,"HashMap"],[3,"PrototypeAST"],[3,"FunctionAST"],[4,"Either"],[3,"FnValue"],[3,"String"],[4,"Token"],[3,"Lexer"],[3,"Type"],[3,"PhiValue"],[3,"Value"],[3,"BasicBlock"],[3,"LLJit"],[3,"ResourceTracker"],[15,"usize"],[3,"IRBuilder"],[15,"f64"],[3,"FunctionPassManager"],[3,"Parser"],[4,"ExprAST"],[13,"A"],[13,"B"],[3,"Codegen"],[13,"Identifier"],[13,"Number"],[13,"Char"],[13,"Number"],[13,"Variable"],[13,"Binary"],[13,"Call"],[13,"For"],[13,"If"]]}\ }'); if (typeof window !== 'undefined' && window.initSearch) {window.initSearch(searchIndex)}; if (typeof exports !== 'undefined') {exports.searchIndex = searchIndex}; diff --git a/search.js b/search.js index 8fd46df..f0ccdfb 100644 --- a/search.js +++ b/search.js @@ -1 +1 @@ -"use strict";(function(){const itemTypes=["mod","externcrate","import","struct","enum","fn","type","static","trait","impl","tymethod","method","structfield","variant","macro","primitive","associatedtype","constant","associatedconstant","union","foreigntype","keyword","existential","attr","derive","traitalias",];const TY_PRIMITIVE=itemTypes.indexOf("primitive");const TY_KEYWORD=itemTypes.indexOf("keyword");const ROOT_PATH=typeof window!=="undefined"?window.rootPath:"../";function hasOwnPropertyRustdoc(obj,property){return Object.prototype.hasOwnProperty.call(obj,property)}function printTab(nb){let iter=0;let foundCurrentTab=false;let foundCurrentResultSet=false;onEachLazy(document.getElementById("titles").childNodes,elem=>{if(nb===iter){addClass(elem,"selected");foundCurrentTab=true}else{removeClass(elem,"selected")}iter+=1});iter=0;onEachLazy(document.getElementById("results").childNodes,elem=>{if(nb===iter){addClass(elem,"active");foundCurrentResultSet=true}else{removeClass(elem,"active")}iter+=1});if(foundCurrentTab&&foundCurrentResultSet){searchState.currentTab=nb}else if(nb!==0){printTab(0)}}const levenshtein_row2=[];function levenshtein(s1,s2){if(s1===s2){return 0}const s1_len=s1.length,s2_len=s2.length;if(s1_len&&s2_len){let i1=0,i2=0,a,b,c,c2;const row=levenshtein_row2;while(i1-".indexOf(c)!==-1}function isStopCharacter(c){return isWhitespace(c)||isEndCharacter(c)}function isErrorCharacter(c){return"()".indexOf(c)!==-1}function itemTypeFromName(typename){for(let i=0,len=itemTypes.length;i0){throw new Error("Cannot use literal search when there is more than one element")}parserState.pos+=1;const start=parserState.pos;const end=getIdentEndPosition(parserState);if(parserState.pos>=parserState.length){throw new Error("Unclosed `\"`")}else if(parserState.userQuery[end]!=="\""){throw new Error(`Unexpected \`${parserState.userQuery[end]}\` in a string element`)}else if(start===end){throw new Error("Cannot have empty string element")}parserState.pos+=1;query.literalSearch=true}function isPathStart(parserState){return parserState.userQuery.slice(parserState.pos,parserState.pos+2)==="::"}function isReturnArrow(parserState){return parserState.userQuery.slice(parserState.pos,parserState.pos+2)==="->"}function isIdentCharacter(c){return(c==="_"||(c>="0"&&c<="9")||(c>="a"&&c<="z")||(c>="A"&&c<="Z"))}function isSeparatorCharacter(c){return c===","||isWhitespaceCharacter(c)}function isWhitespaceCharacter(c){return c===" "||c==="\t"}function createQueryElement(query,parserState,name,generics,isInGenerics){if(name==="*"||(name.length===0&&generics.length===0)){return}if(query.literalSearch&&parserState.totalElems-parserState.genericsElems>0){throw new Error("You cannot have more than one element if you use quotes")}const pathSegments=name.split("::");if(pathSegments.length>1){for(let i=0,len=pathSegments.length;i=end){throw new Error("Found generics without a path")}parserState.pos+=1;getItemsBefore(query,parserState,generics,">")}if(start>=end&&generics.length===0){return}elems.push(createQueryElement(query,parserState,parserState.userQuery.slice(start,end),generics,isInGenerics))}function getItemsBefore(query,parserState,elems,endChar){let foundStopChar=true;while(parserState.pos"){extra="`<`"}else if(endChar===""){extra="`->`"}throw new Error("Unexpected `"+c+"` after "+extra)}if(!foundStopChar){if(endChar!==""){throw new Error(`Expected \`,\`, \` \` or \`${endChar}\`, found \`${c}\``)}throw new Error(`Expected \`,\` or \` \`, found \`${c}\``)}const posBefore=parserState.pos;getNextElem(query,parserState,elems,endChar===">");if(posBefore===parserState.pos){parserState.pos+=1}foundStopChar=false}parserState.pos+=1}function checkExtraTypeFilterCharacters(parserState){const query=parserState.userQuery;for(let pos=0;pos"){if(isReturnArrow(parserState)){break}throw new Error(`Unexpected \`${c}\` (did you mean \`->\`?)`)}throw new Error(`Unexpected \`${c}\``)}else if(c===":"&&!isPathStart(parserState)){if(parserState.typeFilter!==null){throw new Error("Unexpected `:`")}if(query.elems.length===0){throw new Error("Expected type filter before `:`")}else if(query.elems.length!==1||parserState.totalElems!==1){throw new Error("Unexpected `:`")}else if(query.literalSearch){throw new Error("You cannot use quotes on type filter")}checkExtraTypeFilterCharacters(parserState);parserState.typeFilter=query.elems.pop().name;parserState.pos+=1;parserState.totalElems=0;query.literalSearch=false;foundStopChar=true;continue}if(!foundStopChar){if(parserState.typeFilter!==null){throw new Error(`Expected \`,\`, \` \` or \`->\`, found \`${c}\``)}throw new Error(`Expected \`,\`, \` \`, \`:\` or \`->\`, found \`${c}\``)}before=query.elems.length;getNextElem(query,parserState,query.elems,false);if(query.elems.length===before){parserState.pos+=1}foundStopChar=false}while(parserState.pos`")}break}else{parserState.pos+=1}}}function newParsedQuery(userQuery){return{original:userQuery,userQuery:userQuery.toLowerCase(),typeFilter:NO_TYPE_FILTER,elems:[],returned:[],foundElems:0,literalSearch:false,error:null,}}function buildUrl(search,filterCrates){let extra="?search="+encodeURIComponent(search);if(filterCrates!==null){extra+="&filter-crate="+encodeURIComponent(filterCrates)}return getNakedUrl()+extra+window.location.hash}function getFilterCrates(){const elem=document.getElementById("crate-search");if(elem&&elem.value!=="All crates"&&hasOwnPropertyRustdoc(rawSearchIndex,elem.value)){return elem.value}return null}function parseQuery(userQuery){userQuery=userQuery.trim();const parserState={length:userQuery.length,pos:0,totalElems:0,genericsElems:0,typeFilter:null,userQuery:userQuery.toLowerCase(),};let query=newParsedQuery(userQuery);try{parseInput(query,parserState);if(parserState.typeFilter!==null){let typeFilter=parserState.typeFilter;if(typeFilter==="const"){typeFilter="constant"}query.typeFilter=itemTypeFromName(typeFilter)}}catch(err){query=newParsedQuery(userQuery);query.error=err.message;query.typeFilter=-1;return query}if(!query.literalSearch){query.literalSearch=parserState.totalElems>1}query.foundElems=query.elems.length+query.returned.length;return query}function createQueryResults(results_in_args,results_returned,results_others,parsedQuery){return{"in_args":results_in_args,"returned":results_returned,"others":results_others,"query":parsedQuery,}}function execQuery(parsedQuery,searchWords,filterCrates,currentCrate){const results_others={},results_in_args={},results_returned={};function transformResults(results){const duplicates={};const out=[];for(const result of results){if(result.id>-1){const obj=searchIndex[result.id];obj.lev=result.lev;const res=buildHrefAndPath(obj);obj.displayPath=pathSplitter(res[0]);obj.fullPath=obj.displayPath+obj.name;obj.fullPath+="|"+obj.ty;if(duplicates[obj.fullPath]){continue}duplicates[obj.fullPath]=true;obj.href=res[1];out.push(obj);if(out.length>=MAX_RESULTS){break}}}return out}function sortResults(results,isType,preferredCrate){const userQuery=parsedQuery.userQuery;const ar=[];for(const entry in results){if(hasOwnPropertyRustdoc(results,entry)){const result=results[entry];result.word=searchWords[result.id];result.item=searchIndex[result.id]||{};ar.push(result)}}results=ar;if(results.length===0){return[]}results.sort((aaa,bbb)=>{let a,b;a=(aaa.word!==userQuery);b=(bbb.word!==userQuery);if(a!==b){return a-b}a=(aaa.lev);b=(bbb.lev);if(a!==b){return a-b}a=(aaa.item.crate!==preferredCrate);b=(bbb.item.crate!==preferredCrate);if(a!==b){return a-b}a=aaa.word.length;b=bbb.word.length;if(a!==b){return a-b}a=aaa.word;b=bbb.word;if(a!==b){return(a>b?+1:-1)}a=(aaa.index<0);b=(bbb.index<0);if(a!==b){return a-b}a=aaa.index;b=bbb.index;if(a!==b){return a-b}if((aaa.item.ty===TY_PRIMITIVE&&bbb.item.ty!==TY_KEYWORD)||(aaa.item.ty===TY_KEYWORD&&bbb.item.ty!==TY_PRIMITIVE)){return-1}if((bbb.item.ty===TY_PRIMITIVE&&aaa.item.ty!==TY_PRIMITIVE)||(bbb.item.ty===TY_KEYWORD&&aaa.item.ty!==TY_KEYWORD)){return 1}a=(aaa.item.desc==="");b=(bbb.item.desc==="");if(a!==b){return a-b}a=aaa.item.ty;b=bbb.item.ty;if(a!==b){return a-b}a=aaa.item.path;b=bbb.item.path;if(a!==b){return(a>b?+1:-1)}return 0});let nameSplit=null;if(parsedQuery.elems.length===1){const hasPath=typeof parsedQuery.elems[0].path==="undefined";nameSplit=hasPath?null:parsedQuery.elems[0].path}for(const result of results){if(result.dontValidate){continue}const name=result.item.name.toLowerCase(),path=result.item.path.toLowerCase(),parent=result.item.parent;if(!isType&&!validateResult(name,path,nameSplit,parent)){result.id=-1}}return transformResults(results)}function checkGenerics(row,elem,defaultLev){if(row.length<=GENERICS_DATA||row[GENERICS_DATA].length===0){return elem.generics.length===0?defaultLev:MAX_LEV_DISTANCE+1}else if(row[GENERICS_DATA].length>0&&row[GENERICS_DATA][0][NAME]===""){if(row.length>GENERICS_DATA){return checkGenerics(row[GENERICS_DATA][0],elem,defaultLev)}return elem.generics.length===0?defaultLev:MAX_LEV_DISTANCE+1}let elem_name;if(elem.generics.length>0&&row[GENERICS_DATA].length>=elem.generics.length){const elems=Object.create(null);for(const entry of row[GENERICS_DATA]){elem_name=entry[NAME];if(elem_name===""){if(checkGenerics(entry,elem,MAX_LEV_DISTANCE+1)!==0){return MAX_LEV_DISTANCE+1}continue}if(elems[elem_name]===undefined){elems[elem_name]=0}elems[elem_name]+=1}for(const generic of elem.generics){let match=null;if(elems[generic.name]){match=generic.name}else{for(elem_name in elems){if(!hasOwnPropertyRustdoc(elems,elem_name)){continue}if(elem_name===generic){match=elem_name;break}}}if(match===null){return MAX_LEV_DISTANCE+1}elems[match]-=1;if(elems[match]===0){delete elems[match]}}return 0}return MAX_LEV_DISTANCE+1}function checkIfInGenerics(row,elem){let lev=MAX_LEV_DISTANCE+1;for(const entry of row[GENERICS_DATA]){lev=Math.min(checkType(entry,elem,true),lev);if(lev===0){break}}return lev}function checkType(row,elem,literalSearch){if(row[NAME].length===0){if(row.length>GENERICS_DATA){return checkIfInGenerics(row,elem)}return MAX_LEV_DISTANCE+1}let lev=levenshtein(row[NAME],elem.name);if(literalSearch){if(lev!==0){if(elem.generics.length===0){const checkGeneric=(row.length>GENERICS_DATA&&row[GENERICS_DATA].length>0);if(checkGeneric&&row[GENERICS_DATA].findIndex(tmp_elem=>tmp_elem[NAME]===elem.name)!==-1){return 0}}return MAX_LEV_DISTANCE+1}else if(elem.generics.length>0){return checkGenerics(row,elem,MAX_LEV_DISTANCE+1)}return 0}else if(row.length>GENERICS_DATA){if(elem.generics.length===0){if(lev===0){return 0}lev=checkIfInGenerics(row,elem);return lev+0.5}else if(lev>MAX_LEV_DISTANCE){return checkIfInGenerics(row,elem)}else{const tmp_lev=checkGenerics(row,elem,lev);if(tmp_lev>MAX_LEV_DISTANCE){return MAX_LEV_DISTANCE+1}return(tmp_lev+lev)/2}}else if(elem.generics.length>0){return MAX_LEV_DISTANCE+1}return lev}function findArg(row,elem,typeFilter){let lev=MAX_LEV_DISTANCE+1;if(row&&row.type&&row.type[INPUTS_DATA]&&row.type[INPUTS_DATA].length>0){for(const input of row.type[INPUTS_DATA]){if(!typePassesFilter(typeFilter,input[1])){continue}lev=Math.min(lev,checkType(input,elem,parsedQuery.literalSearch));if(lev===0){return 0}}}return parsedQuery.literalSearch?MAX_LEV_DISTANCE+1:lev}function checkReturned(row,elem,typeFilter){let lev=MAX_LEV_DISTANCE+1;if(row&&row.type&&row.type.length>OUTPUT_DATA){let ret=row.type[OUTPUT_DATA];if(typeof ret[0]==="string"){ret=[ret]}for(const ret_ty of ret){if(!typePassesFilter(typeFilter,ret_ty[1])){continue}lev=Math.min(lev,checkType(ret_ty,elem,parsedQuery.literalSearch));if(lev===0){return 0}}}return parsedQuery.literalSearch?MAX_LEV_DISTANCE+1:lev}function checkPath(contains,ty){if(contains.length===0){return 0}let ret_lev=MAX_LEV_DISTANCE+1;const path=ty.path.split("::");if(ty.parent&&ty.parent.name){path.push(ty.parent.name.toLowerCase())}const length=path.length;const clength=contains.length;if(clength>length){return MAX_LEV_DISTANCE+1}for(let i=0;ilength){break}let lev_total=0;let aborted=false;for(let x=0;xMAX_LEV_DISTANCE){aborted=true;break}lev_total+=lev}if(!aborted){ret_lev=Math.min(ret_lev,Math.round(lev_total/clength))}}return ret_lev}function typePassesFilter(filter,type){if(filter<=NO_TYPE_FILTER||filter===type)return true;const name=itemTypes[type];switch(itemTypes[filter]){case"constant":return name==="associatedconstant";case"fn":return name==="method"||name==="tymethod";case"type":return name==="primitive"||name==="associatedtype";case"trait":return name==="traitalias"}return false}function createAliasFromItem(item){return{crate:item.crate,name:item.name,path:item.path,desc:item.desc,ty:item.ty,parent:item.parent,type:item.type,is_alias:true,}}function handleAliases(ret,query,filterCrates,currentCrate){const lowerQuery=query.toLowerCase();const aliases=[];const crateAliases=[];if(filterCrates!==null){if(ALIASES[filterCrates]&&ALIASES[filterCrates][lowerQuery]){const query_aliases=ALIASES[filterCrates][lowerQuery];for(const alias of query_aliases){aliases.push(createAliasFromItem(searchIndex[alias]))}}}else{Object.keys(ALIASES).forEach(crate=>{if(ALIASES[crate][lowerQuery]){const pushTo=crate===currentCrate?crateAliases:aliases;const query_aliases=ALIASES[crate][lowerQuery];for(const alias of query_aliases){pushTo.push(createAliasFromItem(searchIndex[alias]))}}})}const sortFunc=(aaa,bbb)=>{if(aaa.path{alias.alias=query;const res=buildHrefAndPath(alias);alias.displayPath=pathSplitter(res[0]);alias.fullPath=alias.displayPath+alias.name;alias.href=res[1];ret.others.unshift(alias);if(ret.others.length>MAX_RESULTS){ret.others.pop()}};aliases.forEach(pushFunc);crateAliases.forEach(pushFunc)}function addIntoResults(results,fullId,id,index,lev){if(lev===0||(!parsedQuery.literalSearch&&lev<=MAX_LEV_DISTANCE)){if(results[fullId]!==undefined){const result=results[fullId];if(result.dontValidate||result.lev<=lev){return}}results[fullId]={id:id,index:index,dontValidate:parsedQuery.literalSearch,lev:lev,}}}function handleSingleArg(row,pos,elem,results_others,results_in_args,results_returned){if(!row||(filterCrates!==null&&row.crate!==filterCrates)){return}let lev,lev_add=0,index=-1;const fullId=row.id;const in_args=findArg(row,elem,parsedQuery.typeFilter);const returned=checkReturned(row,elem,parsedQuery.typeFilter);addIntoResults(results_in_args,fullId,pos,index,in_args);addIntoResults(results_returned,fullId,pos,index,returned);if(!typePassesFilter(parsedQuery.typeFilter,row.ty)){return}const searchWord=searchWords[pos];if(parsedQuery.literalSearch){if(searchWord===elem.name){addIntoResults(results_others,fullId,pos,-1,0)}return}if(elem.name.length===0){if(row.type!==null){lev=checkGenerics(row.type,elem,MAX_LEV_DISTANCE+1);addIntoResults(results_others,fullId,pos,index,lev)}return}if(elem.fullPath.length>1){lev=checkPath(elem.pathWithoutLast,row);if(lev>MAX_LEV_DISTANCE||(parsedQuery.literalSearch&&lev!==0)){return}else if(lev>0){lev_add=lev/10}}if(searchWord.indexOf(elem.pathLast)>-1||row.normalizedName.indexOf(elem.pathLast)>-1){index=row.normalizedName.indexOf(elem.pathLast)}lev=levenshtein(searchWord,elem.pathLast);if(lev>0&&elem.pathLast.length>2&&searchWord.indexOf(elem.pathLast)>-1){if(elem.pathLast.length<6){lev=1}else{lev=0}}lev+=lev_add;if(lev>MAX_LEV_DISTANCE){return}else if(index!==-1&&elem.fullPath.length<2){lev-=1}if(lev<0){lev=0}addIntoResults(results_others,fullId,pos,index,lev)}function handleArgs(row,pos,results){if(!row||(filterCrates!==null&&row.crate!==filterCrates)){return}let totalLev=0;let nbLev=0;function checkArgs(elems,callback){for(const elem of elems){const lev=callback(row,elem,NO_TYPE_FILTER);if(lev<=1){nbLev+=1;totalLev+=lev}else{return false}}return true}if(!checkArgs(parsedQuery.elems,findArg)){return}if(!checkArgs(parsedQuery.returned,checkReturned)){return}if(nbLev===0){return}const lev=Math.round(totalLev/nbLev);addIntoResults(results,row.id,pos,0,lev)}function innerRunQuery(){let elem,i,nSearchWords,in_returned,row;if(parsedQuery.foundElems===1){if(parsedQuery.elems.length===1){elem=parsedQuery.elems[0];for(i=0,nSearchWords=searchWords.length;i0){for(i=0,nSearchWords=searchWords.length;i-1||path.indexOf(key)>-1||(parent!==undefined&&parent.name!==undefined&&parent.name.toLowerCase().indexOf(key)>-1)||levenshtein(name,key)<=MAX_LEV_DISTANCE)){return false}}return true}function nextTab(direction){const next=(searchState.currentTab+direction+3)%searchState.focusedByTab.length;searchState.focusedByTab[searchState.currentTab]=document.activeElement;printTab(next);focusSearchResult()}function focusSearchResult(){const target=searchState.focusedByTab[searchState.currentTab]||document.querySelectorAll(".search-results.active a").item(0)||document.querySelectorAll("#titles > button").item(searchState.currentTab);if(target){target.focus()}}function buildHrefAndPath(item){let displayPath;let href;const type=itemTypes[item.ty];const name=item.name;let path=item.path;if(type==="mod"){displayPath=path+"::";href=ROOT_PATH+path.replace(/::/g,"/")+"/"+name+"/index.html"}else if(type==="import"){displayPath=item.path+"::";href=ROOT_PATH+item.path.replace(/::/g,"/")+"/index.html#reexport."+name}else if(type==="primitive"||type==="keyword"){displayPath="";href=ROOT_PATH+path.replace(/::/g,"/")+"/"+type+"."+name+".html"}else if(type==="externcrate"){displayPath="";href=ROOT_PATH+name+"/index.html"}else if(item.parent!==undefined){const myparent=item.parent;let anchor="#"+type+"."+name;const parentType=itemTypes[myparent.ty];let pageType=parentType;let pageName=myparent.name;if(parentType==="primitive"){displayPath=myparent.name+"::"}else if(type==="structfield"&&parentType==="variant"){const enumNameIdx=item.path.lastIndexOf("::");const enumName=item.path.substr(enumNameIdx+2);path=item.path.substr(0,enumNameIdx);displayPath=path+"::"+enumName+"::"+myparent.name+"::";anchor="#variant."+myparent.name+".field."+name;pageType="enum";pageName=enumName}else{displayPath=path+"::"+myparent.name+"::"}href=ROOT_PATH+path.replace(/::/g,"/")+"/"+pageType+"."+pageName+".html"+anchor}else{displayPath=item.path+"::";href=ROOT_PATH+item.path.replace(/::/g,"/")+"/"+type+"."+name+".html"}return[displayPath,href]}function escape(content){const h1=document.createElement("h1");h1.textContent=content;return h1.innerHTML}function pathSplitter(path){const tmp=""+path.replace(/::/g,"::");if(tmp.endsWith("")){return tmp.slice(0,tmp.length-6)}return tmp}function addTab(array,query,display){let extraClass="";if(display===true){extraClass=" active"}const output=document.createElement("div");let length=0;if(array.length>0){output.className="search-results "+extraClass;array.forEach(item=>{const name=item.name;const type=itemTypes[item.ty];length+=1;let extra="";if(type==="primitive"){extra=" (primitive type)"}else if(type==="keyword"){extra=" (keyword)"}const link=document.createElement("a");link.className="result-"+type;link.href=item.href;const wrapper=document.createElement("div");const resultName=document.createElement("div");resultName.className="result-name";if(item.is_alias){const alias=document.createElement("span");alias.className="alias";const bold=document.createElement("b");bold.innerText=item.alias;alias.appendChild(bold);alias.insertAdjacentHTML("beforeend"," - see ");resultName.appendChild(alias)}resultName.insertAdjacentHTML("beforeend",item.displayPath+""+name+extra+"");wrapper.appendChild(resultName);const description=document.createElement("div");description.className="desc";const spanDesc=document.createElement("span");spanDesc.insertAdjacentHTML("beforeend",item.desc);description.appendChild(spanDesc);wrapper.appendChild(description);link.appendChild(wrapper);output.appendChild(link)})}else if(query.error===null){output.className="search-failed"+extraClass;output.innerHTML="No results :(
"+"Try on DuckDuckGo?

"+"Or try looking in one of these:"}return[output,length]}function makeTabHeader(tabNb,text,nbElems){if(searchState.currentTab===tabNb){return""}return""}function showResults(results,go_to_first,filterCrates){const search=searchState.outputElement();if(go_to_first||(results.others.length===1&&getSettingValue("go-to-only-result")==="true"&&(!search.firstChild||search.firstChild.innerText!==searchState.loadingText))){const elem=document.createElement("a");elem.href=results.others[0].href;removeClass(elem,"active");document.body.appendChild(elem);elem.click();return}if(results.query===undefined){results.query=parseQuery(searchState.input.value)}currentResults=results.query.userQuery;const ret_others=addTab(results.others,results.query,true);const ret_in_args=addTab(results.in_args,results.query,false);const ret_returned=addTab(results.returned,results.query,false);let currentTab=searchState.currentTab;if((currentTab===0&&ret_others[1]===0)||(currentTab===1&&ret_in_args[1]===0)||(currentTab===2&&ret_returned[1]===0)){if(ret_others[1]!==0){currentTab=0}else if(ret_in_args[1]!==0){currentTab=1}else if(ret_returned[1]!==0){currentTab=2}}let crates="";const crates_list=Object.keys(rawSearchIndex);if(crates_list.length>1){crates=" in "}let typeFilter="";if(results.query.typeFilter!==NO_TYPE_FILTER){typeFilter=" (type: "+escape(itemTypes[results.query.typeFilter])+")"}let output="
"+`

Results for ${escape(results.query.userQuery)}`+`${typeFilter}

${crates}
`;if(results.query.error!==null){output+=`

Query parser error: "${results.query.error}".

`;output+="
"+makeTabHeader(0,"In Names",ret_others[1])+"
";currentTab=0}else if(results.query.foundElems<=1&&results.query.returned.length===0){output+="
"+makeTabHeader(0,"In Names",ret_others[1])+makeTabHeader(1,"In Parameters",ret_in_args[1])+makeTabHeader(2,"In Return Types",ret_returned[1])+"
"}else{const signatureTabTitle=results.query.elems.length===0?"In Function Return Types":results.query.returned.length===0?"In Function Parameters":"In Function Signatures";output+="
"+makeTabHeader(0,signatureTabTitle,ret_others[1])+"
";currentTab=0}const resultsElem=document.createElement("div");resultsElem.id="results";resultsElem.appendChild(ret_others[0]);resultsElem.appendChild(ret_in_args[0]);resultsElem.appendChild(ret_returned[0]);search.innerHTML=output;const crateSearch=document.getElementById("crate-search");if(crateSearch){crateSearch.addEventListener("input",updateCrate)}search.appendChild(resultsElem);searchState.showResults(search);const elems=document.getElementById("titles").childNodes;searchState.focusedByTab=[];let i=0;for(const elem of elems){const j=i;elem.onclick=()=>printTab(j);searchState.focusedByTab.push(null);i+=1}printTab(currentTab)}function search(e,forced){const params=searchState.getQueryStringParams();const query=parseQuery(searchState.input.value.trim());if(e){e.preventDefault()}if(!forced&&query.userQuery===currentResults){if(query.userQuery.length>0){putBackSearch()}return}let filterCrates=getFilterCrates();if(filterCrates===null&¶ms["filter-crate"]!==undefined){filterCrates=params["filter-crate"]}searchState.title="Results for "+query.original+" - Rust";if(browserSupportsHistoryApi()){const newURL=buildUrl(query.original,filterCrates);if(!history.state&&!params.search){history.pushState(null,"",newURL)}else{history.replaceState(null,"",newURL)}}showResults(execQuery(query,searchWords,filterCrates,window.currentCrate),params.go_to_first,filterCrates)}function buildIndex(rawSearchIndex){searchIndex=[];const searchWords=[];let i,word;let currentIndex=0;let id=0;for(const crate in rawSearchIndex){if(!hasOwnPropertyRustdoc(rawSearchIndex,crate)){continue}let crateSize=0;const crateCorpus=rawSearchIndex[crate];searchWords.push(crate);const crateRow={crate:crate,ty:1,name:crate,path:"",desc:crateCorpus.doc,parent:undefined,type:null,id:id,normalizedName:crate.indexOf("_")===-1?crate:crate.replace(/_/g,""),};id+=1;searchIndex.push(crateRow);currentIndex+=1;const itemTypes=crateCorpus.t;const itemNames=crateCorpus.n;const itemPaths=crateCorpus.q;const itemDescs=crateCorpus.d;const itemParentIdxs=crateCorpus.i;const itemFunctionSearchTypes=crateCorpus.f;const paths=crateCorpus.p;const aliases=crateCorpus.a;let len=paths.length;for(i=0;i0?paths[itemParentIdxs[i]-1]:undefined,type:itemFunctionSearchTypes[i],id:id,normalizedName:word.indexOf("_")===-1?word:word.replace(/_/g,""),};id+=1;searchIndex.push(row);lastPath=row.path;crateSize+=1}if(aliases){ALIASES[crate]=Object.create(null);for(const alias_name in aliases){if(!hasOwnPropertyRustdoc(aliases,alias_name)){continue}if(!hasOwnPropertyRustdoc(ALIASES[crate],alias_name)){ALIASES[crate][alias_name]=[]}for(const local_alias of aliases[alias_name]){ALIASES[crate][alias_name].push(local_alias+currentIndex)}}}currentIndex+=crateSize}return searchWords}function onSearchSubmit(e){e.preventDefault();searchState.clearInputTimeout();search()}function putBackSearch(){const search_input=searchState.input;if(!searchState.input){return}if(search_input.value!==""&&!searchState.isDisplayed()){searchState.showResults();if(browserSupportsHistoryApi()){history.replaceState(null,"",buildUrl(search_input.value,getFilterCrates()))}document.title=searchState.title}}function registerSearchEvents(){const params=searchState.getQueryStringParams();if(searchState.input.value===""){searchState.input.value=params.search||""}const searchAfter500ms=()=>{searchState.clearInputTimeout();if(searchState.input.value.length===0){if(browserSupportsHistoryApi()){history.replaceState(null,window.currentCrate+" - Rust",getNakedUrl()+window.location.hash)}searchState.hideResults()}else{searchState.timeout=setTimeout(search,500)}};searchState.input.onkeyup=searchAfter500ms;searchState.input.oninput=searchAfter500ms;document.getElementsByClassName("search-form")[0].onsubmit=onSearchSubmit;searchState.input.onchange=e=>{if(e.target!==document.activeElement){return}searchState.clearInputTimeout();setTimeout(search,0)};searchState.input.onpaste=searchState.input.onchange;searchState.outputElement().addEventListener("keydown",e=>{if(e.altKey||e.ctrlKey||e.shiftKey||e.metaKey){return}if(e.which===38){const previous=document.activeElement.previousElementSibling;if(previous){previous.focus()}else{searchState.focus()}e.preventDefault()}else if(e.which===40){const next=document.activeElement.nextElementSibling;if(next){next.focus()}const rect=document.activeElement.getBoundingClientRect();if(window.innerHeight-rect.bottom{if(e.which===40){focusSearchResult();e.preventDefault()}});searchState.input.addEventListener("focus",()=>{putBackSearch()});searchState.input.addEventListener("blur",()=>{searchState.input.placeholder=searchState.input.origPlaceholder});if(browserSupportsHistoryApi()){const previousTitle=document.title;window.addEventListener("popstate",e=>{const params=searchState.getQueryStringParams();document.title=previousTitle;currentResults=null;if(params.search&¶ms.search.length>0){searchState.input.value=params.search;search(e)}else{searchState.input.value="";searchState.hideResults()}})}window.onpageshow=()=>{const qSearch=searchState.getQueryStringParams().search;if(searchState.input.value===""&&qSearch){searchState.input.value=qSearch}search()}}function updateCrate(ev){if(ev.target.value==="All crates"){const params=searchState.getQueryStringParams();const query=searchState.input.value.trim();if(!history.state&&!params.search){history.pushState(null,"",buildUrl(query,null))}else{history.replaceState(null,"",buildUrl(query,null))}}currentResults=null;search(undefined,true)}const searchWords=buildIndex(rawSearchIndex);if(typeof window!=="undefined"){registerSearchEvents();if(window.searchState.getQueryStringParams().search){search()}}if(typeof exports!=="undefined"){exports.initSearch=initSearch;exports.execQuery=execQuery;exports.parseQuery=parseQuery}return searchWords}if(typeof window!=="undefined"){window.initSearch=initSearch;if(window.searchIndex!==undefined){initSearch(window.searchIndex)}}else{initSearch({})}})() \ No newline at end of file +"use strict";(function(){const itemTypes=["mod","externcrate","import","struct","enum","fn","type","static","trait","impl","tymethod","method","structfield","variant","macro","primitive","associatedtype","constant","associatedconstant","union","foreigntype","keyword","existential","attr","derive","traitalias",];const TY_PRIMITIVE=itemTypes.indexOf("primitive");const TY_KEYWORD=itemTypes.indexOf("keyword");const ROOT_PATH=typeof window!=="undefined"?window.rootPath:"../";function hasOwnPropertyRustdoc(obj,property){return Object.prototype.hasOwnProperty.call(obj,property)}function printTab(nb){let iter=0;let foundCurrentTab=false;let foundCurrentResultSet=false;onEachLazy(document.getElementById("titles").childNodes,elem=>{if(nb===iter){addClass(elem,"selected");foundCurrentTab=true}else{removeClass(elem,"selected")}iter+=1});iter=0;onEachLazy(document.getElementById("results").childNodes,elem=>{if(nb===iter){addClass(elem,"active");foundCurrentResultSet=true}else{removeClass(elem,"active")}iter+=1});if(foundCurrentTab&&foundCurrentResultSet){searchState.currentTab=nb}else if(nb!==0){printTab(0)}}const levenshtein_row2=[];function levenshtein(s1,s2){if(s1===s2){return 0}const s1_len=s1.length,s2_len=s2.length;if(s1_len&&s2_len){let i1=0,i2=0,a,b,c,c2;const row=levenshtein_row2;while(i1-".indexOf(c)!==-1}function isStopCharacter(c){return isWhitespace(c)||isEndCharacter(c)}function isErrorCharacter(c){return"()".indexOf(c)!==-1}function itemTypeFromName(typename){for(let i=0,len=itemTypes.length;i0){throw new Error("Cannot use literal search when there is more than one element")}parserState.pos+=1;const start=parserState.pos;const end=getIdentEndPosition(parserState);if(parserState.pos>=parserState.length){throw new Error("Unclosed `\"`")}else if(parserState.userQuery[end]!=="\""){throw new Error(`Unexpected \`${parserState.userQuery[end]}\` in a string element`)}else if(start===end){throw new Error("Cannot have empty string element")}parserState.pos+=1;query.literalSearch=true}function isPathStart(parserState){return parserState.userQuery.slice(parserState.pos,parserState.pos+2)==="::"}function isReturnArrow(parserState){return parserState.userQuery.slice(parserState.pos,parserState.pos+2)==="->"}function isIdentCharacter(c){return(c==="_"||(c>="0"&&c<="9")||(c>="a"&&c<="z")||(c>="A"&&c<="Z"))}function isSeparatorCharacter(c){return c===","||isWhitespaceCharacter(c)}function isWhitespaceCharacter(c){return c===" "||c==="\t"}function createQueryElement(query,parserState,name,generics,isInGenerics){if(name==="*"||(name.length===0&&generics.length===0)){return}if(query.literalSearch&&parserState.totalElems-parserState.genericsElems>0){throw new Error("You cannot have more than one element if you use quotes")}const pathSegments=name.split("::");if(pathSegments.length>1){for(let i=0,len=pathSegments.length;i=end){throw new Error("Found generics without a path")}parserState.pos+=1;getItemsBefore(query,parserState,generics,">")}if(start>=end&&generics.length===0){return}elems.push(createQueryElement(query,parserState,parserState.userQuery.slice(start,end),generics,isInGenerics))}function getItemsBefore(query,parserState,elems,endChar){let foundStopChar=true;while(parserState.pos"){extra="`<`"}else if(endChar===""){extra="`->`"}throw new Error("Unexpected `"+c+"` after "+extra)}if(!foundStopChar){if(endChar!==""){throw new Error(`Expected \`,\`, \` \` or \`${endChar}\`, found \`${c}\``)}throw new Error(`Expected \`,\` or \` \`, found \`${c}\``)}const posBefore=parserState.pos;getNextElem(query,parserState,elems,endChar===">");if(posBefore===parserState.pos){parserState.pos+=1}foundStopChar=false}parserState.pos+=1}function checkExtraTypeFilterCharacters(parserState){const query=parserState.userQuery;for(let pos=0;pos"){if(isReturnArrow(parserState)){break}throw new Error(`Unexpected \`${c}\` (did you mean \`->\`?)`)}throw new Error(`Unexpected \`${c}\``)}else if(c===":"&&!isPathStart(parserState)){if(parserState.typeFilter!==null){throw new Error("Unexpected `:`")}if(query.elems.length===0){throw new Error("Expected type filter before `:`")}else if(query.elems.length!==1||parserState.totalElems!==1){throw new Error("Unexpected `:`")}else if(query.literalSearch){throw new Error("You cannot use quotes on type filter")}checkExtraTypeFilterCharacters(parserState);parserState.typeFilter=query.elems.pop().name;parserState.pos+=1;parserState.totalElems=0;query.literalSearch=false;foundStopChar=true;continue}if(!foundStopChar){if(parserState.typeFilter!==null){throw new Error(`Expected \`,\`, \` \` or \`->\`, found \`${c}\``)}throw new Error(`Expected \`,\`, \` \`, \`:\` or \`->\`, found \`${c}\``)}before=query.elems.length;getNextElem(query,parserState,query.elems,false);if(query.elems.length===before){parserState.pos+=1}foundStopChar=false}while(parserState.pos`")}break}else{parserState.pos+=1}}}function newParsedQuery(userQuery){return{original:userQuery,userQuery:userQuery.toLowerCase(),typeFilter:NO_TYPE_FILTER,elems:[],returned:[],foundElems:0,literalSearch:false,error:null,}}function buildUrl(search,filterCrates){let extra="?search="+encodeURIComponent(search);if(filterCrates!==null){extra+="&filter-crate="+encodeURIComponent(filterCrates)}return getNakedUrl()+extra+window.location.hash}function getFilterCrates(){const elem=document.getElementById("crate-search");if(elem&&elem.value!=="all crates"&&hasOwnPropertyRustdoc(rawSearchIndex,elem.value)){return elem.value}return null}function parseQuery(userQuery){userQuery=userQuery.trim();const parserState={length:userQuery.length,pos:0,totalElems:0,genericsElems:0,typeFilter:null,userQuery:userQuery.toLowerCase(),};let query=newParsedQuery(userQuery);try{parseInput(query,parserState);if(parserState.typeFilter!==null){let typeFilter=parserState.typeFilter;if(typeFilter==="const"){typeFilter="constant"}query.typeFilter=itemTypeFromName(typeFilter)}}catch(err){query=newParsedQuery(userQuery);query.error=err.message;query.typeFilter=-1;return query}if(!query.literalSearch){query.literalSearch=parserState.totalElems>1}query.foundElems=query.elems.length+query.returned.length;return query}function createQueryResults(results_in_args,results_returned,results_others,parsedQuery){return{"in_args":results_in_args,"returned":results_returned,"others":results_others,"query":parsedQuery,}}function execQuery(parsedQuery,searchWords,filterCrates,currentCrate){const results_others={},results_in_args={},results_returned={};function transformResults(results){const duplicates={};const out=[];for(const result of results){if(result.id>-1){const obj=searchIndex[result.id];obj.lev=result.lev;const res=buildHrefAndPath(obj);obj.displayPath=pathSplitter(res[0]);obj.fullPath=obj.displayPath+obj.name;obj.fullPath+="|"+obj.ty;if(duplicates[obj.fullPath]){continue}duplicates[obj.fullPath]=true;obj.href=res[1];out.push(obj);if(out.length>=MAX_RESULTS){break}}}return out}function sortResults(results,isType,preferredCrate){const userQuery=parsedQuery.userQuery;const ar=[];for(const entry in results){if(hasOwnPropertyRustdoc(results,entry)){const result=results[entry];result.word=searchWords[result.id];result.item=searchIndex[result.id]||{};ar.push(result)}}results=ar;if(results.length===0){return[]}results.sort((aaa,bbb)=>{let a,b;a=(aaa.word!==userQuery);b=(bbb.word!==userQuery);if(a!==b){return a-b}a=(aaa.lev);b=(bbb.lev);if(a!==b){return a-b}a=(aaa.item.crate!==preferredCrate);b=(bbb.item.crate!==preferredCrate);if(a!==b){return a-b}a=aaa.word.length;b=bbb.word.length;if(a!==b){return a-b}a=aaa.word;b=bbb.word;if(a!==b){return(a>b?+1:-1)}a=(aaa.index<0);b=(bbb.index<0);if(a!==b){return a-b}a=aaa.index;b=bbb.index;if(a!==b){return a-b}if((aaa.item.ty===TY_PRIMITIVE&&bbb.item.ty!==TY_KEYWORD)||(aaa.item.ty===TY_KEYWORD&&bbb.item.ty!==TY_PRIMITIVE)){return-1}if((bbb.item.ty===TY_PRIMITIVE&&aaa.item.ty!==TY_PRIMITIVE)||(bbb.item.ty===TY_KEYWORD&&aaa.item.ty!==TY_KEYWORD)){return 1}a=(aaa.item.desc==="");b=(bbb.item.desc==="");if(a!==b){return a-b}a=aaa.item.ty;b=bbb.item.ty;if(a!==b){return a-b}a=aaa.item.path;b=bbb.item.path;if(a!==b){return(a>b?+1:-1)}return 0});let nameSplit=null;if(parsedQuery.elems.length===1){const hasPath=typeof parsedQuery.elems[0].path==="undefined";nameSplit=hasPath?null:parsedQuery.elems[0].path}for(const result of results){if(result.dontValidate){continue}const name=result.item.name.toLowerCase(),path=result.item.path.toLowerCase(),parent=result.item.parent;if(!isType&&!validateResult(name,path,nameSplit,parent)){result.id=-1}}return transformResults(results)}function checkGenerics(row,elem,defaultLev){if(row.generics.length===0){return elem.generics.length===0?defaultLev:MAX_LEV_DISTANCE+1}else if(row.generics.length>0&&row.generics[0].name===null){return checkGenerics(row.generics[0],elem,defaultLev)}let elem_name;if(elem.generics.length>0&&row.generics.length>=elem.generics.length){const elems=Object.create(null);for(const entry of row.generics){elem_name=entry.name;if(elem_name===""){if(checkGenerics(entry,elem,MAX_LEV_DISTANCE+1)!==0){return MAX_LEV_DISTANCE+1}continue}if(elems[elem_name]===undefined){elems[elem_name]=0}elems[elem_name]+=1}for(const generic of elem.generics){let match=null;if(elems[generic.name]){match=generic.name}else{for(elem_name in elems){if(!hasOwnPropertyRustdoc(elems,elem_name)){continue}if(elem_name===generic){match=elem_name;break}}}if(match===null){return MAX_LEV_DISTANCE+1}elems[match]-=1;if(elems[match]===0){delete elems[match]}}return 0}return MAX_LEV_DISTANCE+1}function checkIfInGenerics(row,elem){let lev=MAX_LEV_DISTANCE+1;for(const entry of row.generics){lev=Math.min(checkType(entry,elem,true),lev);if(lev===0){break}}return lev}function checkType(row,elem,literalSearch){if(row.name===null){if(row.generics.length>0){return checkIfInGenerics(row,elem)}return MAX_LEV_DISTANCE+1}let lev=levenshtein(row.name,elem.name);if(literalSearch){if(lev!==0){if(elem.generics.length===0){const checkGeneric=row.generics.length>0;if(checkGeneric&&row.generics.findIndex(tmp_elem=>tmp_elem.name===elem.name)!==-1){return 0}}return MAX_LEV_DISTANCE+1}else if(elem.generics.length>0){return checkGenerics(row,elem,MAX_LEV_DISTANCE+1)}return 0}else if(row.generics.length>0){if(elem.generics.length===0){if(lev===0){return 0}lev=checkIfInGenerics(row,elem);return lev+0.5}else if(lev>MAX_LEV_DISTANCE){return checkIfInGenerics(row,elem)}else{const tmp_lev=checkGenerics(row,elem,lev);if(tmp_lev>MAX_LEV_DISTANCE){return MAX_LEV_DISTANCE+1}return(tmp_lev+lev)/2}}else if(elem.generics.length>0){return MAX_LEV_DISTANCE+1}return lev}function findArg(row,elem,typeFilter){let lev=MAX_LEV_DISTANCE+1;if(row&&row.type&&row.type.inputs&&row.type.inputs.length>0){for(const input of row.type.inputs){if(!typePassesFilter(typeFilter,input.ty)){continue}lev=Math.min(lev,checkType(input,elem,parsedQuery.literalSearch));if(lev===0){return 0}}}return parsedQuery.literalSearch?MAX_LEV_DISTANCE+1:lev}function checkReturned(row,elem,typeFilter){let lev=MAX_LEV_DISTANCE+1;if(row&&row.type&&row.type.output.length>0){const ret=row.type.output;for(const ret_ty of ret){if(!typePassesFilter(typeFilter,ret_ty.ty)){continue}lev=Math.min(lev,checkType(ret_ty,elem,parsedQuery.literalSearch));if(lev===0){return 0}}}return parsedQuery.literalSearch?MAX_LEV_DISTANCE+1:lev}function checkPath(contains,ty){if(contains.length===0){return 0}let ret_lev=MAX_LEV_DISTANCE+1;const path=ty.path.split("::");if(ty.parent&&ty.parent.name){path.push(ty.parent.name.toLowerCase())}const length=path.length;const clength=contains.length;if(clength>length){return MAX_LEV_DISTANCE+1}for(let i=0;ilength){break}let lev_total=0;let aborted=false;for(let x=0;xMAX_LEV_DISTANCE){aborted=true;break}lev_total+=lev}if(!aborted){ret_lev=Math.min(ret_lev,Math.round(lev_total/clength))}}return ret_lev}function typePassesFilter(filter,type){if(filter<=NO_TYPE_FILTER||filter===type)return true;const name=itemTypes[type];switch(itemTypes[filter]){case"constant":return name==="associatedconstant";case"fn":return name==="method"||name==="tymethod";case"type":return name==="primitive"||name==="associatedtype";case"trait":return name==="traitalias"}return false}function createAliasFromItem(item){return{crate:item.crate,name:item.name,path:item.path,desc:item.desc,ty:item.ty,parent:item.parent,type:item.type,is_alias:true,}}function handleAliases(ret,query,filterCrates,currentCrate){const lowerQuery=query.toLowerCase();const aliases=[];const crateAliases=[];if(filterCrates!==null){if(ALIASES[filterCrates]&&ALIASES[filterCrates][lowerQuery]){const query_aliases=ALIASES[filterCrates][lowerQuery];for(const alias of query_aliases){aliases.push(createAliasFromItem(searchIndex[alias]))}}}else{Object.keys(ALIASES).forEach(crate=>{if(ALIASES[crate][lowerQuery]){const pushTo=crate===currentCrate?crateAliases:aliases;const query_aliases=ALIASES[crate][lowerQuery];for(const alias of query_aliases){pushTo.push(createAliasFromItem(searchIndex[alias]))}}})}const sortFunc=(aaa,bbb)=>{if(aaa.path{alias.alias=query;const res=buildHrefAndPath(alias);alias.displayPath=pathSplitter(res[0]);alias.fullPath=alias.displayPath+alias.name;alias.href=res[1];ret.others.unshift(alias);if(ret.others.length>MAX_RESULTS){ret.others.pop()}};aliases.forEach(pushFunc);crateAliases.forEach(pushFunc)}function addIntoResults(results,fullId,id,index,lev){if(lev===0||(!parsedQuery.literalSearch&&lev<=MAX_LEV_DISTANCE)){if(results[fullId]!==undefined){const result=results[fullId];if(result.dontValidate||result.lev<=lev){return}}results[fullId]={id:id,index:index,dontValidate:parsedQuery.literalSearch,lev:lev,}}}function handleSingleArg(row,pos,elem,results_others,results_in_args,results_returned){if(!row||(filterCrates!==null&&row.crate!==filterCrates)){return}let lev,lev_add=0,index=-1;const fullId=row.id;const in_args=findArg(row,elem,parsedQuery.typeFilter);const returned=checkReturned(row,elem,parsedQuery.typeFilter);addIntoResults(results_in_args,fullId,pos,index,in_args);addIntoResults(results_returned,fullId,pos,index,returned);if(!typePassesFilter(parsedQuery.typeFilter,row.ty)){return}const searchWord=searchWords[pos];if(parsedQuery.literalSearch){if(searchWord===elem.name){addIntoResults(results_others,fullId,pos,-1,0)}return}if(elem.name.length===0){if(row.type!==null){lev=checkGenerics(row.type,elem,MAX_LEV_DISTANCE+1);addIntoResults(results_others,fullId,pos,index,lev)}return}if(elem.fullPath.length>1){lev=checkPath(elem.pathWithoutLast,row);if(lev>MAX_LEV_DISTANCE||(parsedQuery.literalSearch&&lev!==0)){return}else if(lev>0){lev_add=lev/10}}if(searchWord.indexOf(elem.pathLast)>-1||row.normalizedName.indexOf(elem.pathLast)>-1){index=row.normalizedName.indexOf(elem.pathLast)}lev=levenshtein(searchWord,elem.pathLast);if(lev>0&&elem.pathLast.length>2&&searchWord.indexOf(elem.pathLast)>-1){if(elem.pathLast.length<6){lev=1}else{lev=0}}lev+=lev_add;if(lev>MAX_LEV_DISTANCE){return}else if(index!==-1&&elem.fullPath.length<2){lev-=1}if(lev<0){lev=0}addIntoResults(results_others,fullId,pos,index,lev)}function handleArgs(row,pos,results){if(!row||(filterCrates!==null&&row.crate!==filterCrates)){return}let totalLev=0;let nbLev=0;function checkArgs(elems,callback){for(const elem of elems){const lev=callback(row,elem,NO_TYPE_FILTER);if(lev<=1){nbLev+=1;totalLev+=lev}else{return false}}return true}if(!checkArgs(parsedQuery.elems,findArg)){return}if(!checkArgs(parsedQuery.returned,checkReturned)){return}if(nbLev===0){return}const lev=Math.round(totalLev/nbLev);addIntoResults(results,row.id,pos,0,lev)}function innerRunQuery(){let elem,i,nSearchWords,in_returned,row;if(parsedQuery.foundElems===1){if(parsedQuery.elems.length===1){elem=parsedQuery.elems[0];for(i=0,nSearchWords=searchWords.length;i0){for(i=0,nSearchWords=searchWords.length;i-1||path.indexOf(key)>-1||(parent!==undefined&&parent.name!==undefined&&parent.name.toLowerCase().indexOf(key)>-1)||levenshtein(name,key)<=MAX_LEV_DISTANCE)){return false}}return true}function nextTab(direction){const next=(searchState.currentTab+direction+3)%searchState.focusedByTab.length;searchState.focusedByTab[searchState.currentTab]=document.activeElement;printTab(next);focusSearchResult()}function focusSearchResult(){const target=searchState.focusedByTab[searchState.currentTab]||document.querySelectorAll(".search-results.active a").item(0)||document.querySelectorAll("#titles > button").item(searchState.currentTab);if(target){target.focus()}}function buildHrefAndPath(item){let displayPath;let href;const type=itemTypes[item.ty];const name=item.name;let path=item.path;if(type==="mod"){displayPath=path+"::";href=ROOT_PATH+path.replace(/::/g,"/")+"/"+name+"/index.html"}else if(type==="import"){displayPath=item.path+"::";href=ROOT_PATH+item.path.replace(/::/g,"/")+"/index.html#reexport."+name}else if(type==="primitive"||type==="keyword"){displayPath="";href=ROOT_PATH+path.replace(/::/g,"/")+"/"+type+"."+name+".html"}else if(type==="externcrate"){displayPath="";href=ROOT_PATH+name+"/index.html"}else if(item.parent!==undefined){const myparent=item.parent;let anchor="#"+type+"."+name;const parentType=itemTypes[myparent.ty];let pageType=parentType;let pageName=myparent.name;if(parentType==="primitive"){displayPath=myparent.name+"::"}else if(type==="structfield"&&parentType==="variant"){const enumNameIdx=item.path.lastIndexOf("::");const enumName=item.path.substr(enumNameIdx+2);path=item.path.substr(0,enumNameIdx);displayPath=path+"::"+enumName+"::"+myparent.name+"::";anchor="#variant."+myparent.name+".field."+name;pageType="enum";pageName=enumName}else{displayPath=path+"::"+myparent.name+"::"}href=ROOT_PATH+path.replace(/::/g,"/")+"/"+pageType+"."+pageName+".html"+anchor}else{displayPath=item.path+"::";href=ROOT_PATH+item.path.replace(/::/g,"/")+"/"+type+"."+name+".html"}return[displayPath,href]}function pathSplitter(path){const tmp=""+path.replace(/::/g,"::");if(tmp.endsWith("")){return tmp.slice(0,tmp.length-6)}return tmp}function addTab(array,query,display){let extraClass="";if(display===true){extraClass=" active"}const output=document.createElement("div");let length=0;if(array.length>0){output.className="search-results "+extraClass;array.forEach(item=>{const name=item.name;const type=itemTypes[item.ty];length+=1;let extra="";if(type==="primitive"){extra=" (primitive type)"}else if(type==="keyword"){extra=" (keyword)"}const link=document.createElement("a");link.className="result-"+type;link.href=item.href;const wrapper=document.createElement("div");const resultName=document.createElement("div");resultName.className="result-name";if(item.is_alias){const alias=document.createElement("span");alias.className="alias";const bold=document.createElement("b");bold.innerText=item.alias;alias.appendChild(bold);alias.insertAdjacentHTML("beforeend"," - see ");resultName.appendChild(alias)}resultName.insertAdjacentHTML("beforeend",item.displayPath+""+name+extra+"");wrapper.appendChild(resultName);const description=document.createElement("div");description.className="desc";const spanDesc=document.createElement("span");spanDesc.insertAdjacentHTML("beforeend",item.desc);description.appendChild(spanDesc);wrapper.appendChild(description);link.appendChild(wrapper);output.appendChild(link)})}else if(query.error===null){output.className="search-failed"+extraClass;output.innerHTML="No results :(
"+"Try on DuckDuckGo?

"+"Or try looking in one of these:"}return[output,length]}function makeTabHeader(tabNb,text,nbElems){if(searchState.currentTab===tabNb){return""}return""}function showResults(results,go_to_first,filterCrates){const search=searchState.outputElement();if(go_to_first||(results.others.length===1&&getSettingValue("go-to-only-result")==="true"&&(!search.firstChild||search.firstChild.innerText!==searchState.loadingText))){const elem=document.createElement("a");elem.href=results.others[0].href;removeClass(elem,"active");document.body.appendChild(elem);elem.click();return}if(results.query===undefined){results.query=parseQuery(searchState.input.value)}currentResults=results.query.userQuery;const ret_others=addTab(results.others,results.query,true);const ret_in_args=addTab(results.in_args,results.query,false);const ret_returned=addTab(results.returned,results.query,false);let currentTab=searchState.currentTab;if((currentTab===0&&ret_others[1]===0)||(currentTab===1&&ret_in_args[1]===0)||(currentTab===2&&ret_returned[1]===0)){if(ret_others[1]!==0){currentTab=0}else if(ret_in_args[1]!==0){currentTab=1}else if(ret_returned[1]!==0){currentTab=2}}let crates="";const crates_list=Object.keys(rawSearchIndex);if(crates_list.length>1){crates=" in 
"}let output=`

Results${crates}

`;if(results.query.error!==null){output+=`

Query parser error: "${results.query.error}".

`;output+="
"+makeTabHeader(0,"In Names",ret_others[1])+"
";currentTab=0}else if(results.query.foundElems<=1&&results.query.returned.length===0){output+="
"+makeTabHeader(0,"In Names",ret_others[1])+makeTabHeader(1,"In Parameters",ret_in_args[1])+makeTabHeader(2,"In Return Types",ret_returned[1])+"
"}else{const signatureTabTitle=results.query.elems.length===0?"In Function Return Types":results.query.returned.length===0?"In Function Parameters":"In Function Signatures";output+="
"+makeTabHeader(0,signatureTabTitle,ret_others[1])+"
";currentTab=0}const resultsElem=document.createElement("div");resultsElem.id="results";resultsElem.appendChild(ret_others[0]);resultsElem.appendChild(ret_in_args[0]);resultsElem.appendChild(ret_returned[0]);search.innerHTML=output;const crateSearch=document.getElementById("crate-search");if(crateSearch){crateSearch.addEventListener("input",updateCrate)}search.appendChild(resultsElem);searchState.showResults(search);const elems=document.getElementById("titles").childNodes;searchState.focusedByTab=[];let i=0;for(const elem of elems){const j=i;elem.onclick=()=>printTab(j);searchState.focusedByTab.push(null);i+=1}printTab(currentTab)}function search(e,forced){const params=searchState.getQueryStringParams();const query=parseQuery(searchState.input.value.trim());if(e){e.preventDefault()}if(!forced&&query.userQuery===currentResults){if(query.userQuery.length>0){putBackSearch()}return}let filterCrates=getFilterCrates();if(filterCrates===null&¶ms["filter-crate"]!==undefined){filterCrates=params["filter-crate"]}searchState.title="Results for "+query.original+" - Rust";if(browserSupportsHistoryApi()){const newURL=buildUrl(query.original,filterCrates);if(!history.state&&!params.search){history.pushState(null,"",newURL)}else{history.replaceState(null,"",newURL)}}showResults(execQuery(query,searchWords,filterCrates,window.currentCrate),params.go_to_first,filterCrates)}function buildItemSearchTypeAll(types,lowercasePaths){const PATH_INDEX_DATA=0;const GENERICS_DATA=1;return types.map(type=>{let pathIndex,generics;if(typeof type==="number"){pathIndex=type;generics=[]}else{pathIndex=type[PATH_INDEX_DATA];generics=buildItemSearchTypeAll(type[GENERICS_DATA],lowercasePaths)}return{name:pathIndex===0?null:lowercasePaths[pathIndex-1].name,ty:pathIndex===0?null:lowercasePaths[pathIndex-1].ty,generics:generics,}})}function buildFunctionSearchType(functionSearchType,lowercasePaths){const INPUTS_DATA=0;const OUTPUT_DATA=1;if(functionSearchType===0){return null}let inputs,output;if(typeof functionSearchType[INPUTS_DATA]==="number"){const pathIndex=functionSearchType[INPUTS_DATA];inputs=[{name:pathIndex===0?null:lowercasePaths[pathIndex-1].name,ty:pathIndex===0?null:lowercasePaths[pathIndex-1].ty,generics:[],}]}else{inputs=buildItemSearchTypeAll(functionSearchType[INPUTS_DATA],lowercasePaths)}if(functionSearchType.length>1){if(typeof functionSearchType[OUTPUT_DATA]==="number"){const pathIndex=functionSearchType[OUTPUT_DATA];output=[{name:pathIndex===0?null:lowercasePaths[pathIndex-1].name,ty:pathIndex===0?null:lowercasePaths[pathIndex-1].ty,generics:[],}]}else{output=buildItemSearchTypeAll(functionSearchType[OUTPUT_DATA],lowercasePaths)}}else{output=[]}return{inputs,output,}}function buildIndex(rawSearchIndex){searchIndex=[];const searchWords=[];let i,word;let currentIndex=0;let id=0;for(const crate in rawSearchIndex){if(!hasOwnPropertyRustdoc(rawSearchIndex,crate)){continue}let crateSize=0;const crateCorpus=rawSearchIndex[crate];searchWords.push(crate);const crateRow={crate:crate,ty:1,name:crate,path:"",desc:crateCorpus.doc,parent:undefined,type:null,id:id,normalizedName:crate.indexOf("_")===-1?crate:crate.replace(/_/g,""),};id+=1;searchIndex.push(crateRow);currentIndex+=1;const itemTypes=crateCorpus.t;const itemNames=crateCorpus.n;const itemPaths=crateCorpus.q;const itemDescs=crateCorpus.d;const itemParentIdxs=crateCorpus.i;const itemFunctionSearchTypes=crateCorpus.f;const paths=crateCorpus.p;const aliases=crateCorpus.a;const lowercasePaths=[];let len=paths.length;for(i=0;i0?paths[itemParentIdxs[i]-1]:undefined,type:buildFunctionSearchType(itemFunctionSearchTypes[i],lowercasePaths),id:id,normalizedName:word.indexOf("_")===-1?word:word.replace(/_/g,""),};id+=1;searchIndex.push(row);lastPath=row.path;crateSize+=1}if(aliases){ALIASES[crate]=Object.create(null);for(const alias_name in aliases){if(!hasOwnPropertyRustdoc(aliases,alias_name)){continue}if(!hasOwnPropertyRustdoc(ALIASES[crate],alias_name)){ALIASES[crate][alias_name]=[]}for(const local_alias of aliases[alias_name]){ALIASES[crate][alias_name].push(local_alias+currentIndex)}}}currentIndex+=crateSize}return searchWords}function onSearchSubmit(e){e.preventDefault();searchState.clearInputTimeout();search()}function putBackSearch(){const search_input=searchState.input;if(!searchState.input){return}if(search_input.value!==""&&!searchState.isDisplayed()){searchState.showResults();if(browserSupportsHistoryApi()){history.replaceState(null,"",buildUrl(search_input.value,getFilterCrates()))}document.title=searchState.title}}function registerSearchEvents(){const params=searchState.getQueryStringParams();if(searchState.input.value===""){searchState.input.value=params.search||""}const searchAfter500ms=()=>{searchState.clearInputTimeout();if(searchState.input.value.length===0){if(browserSupportsHistoryApi()){history.replaceState(null,window.currentCrate+" - Rust",getNakedUrl()+window.location.hash)}searchState.hideResults()}else{searchState.timeout=setTimeout(search,500)}};searchState.input.onkeyup=searchAfter500ms;searchState.input.oninput=searchAfter500ms;document.getElementsByClassName("search-form")[0].onsubmit=onSearchSubmit;searchState.input.onchange=e=>{if(e.target!==document.activeElement){return}searchState.clearInputTimeout();setTimeout(search,0)};searchState.input.onpaste=searchState.input.onchange;searchState.outputElement().addEventListener("keydown",e=>{if(e.altKey||e.ctrlKey||e.shiftKey||e.metaKey){return}if(e.which===38){const previous=document.activeElement.previousElementSibling;if(previous){previous.focus()}else{searchState.focus()}e.preventDefault()}else if(e.which===40){const next=document.activeElement.nextElementSibling;if(next){next.focus()}const rect=document.activeElement.getBoundingClientRect();if(window.innerHeight-rect.bottom{if(e.which===40){focusSearchResult();e.preventDefault()}});searchState.input.addEventListener("focus",()=>{putBackSearch()});searchState.input.addEventListener("blur",()=>{searchState.input.placeholder=searchState.input.origPlaceholder});if(browserSupportsHistoryApi()){const previousTitle=document.title;window.addEventListener("popstate",e=>{const params=searchState.getQueryStringParams();document.title=previousTitle;currentResults=null;if(params.search&¶ms.search.length>0){searchState.input.value=params.search;search(e)}else{searchState.input.value="";searchState.hideResults()}})}window.onpageshow=()=>{const qSearch=searchState.getQueryStringParams().search;if(searchState.input.value===""&&qSearch){searchState.input.value=qSearch}search()}}function updateCrate(ev){if(ev.target.value==="all crates"){const params=searchState.getQueryStringParams();const query=searchState.input.value.trim();if(!history.state&&!params.search){history.pushState(null,"",buildUrl(query,null))}else{history.replaceState(null,"",buildUrl(query,null))}}currentResults=null;search(undefined,true)}const searchWords=buildIndex(rawSearchIndex);if(typeof window!=="undefined"){registerSearchEvents();if(window.searchState.getQueryStringParams().search){search()}}if(typeof exports!=="undefined"){exports.initSearch=initSearch;exports.execQuery=execQuery;exports.parseQuery=parseQuery}return searchWords}if(typeof window!=="undefined"){window.initSearch=initSearch;if(window.searchIndex!==undefined){initSearch(window.searchIndex)}}else{initSearch({})}})() \ No newline at end of file diff --git a/settings.css b/settings.css index 2be35b2..a142e14 100644 --- a/settings.css +++ b/settings.css @@ -1 +1 @@ -.setting-line{margin:0.6em 0 0.6em 0.3em;position:relative;}.setting-line .choices{display:flex;flex-wrap:wrap;}.setting-line .radio-line input{margin-right:0.3em;height:1.2rem;width:1.2rem;border:1px solid;outline:none;-webkit-appearance:none;cursor:pointer;border-radius:50%;}.setting-line .radio-line input+span{padding-bottom:1px;}.radio-line .setting-name{width:100%;}.radio-line .choice{margin-top:0.1em;margin-bottom:0.1em;min-width:3.8em;padding:0.3em;display:flex;align-items:center;cursor:pointer;}.radio-line .choice+.choice{margin-left:0.5em;}.toggle{position:relative;display:inline-block;width:100%;height:27px;margin-right:20px;display:flex;align-items:center;cursor:pointer;}.toggle input{opacity:0;position:absolute;}.slider{position:relative;width:45px;display:block;height:28px;margin-right:20px;cursor:pointer;background-color:#ccc;transition:.3s;}.slider:before{position:absolute;content:"";height:19px;width:19px;left:4px;bottom:4px;transition:.3s;}input:checked+.slider:before{transform:translateX(19px);}.setting-line>.sub-settings{padding-left:42px;width:100%;display:block;}div#settings{position:absolute;right:0;z-index:1;display:block;margin-top:7px;border-radius:3px;border:1px solid;}#settings .setting-line{margin:1.2em 0.6em;}div#settings::before{content:'';position:absolute;right:11px;border:solid;border-width:1px 1px 0 0;display:inline-block;padding:4px;transform:rotate(-45deg);top:-5px;} \ No newline at end of file +.setting-line{margin:0.6em 0 0.6em 0.3em;position:relative;}.setting-line .choices{display:flex;flex-wrap:wrap;}.setting-line .radio-line input{margin-right:0.3em;height:1.2rem;width:1.2rem;border:1px solid;outline:none;-webkit-appearance:none;cursor:pointer;border-radius:50%;}.setting-line .radio-line input+span{padding-bottom:1px;}.radio-line .setting-name{width:100%;}.radio-line .choice{margin-top:0.1em;margin-bottom:0.1em;min-width:3.8em;padding:0.3em;display:flex;align-items:center;cursor:pointer;}.radio-line .choice+.choice{margin-left:0.5em;}.toggle{position:relative;width:100%;margin-right:20px;display:flex;align-items:center;cursor:pointer;}.toggle input{opacity:0;position:absolute;}.slider{position:relative;width:45px;min-width:45px;display:block;height:28px;margin-right:20px;cursor:pointer;background-color:#ccc;transition:.3s;}.slider:before{position:absolute;content:"";height:19px;width:19px;left:4px;bottom:4px;transition:.3s;}input:checked+.slider:before{transform:translateX(19px);}.setting-line>.sub-settings{padding-left:42px;width:100%;display:block;}#settings .setting-line{margin:1.2em 0.6em;} \ No newline at end of file diff --git a/settings.html b/settings.html index 01a401b..821391d 100644 --- a/settings.html +++ b/settings.html @@ -1,8 +1 @@ -Rustdoc settings -

Rustdoc settings

Back
- \ No newline at end of file +Rustdoc settings

Rustdoc settings

Back
\ No newline at end of file diff --git a/settings.js b/settings.js index 35d65a9..df27fca 100644 --- a/settings.js +++ b/settings.js @@ -8,4 +8,4 @@ \ \ ${setting_name}\ - `}output+=""}return output}function buildSettingsPage(){const themes=getVar("themes").split(",");const settings=[{"name":"Use system theme","js_name":"use-system-theme","default":true,},{"name":"Theme","js_name":"theme","default":"light","options":themes,},{"name":"Preferred light theme","js_name":"preferred-light-theme","default":"light","options":themes,},{"name":"Preferred dark theme","js_name":"preferred-dark-theme","default":"dark","options":themes,},{"name":"Auto-hide item contents for large items","js_name":"auto-hide-large-items","default":true,},{"name":"Auto-hide item methods' documentation","js_name":"auto-hide-method-docs","default":false,},{"name":"Auto-hide trait implementation documentation","js_name":"auto-hide-trait-implementations","default":false,},{"name":"Directly go to item in search if there is only one result","js_name":"go-to-only-result","default":false,},{"name":"Show line numbers on code examples","js_name":"line-numbers","default":false,},{"name":"Disable keyboard shortcuts","js_name":"disable-shortcuts","default":false,},];const elementKind=isSettingsPage?"section":"div";const innerHTML=`
${buildSettingsPageSections(settings)}
`;const el=document.createElement(elementKind);el.id="settings";el.innerHTML=innerHTML;if(isSettingsPage){document.getElementById(MAIN_ID).appendChild(el)}else{el.setAttribute("tabindex","-1");getSettingsButton().appendChild(el)}return el}const settingsMenu=buildSettingsPage();function displaySettings(){settingsMenu.style.display=""}function elemIsInParent(elem,parent){while(elem&&elem!==document.body){if(elem===parent){return true}elem=elem.parentElement}return false}function blurHandler(event){const settingsButton=getSettingsButton();if(!elemIsInParent(document.activeElement,settingsButton)&&!elemIsInParent(event.relatedTarget,settingsButton)){window.hideSettings()}}if(isSettingsPage){getSettingsButton().onclick=function(event){event.preventDefault()}}else{const settingsButton=getSettingsButton();const settingsMenu=document.getElementById("settings");window.hideSettings=function(){settingsMenu.style.display="none"};settingsButton.onclick=function(event){if(elemIsInParent(event.target,settingsMenu)){return}event.preventDefault();if(settingsMenu.style.display!=="none"){window.hideSettings()}else{displaySettings()}};settingsButton.onblur=blurHandler;settingsButton.querySelector("a").onblur=blurHandler;onEachLazy(settingsMenu.querySelectorAll("input"),el=>{el.onblur=blurHandler});settingsMenu.onblur=blurHandler}setTimeout(()=>{setEvents(settingsMenu);if(!isSettingsPage){displaySettings()}removeClass(getSettingsButton(),"rotate")},0)})() \ No newline at end of file + `}output+=""}return output}function buildSettingsPage(){const themes=getVar("themes").split(",");const settings=[{"name":"Use system theme","js_name":"use-system-theme","default":true,},{"name":"Theme","js_name":"theme","default":"light","options":themes,},{"name":"Preferred light theme","js_name":"preferred-light-theme","default":"light","options":themes,},{"name":"Preferred dark theme","js_name":"preferred-dark-theme","default":"dark","options":themes,},{"name":"Auto-hide item contents for large items","js_name":"auto-hide-large-items","default":true,},{"name":"Auto-hide item methods' documentation","js_name":"auto-hide-method-docs","default":false,},{"name":"Auto-hide trait implementation documentation","js_name":"auto-hide-trait-implementations","default":false,},{"name":"Directly go to item in search if there is only one result","js_name":"go-to-only-result","default":false,},{"name":"Show line numbers on code examples","js_name":"line-numbers","default":false,},{"name":"Disable keyboard shortcuts","js_name":"disable-shortcuts","default":false,},];const elementKind=isSettingsPage?"section":"div";const innerHTML=`
${buildSettingsPageSections(settings)}
`;const el=document.createElement(elementKind);el.id="settings";el.className="popover";el.innerHTML=innerHTML;if(isSettingsPage){document.getElementById(MAIN_ID).appendChild(el)}else{el.setAttribute("tabindex","-1");getSettingsButton().appendChild(el)}return el}const settingsMenu=buildSettingsPage();function displaySettings(){settingsMenu.style.display=""}function settingsBlurHandler(event){blurHandler(event,getSettingsButton(),window.hidePopoverMenus)}if(isSettingsPage){getSettingsButton().onclick=function(event){event.preventDefault()}}else{const settingsButton=getSettingsButton();const settingsMenu=document.getElementById("settings");settingsButton.onclick=function(event){if(elemIsInParent(event.target,settingsMenu)){return}event.preventDefault();const shouldDisplaySettings=settingsMenu.style.display==="none";window.hidePopoverMenus();if(shouldDisplaySettings){displaySettings()}};settingsButton.onblur=settingsBlurHandler;settingsButton.querySelector("a").onblur=settingsBlurHandler;onEachLazy(settingsMenu.querySelectorAll("input"),el=>{el.onblur=settingsBlurHandler});settingsMenu.onblur=settingsBlurHandler}setTimeout(()=>{setEvents(settingsMenu);if(!isSettingsPage){displaySettings()}removeClass(getSettingsButton(),"rotate")},0)})() \ No newline at end of file diff --git a/source-files.js b/source-files.js index 7bfac52..9805f14 100644 --- a/source-files.js +++ b/source-files.js @@ -1,3 +1,4 @@ -var sourcesIndex = {}; -sourcesIndex["llvm_kaleidoscope_rs"] = {"name":"","dirs":[{"name":"llvm","files":["basic_block.rs","builder.rs","lljit.rs","mod.rs","module.rs","pass_manager.rs","type_.rs","value.rs"]}],"files":["codegen.rs","lexer.rs","lib.rs","parser.rs"]}; +var sourcesIndex = JSON.parse('{\ +"llvm_kaleidoscope_rs":["",[["llvm",[],["basic_block.rs","builder.rs","lljit.rs","mod.rs","module.rs","pass_manager.rs","type_.rs","value.rs"]]],["codegen.rs","lexer.rs","lib.rs","parser.rs"]]\ +}'); createSourceSidebar(); diff --git a/source-script.js b/source-script.js index c885670..3866dfd 100644 --- a/source-script.js +++ b/source-script.js @@ -1 +1 @@ -"use strict";(function(){const rootPath=document.getElementById("rustdoc-vars").attributes["data-root-path"].value;function createDirEntry(elem,parent,fullPath,hasFoundFile){const name=document.createElement("div");name.className="name";fullPath+=elem["name"]+"/";name.onclick=ev=>{if(hasClass(ev.target,"expand")){removeClass(ev.target,"expand")}else{addClass(ev.target,"expand")}};name.innerText=elem["name"];const children=document.createElement("div");children.className="children";const folders=document.createElement("div");folders.className="folders";if(elem.dirs){for(const dir of elem.dirs){if(createDirEntry(dir,folders,fullPath,hasFoundFile)){addClass(name,"expand");hasFoundFile=true}}}children.appendChild(folders);const files=document.createElement("div");files.className="files";if(elem.files){for(const file_text of elem.files){const file=document.createElement("a");file.innerText=file_text;file.href=rootPath+"src/"+fullPath+file_text+".html";const w=window.location.href.split("#")[0];if(!hasFoundFile&&w===file.href){file.className="selected";addClass(name,"expand");hasFoundFile=true}files.appendChild(file)}}children.appendChild(files);parent.appendChild(name);parent.appendChild(children);return hasFoundFile}function toggleSidebar(){const child=this.children[0];if(child.innerText===">"){addClass(document.documentElement,"source-sidebar-expanded");child.innerText="<";updateLocalStorage("source-sidebar-show","true")}else{removeClass(document.documentElement,"source-sidebar-expanded");child.innerText=">";updateLocalStorage("source-sidebar-show","false")}}function createSidebarToggle(){const sidebarToggle=document.createElement("div");sidebarToggle.id="sidebar-toggle";sidebarToggle.onclick=toggleSidebar;const inner=document.createElement("div");if(getCurrentValue("source-sidebar-show")==="true"){inner.innerText="<"}else{inner.innerText=">"}sidebarToggle.appendChild(inner);return sidebarToggle}function createSourceSidebar(){const container=document.querySelector("nav.sidebar");const sidebarToggle=createSidebarToggle();container.insertBefore(sidebarToggle,container.firstChild);const sidebar=document.createElement("div");sidebar.id="source-sidebar";let hasFoundFile=false;const title=document.createElement("div");title.className="title";title.innerText="Files";sidebar.appendChild(title);Object.keys(sourcesIndex).forEach(key=>{sourcesIndex[key].name=key;hasFoundFile=createDirEntry(sourcesIndex[key],sidebar,"",hasFoundFile)});container.appendChild(sidebar);const selected_elem=sidebar.getElementsByClassName("selected")[0];if(typeof selected_elem!=="undefined"){selected_elem.focus()}}const lineNumbersRegex=/^#?(\d+)(?:-(\d+))?$/;function highlightSourceLines(match){if(typeof match==="undefined"){match=window.location.hash.match(lineNumbersRegex)}if(!match){return}let from=parseInt(match[1],10);let to=from;if(typeof match[2]!=="undefined"){to=parseInt(match[2],10)}if(to{onEachLazy(e.getElementsByTagName("span"),i_e=>{removeClass(i_e,"line-highlighted")})});for(let i=from;i<=to;++i){elem=document.getElementById(i);if(!elem){break}addClass(elem,"line-highlighted")}}const handleSourceHighlight=(function(){let prev_line_id=0;const set_fragment=name=>{const x=window.scrollX,y=window.scrollY;if(browserSupportsHistoryApi()){history.replaceState(null,null,"#"+name);highlightSourceLines()}else{location.replace("#"+name)}window.scrollTo(x,y)};return ev=>{let cur_line_id=parseInt(ev.target.id,10);if(isNaN(cur_line_id)){return}ev.preventDefault();if(ev.shiftKey&&prev_line_id){if(prev_line_id>cur_line_id){const tmp=prev_line_id;prev_line_id=cur_line_id;cur_line_id=tmp}set_fragment(prev_line_id+"-"+cur_line_id)}else{prev_line_id=cur_line_id;set_fragment(cur_line_id)}}}());window.addEventListener("hashchange",()=>{const match=window.location.hash.match(lineNumbersRegex);if(match){return highlightSourceLines(match)}});onEachLazy(document.getElementsByClassName("line-numbers"),el=>{el.addEventListener("click",handleSourceHighlight)});highlightSourceLines();window.createSourceSidebar=createSourceSidebar})() \ No newline at end of file +"use strict";(function(){const rootPath=document.getElementById("rustdoc-vars").attributes["data-root-path"].value;let oldScrollPosition=null;const NAME_OFFSET=0;const DIRS_OFFSET=1;const FILES_OFFSET=2;function closeSidebarIfMobile(){if(window.innerWidth"){if(window.innerWidth";updateLocalStorage("source-sidebar-show","false")}}window.addEventListener("resize",()=>{if(window.innerWidth>=window.RUSTDOC_MOBILE_BREAKPOINT&&oldScrollPosition!==null){document.body.style.position="";document.body.style.top="";window.scrollTo(0,oldScrollPosition);oldScrollPosition=null}});function createSidebarToggle(){const sidebarToggle=document.createElement("div");sidebarToggle.id="sidebar-toggle";const inner=document.createElement("button");if(getCurrentValue("source-sidebar-show")==="true"){inner.innerText="<"}else{inner.innerText=">"}inner.onclick=toggleSidebar;sidebarToggle.appendChild(inner);return sidebarToggle}function createSourceSidebar(){const container=document.querySelector("nav.sidebar");const sidebarToggle=createSidebarToggle();container.insertBefore(sidebarToggle,container.firstChild);const sidebar=document.createElement("div");sidebar.id="source-sidebar";let hasFoundFile=false;const title=document.createElement("div");title.className="title";title.innerText="Files";sidebar.appendChild(title);Object.keys(sourcesIndex).forEach(key=>{sourcesIndex[key][NAME_OFFSET]=key;hasFoundFile=createDirEntry(sourcesIndex[key],sidebar,"",hasFoundFile)});container.appendChild(sidebar);const selected_elem=sidebar.getElementsByClassName("selected")[0];if(typeof selected_elem!=="undefined"){selected_elem.focus()}}const lineNumbersRegex=/^#?(\d+)(?:-(\d+))?$/;function highlightSourceLines(match){if(typeof match==="undefined"){match=window.location.hash.match(lineNumbersRegex)}if(!match){return}let from=parseInt(match[1],10);let to=from;if(typeof match[2]!=="undefined"){to=parseInt(match[2],10)}if(to{onEachLazy(e.getElementsByTagName("span"),i_e=>{removeClass(i_e,"line-highlighted")})});for(let i=from;i<=to;++i){elem=document.getElementById(i);if(!elem){break}addClass(elem,"line-highlighted")}}const handleSourceHighlight=(function(){let prev_line_id=0;const set_fragment=name=>{const x=window.scrollX,y=window.scrollY;if(browserSupportsHistoryApi()){history.replaceState(null,null,"#"+name);highlightSourceLines()}else{location.replace("#"+name)}window.scrollTo(x,y)};return ev=>{let cur_line_id=parseInt(ev.target.id,10);if(isNaN(cur_line_id)){return}ev.preventDefault();if(ev.shiftKey&&prev_line_id){if(prev_line_id>cur_line_id){const tmp=prev_line_id;prev_line_id=cur_line_id;cur_line_id=tmp}set_fragment(prev_line_id+"-"+cur_line_id)}else{prev_line_id=cur_line_id;set_fragment(cur_line_id)}}}());window.addEventListener("hashchange",()=>{const match=window.location.hash.match(lineNumbersRegex);if(match){return highlightSourceLines(match)}});onEachLazy(document.getElementsByClassName("line-numbers"),el=>{el.addEventListener("click",handleSourceHighlight)});highlightSourceLines();window.createSourceSidebar=createSourceSidebar})() \ No newline at end of file diff --git a/src/llvm_kaleidoscope_rs/codegen.rs.html b/src/llvm_kaleidoscope_rs/codegen.rs.html index 44ee848..f802910 100644 --- a/src/llvm_kaleidoscope_rs/codegen.rs.html +++ b/src/llvm_kaleidoscope_rs/codegen.rs.html @@ -1,10 +1,4 @@ -codegen.rs - source -
1
+codegen.rs - source
1
 2
 3
 4
@@ -326,328 +320,327 @@
 320
 321
 322
-
use std::collections::HashMap;
+
use std::collections::HashMap;
 
-use crate::llvm::{FnValue, FunctionPassManager, IRBuilder, Module, Value};
-use crate::parser::{ExprAST, FunctionAST, PrototypeAST};
-use crate::Either;
+use crate::llvm::{FnValue, FunctionPassManager, IRBuilder, Module, Value};
+use crate::parser::{ExprAST, FunctionAST, PrototypeAST};
+use crate::Either;
 
-type CodegenResult<T> = Result<T, String>;
+type CodegenResult<T> = Result<T, String>;
 
-/// Code generator from kaleidoscope AST to LLVM IR.
-pub struct Codegen<'llvm, 'a> {
-    module: &'llvm Module,
-    builder: &'a IRBuilder<'llvm>,
-    fpm: &'a FunctionPassManager<'llvm>,
-    fn_protos: &'a mut HashMap<String, PrototypeAST>,
+/// Code generator from kaleidoscope AST to LLVM IR.
+pub struct Codegen<'llvm, 'a> {
+    module: &'llvm Module,
+    builder: &'a IRBuilder<'llvm>,
+    fpm: &'a FunctionPassManager<'llvm>,
+    fn_protos: &'a mut HashMap<String, PrototypeAST>,
 }
 
-impl<'llvm, 'a> Codegen<'llvm, 'a> {
-    /// Compile either a [`PrototypeAST`] or a [`FunctionAST`] into the LLVM `module`.
-    pub fn compile(
-        module: &'llvm Module,
-        fn_protos: &mut HashMap<String, PrototypeAST>,
-        compilee: Either<&PrototypeAST, &FunctionAST>,
-    ) -> CodegenResult<FnValue<'llvm>> {
-        let mut cg = Codegen {
-            module,
-            builder: &IRBuilder::with_ctx(module),
-            fpm: &FunctionPassManager::with_ctx(module),
-            fn_protos,
+impl<'llvm, 'a> Codegen<'llvm, 'a> {
+    /// Compile either a [`PrototypeAST`] or a [`FunctionAST`] into the LLVM `module`.
+    pub fn compile(
+        module: &'llvm Module,
+        fn_protos: &mut HashMap<String, PrototypeAST>,
+        compilee: Either<&PrototypeAST, &FunctionAST>,
+    ) -> CodegenResult<FnValue<'llvm>> {
+        let mut cg = Codegen {
+            module,
+            builder: &IRBuilder::with_ctx(module),
+            fpm: &FunctionPassManager::with_ctx(module),
+            fn_protos,
         };
-        let mut variables = HashMap::new();
+        let mut variables = HashMap::new();
 
-        match compilee {
-            Either::A(proto) => Ok(cg.codegen_prototype(proto)),
-            Either::B(func) => cg.codegen_function(func, &mut variables),
+        match compilee {
+            Either::A(proto) => Ok(cg.codegen_prototype(proto)),
+            Either::B(func) => cg.codegen_function(func, &mut variables),
         }
     }
 
-    fn codegen_expr(
+    fn codegen_expr(
         &self,
-        expr: &ExprAST,
-        named_values: &mut HashMap<String, Value<'llvm>>,
-    ) -> CodegenResult<Value<'llvm>> {
-        match expr {
-            ExprAST::Number(num) => Ok(self.module.type_f64().const_f64(*num)),
-            ExprAST::Variable(name) => match named_values.get(name.as_str()) {
-                Some(value) => Ok(*value),
-                None => Err("Unknown variable name".into()),
+        expr: &ExprAST,
+        named_values: &mut HashMap<String, Value<'llvm>>,
+    ) -> CodegenResult<Value<'llvm>> {
+        match expr {
+            ExprAST::Number(num) => Ok(self.module.type_f64().const_f64(*num)),
+            ExprAST::Variable(name) => match named_values.get(name.as_str()) {
+                Some(value) => Ok(*value),
+                None => Err("Unknown variable name".into()),
             },
-            ExprAST::Binary(binop, lhs, rhs) => {
-                let l = self.codegen_expr(lhs, named_values)?;
-                let r = self.codegen_expr(rhs, named_values)?;
-
-                match binop {
-                    '+' => Ok(self.builder.fadd(l, r)),
-                    '-' => Ok(self.builder.fsub(l, r)),
-                    '*' => Ok(self.builder.fmul(l, r)),
-                    '<' => {
-                        let res = self.builder.fcmpult(l, r);
-                        // Turn bool into f64.
-                        Ok(self.builder.uitofp(res, self.module.type_f64()))
+            ExprAST::Binary(binop, lhs, rhs) => {
+                let l = self.codegen_expr(lhs, named_values)?;
+                let r = self.codegen_expr(rhs, named_values)?;
+
+                match binop {
+                    '+' => Ok(self.builder.fadd(l, r)),
+                    '-' => Ok(self.builder.fsub(l, r)),
+                    '*' => Ok(self.builder.fmul(l, r)),
+                    '<' => {
+                        let res = self.builder.fcmpult(l, r);
+                        // Turn bool into f64.
+                        Ok(self.builder.uitofp(res, self.module.type_f64()))
                     }
-                    _ => Err("invalid binary operator".into()),
+                    _ => Err("invalid binary operator".into()),
                 }
             }
-            ExprAST::Call(callee, args) => match self.get_function(callee) {
-                Some(callee) => {
-                    if callee.args() != args.len() {
-                        return Err("Incorrect # arguments passed".into());
+            ExprAST::Call(callee, args) => match self.get_function(callee) {
+                Some(callee) => {
+                    if callee.args() != args.len() {
+                        return Err("Incorrect # arguments passed".into());
                     }
 
-                    // Generate code for function argument expressions.
-                    let mut args: Vec<Value<'_>> = args
-                        .iter()
-                        .map(|arg| self.codegen_expr(arg, named_values))
-                        .collect::<CodegenResult<_>>()?;
+                    // Generate code for function argument expressions.
+                    let mut args: Vec<Value<'_>> = args
+                        .iter()
+                        .map(|arg| self.codegen_expr(arg, named_values))
+                        .collect::<CodegenResult<_>>()?;
 
-                    Ok(self.builder.call(callee, &mut args))
+                    Ok(self.builder.call(callee, &mut args))
                 }
-                None => Err("Unknown function referenced".into()),
+                None => Err("Unknown function referenced".into()),
             },
-            ExprAST::If { cond, then, else_ } => {
-                // For 'if' expressions we are building the following CFG.
-                //
-                //         ; cond
-                //         br
-                //          |
-                //    +-----+------+
-                //    v            v
-                //  ; then       ; else
-                //    |            |
-                //    +-----+------+
-                //          v
-                //        ; merge
-                //        phi then, else
-                //        ret phi
-
-                let cond_v = {
-                    // Codgen 'cond' expression.
-                    let v = self.codegen_expr(cond, named_values)?;
-                    // Compare 'v' against '0' as 'one = ordered not equal'.
-                    self.builder
-                        .fcmpone(v, self.module.type_f64().const_f64(0f64))
+            ExprAST::If { cond, then, else_ } => {
+                // For 'if' expressions we are building the following CFG.
+                //
+                //         ; cond
+                //         br
+                //          |
+                //    +-----+------+
+                //    v            v
+                //  ; then       ; else
+                //    |            |
+                //    +-----+------+
+                //          v
+                //        ; merge
+                //        phi then, else
+                //        ret phi
+
+                let cond_v = {
+                    // Codgen 'cond' expression.
+                    let v = self.codegen_expr(cond, named_values)?;
+                    // Compare 'v' against '0' as 'one = ordered not equal'.
+                    self.builder
+                        .fcmpone(v, self.module.type_f64().const_f64(0f64))
                 };
 
-                // Get the function we are currently inserting into.
-                let the_function = self.builder.get_insert_block().get_parent();
-
-                // Create basic blocks for the 'then' / 'else' expressions as well as the return
-                // instruction ('merge').
-                //
-                // Append the 'then' basic block to the function, don't insert the 'else' and
-                // 'merge' basic blocks yet.
-                let then_bb = self.module.append_basic_block(the_function);
-                let else_bb = self.module.create_basic_block();
-                let merge_bb = self.module.create_basic_block();
-
-                // Create a conditional branch based on the result of the 'cond' expression.
-                self.builder.cond_br(cond_v, then_bb, else_bb);
-
-                // Move to 'then' basic block and codgen the 'then' expression.
-                self.builder.pos_at_end(then_bb);
-                let then_v = self.codegen_expr(then, named_values)?;
-                // Create unconditional branch to 'merge' block.
-                self.builder.br(merge_bb);
-                // Update reference to current basic block (in case the 'then' expression added new
-                // basic blocks).
-                let then_bb = self.builder.get_insert_block();
-
-                // Now append the 'else' basic block to the function.
-                the_function.append_basic_block(else_bb);
-                // Move to 'else' basic block and codgen the 'else' expression.
-                self.builder.pos_at_end(else_bb);
-                let else_v = self.codegen_expr(else_, named_values)?;
-                // Create unconditional branch to 'merge' block.
-                self.builder.br(merge_bb);
-                // Update reference to current basic block (in case the 'else' expression added new
-                // basic blocks).
-                let else_bb = self.builder.get_insert_block();
-
-                // Now append the 'merge' basic block to the function.
-                the_function.append_basic_block(merge_bb);
-                // Move to 'merge' basic block.
-                self.builder.pos_at_end(merge_bb);
-                // Codegen the phi node returning the appropriate value depending on the branch
-                // condition.
-                let phi = self.builder.phi(
-                    self.module.type_f64(),
-                    &[(then_v, then_bb), (else_v, else_bb)],
+                // Get the function we are currently inserting into.
+                let the_function = self.builder.get_insert_block().get_parent();
+
+                // Create basic blocks for the 'then' / 'else' expressions as well as the return
+                // instruction ('merge').
+                //
+                // Append the 'then' basic block to the function, don't insert the 'else' and
+                // 'merge' basic blocks yet.
+                let then_bb = self.module.append_basic_block(the_function);
+                let else_bb = self.module.create_basic_block();
+                let merge_bb = self.module.create_basic_block();
+
+                // Create a conditional branch based on the result of the 'cond' expression.
+                self.builder.cond_br(cond_v, then_bb, else_bb);
+
+                // Move to 'then' basic block and codgen the 'then' expression.
+                self.builder.pos_at_end(then_bb);
+                let then_v = self.codegen_expr(then, named_values)?;
+                // Create unconditional branch to 'merge' block.
+                self.builder.br(merge_bb);
+                // Update reference to current basic block (in case the 'then' expression added new
+                // basic blocks).
+                let then_bb = self.builder.get_insert_block();
+
+                // Now append the 'else' basic block to the function.
+                the_function.append_basic_block(else_bb);
+                // Move to 'else' basic block and codgen the 'else' expression.
+                self.builder.pos_at_end(else_bb);
+                let else_v = self.codegen_expr(else_, named_values)?;
+                // Create unconditional branch to 'merge' block.
+                self.builder.br(merge_bb);
+                // Update reference to current basic block (in case the 'else' expression added new
+                // basic blocks).
+                let else_bb = self.builder.get_insert_block();
+
+                // Now append the 'merge' basic block to the function.
+                the_function.append_basic_block(merge_bb);
+                // Move to 'merge' basic block.
+                self.builder.pos_at_end(merge_bb);
+                // Codegen the phi node returning the appropriate value depending on the branch
+                // condition.
+                let phi = self.builder.phi(
+                    self.module.type_f64(),
+                    &[(then_v, then_bb), (else_v, else_bb)],
                 );
 
-                Ok(*phi)
+                Ok(*phi)
             }
-            ExprAST::For {
-                var,
-                start,
-                end,
-                step,
-                body,
+            ExprAST::For {
+                var,
+                start,
+                end,
+                step,
+                body,
             } => {
-                // For 'for' expression we build the following structure.
-                //
-                // entry:
-                //   init = start expression
-                //   br loop
-                // loop:
-                //   i = phi [%init, %entry], [%new_i, %loop]
-                //   ; loop body ...
-                //   new_i = increment %i by step expression
-                //   ; check end condition and branch
-                // end:
-
-                // Compute initial value for the loop variable.
-                let start_val = self.codegen_expr(start, named_values)?;
-
-                let the_function = self.builder.get_insert_block().get_parent();
-                // Get current basic block (used in the loop variable phi node).
-                let entry_bb = self.builder.get_insert_block();
-                // Add new basic block to emit loop body.
-                let loop_bb = self.module.append_basic_block(the_function);
-
-                self.builder.br(loop_bb);
-                self.builder.pos_at_end(loop_bb);
-
-                // Build phi not to pick loop variable in case we come from the 'entry' block.
-                // Which is the case when we enter the loop for the first time.
-                // We will add another incoming value once we computed the updated loop variable
-                // below.
-                let variable = self
-                    .builder
-                    .phi(self.module.type_f64(), &[(start_val, entry_bb)]);
-
-                // Insert the loop variable into the named values map that it can be referenced
-                // from the body as well as the end condition.
-                // In case the loop variable shadows an existing variable remember the shared one.
-                let old_val = named_values.insert(var.into(), *variable);
-
-                // Generate the loop body.
-                self.codegen_expr(body, named_values)?;
-
-                // Generate step value expression if available else use '1'.
-                let step_val = if let Some(step) = step {
-                    self.codegen_expr(step, named_values)?
-                } else {
-                    self.module.type_f64().const_f64(1f64)
+                // For 'for' expression we build the following structure.
+                //
+                // entry:
+                //   init = start expression
+                //   br loop
+                // loop:
+                //   i = phi [%init, %entry], [%new_i, %loop]
+                //   ; loop body ...
+                //   new_i = increment %i by step expression
+                //   ; check end condition and branch
+                // end:
+
+                // Compute initial value for the loop variable.
+                let start_val = self.codegen_expr(start, named_values)?;
+
+                let the_function = self.builder.get_insert_block().get_parent();
+                // Get current basic block (used in the loop variable phi node).
+                let entry_bb = self.builder.get_insert_block();
+                // Add new basic block to emit loop body.
+                let loop_bb = self.module.append_basic_block(the_function);
+
+                self.builder.br(loop_bb);
+                self.builder.pos_at_end(loop_bb);
+
+                // Build phi not to pick loop variable in case we come from the 'entry' block.
+                // Which is the case when we enter the loop for the first time.
+                // We will add another incoming value once we computed the updated loop variable
+                // below.
+                let variable = self
+                    .builder
+                    .phi(self.module.type_f64(), &[(start_val, entry_bb)]);
+
+                // Insert the loop variable into the named values map that it can be referenced
+                // from the body as well as the end condition.
+                // In case the loop variable shadows an existing variable remember the shared one.
+                let old_val = named_values.insert(var.into(), *variable);
+
+                // Generate the loop body.
+                self.codegen_expr(body, named_values)?;
+
+                // Generate step value expression if available else use '1'.
+                let step_val = if let Some(step) = step {
+                    self.codegen_expr(step, named_values)?
+                } else {
+                    self.module.type_f64().const_f64(1f64)
                 };
 
-                // Increment loop variable.
-                let next_var = self.builder.fadd(*variable, step_val);
+                // Increment loop variable.
+                let next_var = self.builder.fadd(*variable, step_val);
 
-                // Generate the loop end condition.
-                let end_cond = self.codegen_expr(end, named_values)?;
-                let end_cond = self
-                    .builder
-                    .fcmpone(end_cond, self.module.type_f64().const_f64(0f64));
+                // Generate the loop end condition.
+                let end_cond = self.codegen_expr(end, named_values)?;
+                let end_cond = self
+                    .builder
+                    .fcmpone(end_cond, self.module.type_f64().const_f64(0f64));
 
-                // Get current basic block.
-                let loop_end_bb = self.builder.get_insert_block();
-                // Add new basic block following the loop.
-                let after_bb = self.module.append_basic_block(the_function);
+                // Get current basic block.
+                let loop_end_bb = self.builder.get_insert_block();
+                // Add new basic block following the loop.
+                let after_bb = self.module.append_basic_block(the_function);
 
-                // Register additional incoming value for the loop variable. This will choose the
-                // updated loop variable if we are iterating in the loop.
-                variable.add_incoming(next_var, loop_end_bb);
+                // Register additional incoming value for the loop variable. This will choose the
+                // updated loop variable if we are iterating in the loop.
+                variable.add_incoming(next_var, loop_end_bb);
 
-                // Branch depending on the loop end condition.
-                self.builder.cond_br(end_cond, loop_bb, after_bb);
+                // Branch depending on the loop end condition.
+                self.builder.cond_br(end_cond, loop_bb, after_bb);
 
-                self.builder.pos_at_end(after_bb);
+                self.builder.pos_at_end(after_bb);
 
-                // Restore the shadowed variable if there was one.
-                if let Some(old_val) = old_val {
-                    // We inserted 'var' above so it must exist.
-                    *named_values.get_mut(var).unwrap() = old_val;
-                } else {
-                    named_values.remove(var);
+                // Restore the shadowed variable if there was one.
+                if let Some(old_val) = old_val {
+                    // We inserted 'var' above so it must exist.
+                    *named_values.get_mut(var).unwrap() = old_val;
+                } else {
+                    named_values.remove(var);
                 }
 
-                // Loops just always return 0.
-                Ok(self.module.type_f64().const_f64(0f64))
+                // Loops just always return 0.
+                Ok(self.module.type_f64().const_f64(0f64))
             }
         }
     }
 
-    fn codegen_prototype(&self, PrototypeAST(name, args): &PrototypeAST) -> FnValue<'llvm> {
-        let type_f64 = self.module.type_f64();
+    fn codegen_prototype(&self, PrototypeAST(name, args): &PrototypeAST) -> FnValue<'llvm> {
+        let type_f64 = self.module.type_f64();
 
-        let mut doubles = Vec::new();
-        doubles.resize(args.len(), type_f64);
+        let mut doubles = Vec::new();
+        doubles.resize(args.len(), type_f64);
 
-        // Build the function type: fn(f64, f64, ..) -> f64
-        let ft = self.module.type_fn(&mut doubles, type_f64);
+        // Build the function type: fn(f64, f64, ..) -> f64
+        let ft = self.module.type_fn(&mut doubles, type_f64);
 
-        // Create the function declaration.
-        let f = self.module.add_fn(name, ft);
+        // Create the function declaration.
+        let f = self.module.add_fn(name, ft);
 
-        // Set the names of the function arguments.
-        for idx in 0..f.args() {
-            f.arg(idx).set_name(&args[idx]);
+        // Set the names of the function arguments.
+        for idx in 0..f.args() {
+            f.arg(idx).set_name(&args[idx]);
         }
 
-        f
+        f
     }
 
-    fn codegen_function(
-        &mut self,
-        FunctionAST(proto, body): &FunctionAST,
-        named_values: &mut HashMap<String, Value<'llvm>>,
-    ) -> CodegenResult<FnValue<'llvm>> {
-        // Insert the function prototype into the `fn_protos` map to keep track for re-generating
-        // declarations in other modules.
-        self.fn_protos.insert(proto.0.clone(), proto.clone());
+    fn codegen_function(
+        &mut self,
+        FunctionAST(proto, body): &FunctionAST,
+        named_values: &mut HashMap<String, Value<'llvm>>,
+    ) -> CodegenResult<FnValue<'llvm>> {
+        // Insert the function prototype into the `fn_protos` map to keep track for re-generating
+        // declarations in other modules.
+        self.fn_protos.insert(proto.0.clone(), proto.clone());
 
-        let the_function = self.get_function(&proto.0)
-            .expect("If proto not already generated, get_function will do for us since we updated fn_protos before-hand!");
+        let the_function = self.get_function(&proto.0)
+            .expect("If proto not already generated, get_function will do for us since we updated fn_protos before-hand!");
 
-        if the_function.basic_blocks() > 0 {
-            return Err("Function cannot be redefined.".into());
+        if the_function.basic_blocks() > 0 {
+            return Err("Function cannot be redefined.".into());
         }
 
-        // Create entry basic block to insert code.
-        let bb = self.module.append_basic_block(the_function);
-        self.builder.pos_at_end(bb);
+        // Create entry basic block to insert code.
+        let bb = self.module.append_basic_block(the_function);
+        self.builder.pos_at_end(bb);
 
-        // New scope, clear the map with the function args.
-        named_values.clear();
+        // New scope, clear the map with the function args.
+        named_values.clear();
 
-        // Update the map with the current functions args.
-        for idx in 0..the_function.args() {
-            let arg = the_function.arg(idx);
-            named_values.insert(arg.get_name().into(), arg);
+        // Update the map with the current functions args.
+        for idx in 0..the_function.args() {
+            let arg = the_function.arg(idx);
+            named_values.insert(arg.get_name().into(), arg);
         }
 
-        // Codegen function body.
-        if let Ok(ret) = self.codegen_expr(body, named_values) {
-            self.builder.ret(ret);
-            assert!(the_function.verify());
+        // Codegen function body.
+        if let Ok(ret) = self.codegen_expr(body, named_values) {
+            self.builder.ret(ret);
+            assert!(the_function.verify());
 
-            // Run the optimization passes on the function.
-            self.fpm.run(the_function);
+            // Run the optimization passes on the function.
+            self.fpm.run(the_function);
 
-            Ok(the_function)
-        } else {
+            Ok(the_function)
+        } else {
             todo!("Failed to codegen function body, erase from module!");
         }
     }
 
-    /// Lookup function with `name` in the LLVM module and return the corresponding value reference.
-    /// If the function is not available in the module, check if the prototype is known and codegen
-    /// it.
-    /// Return [`None`] if the prototype is not known.
-    fn get_function(&self, name: &str) -> Option<FnValue<'llvm>> {
-        let callee = match self.module.get_fn(name) {
-            Some(callee) => callee,
-            None => {
-                let proto = self.fn_protos.get(name)?;
-                self.codegen_prototype(proto)
+    /// Lookup function with `name` in the LLVM module and return the corresponding value reference.
+    /// If the function is not available in the module, check if the prototype is known and codegen
+    /// it.
+    /// Return [`None`] if the prototype is not known.
+    fn get_function(&self, name: &str) -> Option<FnValue<'llvm>> {
+        let callee = match self.module.get_fn(name) {
+            Some(callee) => callee,
+            None => {
+                let proto = self.fn_protos.get(name)?;
+                self.codegen_prototype(proto)
             }
         };
 
-        Some(callee)
+        Some(callee)
     }
 }
 
-
- \ No newline at end of file +
\ No newline at end of file diff --git a/src/llvm_kaleidoscope_rs/lexer.rs.html b/src/llvm_kaleidoscope_rs/lexer.rs.html index 2249ba0..240080c 100644 --- a/src/llvm_kaleidoscope_rs/lexer.rs.html +++ b/src/llvm_kaleidoscope_rs/lexer.rs.html @@ -1,10 +1,4 @@ -lexer.rs - source -
1
+lexer.rs - source
1
 2
 3
 4
@@ -210,212 +204,211 @@
 204
 205
 206
-
#[derive(Debug, PartialEq)]
-pub enum Token {
-    Eof,
-    Def,
-    Extern,
-    Identifier(String),
-    Number(f64),
-    Char(char),
-    If,
-    Then,
-    Else,
-    For,
-    In,
+
#[derive(Debug, PartialEq)]
+pub enum Token {
+    Eof,
+    Def,
+    Extern,
+    Identifier(String),
+    Number(f64),
+    Char(char),
+    If,
+    Then,
+    Else,
+    For,
+    In,
 }
 
-pub struct Lexer<I>
-where
-    I: Iterator<Item = char>,
+pub struct Lexer<I>
+where
+    I: Iterator<Item = char>,
 {
-    input: I,
-    last_char: Option<char>,
+    input: I,
+    last_char: Option<char>,
 }
 
-impl<I> Lexer<I>
-where
-    I: Iterator<Item = char>,
+impl<I> Lexer<I>
+where
+    I: Iterator<Item = char>,
 {
-    pub fn new(mut input: I) -> Lexer<I> {
-        let last_char = input.next();
-        Lexer { input, last_char }
+    pub fn new(mut input: I) -> Lexer<I> {
+        let last_char = input.next();
+        Lexer { input, last_char }
     }
 
-    fn step(&mut self) -> Option<char> {
-        self.last_char = self.input.next();
-        self.last_char
+    fn step(&mut self) -> Option<char> {
+        self.last_char = self.input.next();
+        self.last_char
     }
 
-    /// Lex and return the next token.
-    ///
-    /// Implement `int gettok();` from the tutorial.
-    pub fn gettok(&mut self) -> Token {
-        // Eat up whitespaces.
-        while matches!(self.last_char, Some(c) if c.is_ascii_whitespace()) {
-            self.step();
+    /// Lex and return the next token.
+    ///
+    /// Implement `int gettok();` from the tutorial.
+    pub fn gettok(&mut self) -> Token {
+        // Eat up whitespaces.
+        while matches!(self.last_char, Some(c) if c.is_ascii_whitespace()) {
+            self.step();
         }
 
-        // Unpack last char or return EOF.
-        let last_char = if let Some(c) = self.last_char {
-            c
-        } else {
-            return Token::Eof;
+        // Unpack last char or return EOF.
+        let last_char = if let Some(c) = self.last_char {
+            c
+        } else {
+            return Token::Eof;
         };
 
-        // Identifier: [a-zA-Z][a-zA-Z0-9]*
-        if last_char.is_ascii_alphabetic() {
-            let mut ident = String::new();
-            ident.push(last_char);
+        // Identifier: [a-zA-Z][a-zA-Z0-9]*
+        if last_char.is_ascii_alphabetic() {
+            let mut ident = String::new();
+            ident.push(last_char);
 
-            while let Some(c) = self.step() {
-                if c.is_ascii_alphanumeric() {
-                    ident.push(c)
-                } else {
+            while let Some(c) = self.step() {
+                if c.is_ascii_alphanumeric() {
+                    ident.push(c)
+                } else {
                     break;
                 }
             }
 
-            match ident.as_ref() {
-                "def" => return Token::Def,
-                "extern" => return Token::Extern,
-                "if" => return Token::If,
-                "then" => return Token::Then,
-                "else" => return Token::Else,
-                "for" => return Token::For,
-                "in" => return Token::In,
-                _ => {}
+            match ident.as_ref() {
+                "def" => return Token::Def,
+                "extern" => return Token::Extern,
+                "if" => return Token::If,
+                "then" => return Token::Then,
+                "else" => return Token::Else,
+                "for" => return Token::For,
+                "in" => return Token::In,
+                _ => {}
             }
 
-            return Token::Identifier(ident);
+            return Token::Identifier(ident);
         }
 
-        // Number: [0-9.]+
-        if last_char.is_ascii_digit() || last_char == '.' {
-            let mut num = String::new();
-            num.push(last_char);
+        // Number: [0-9.]+
+        if last_char.is_ascii_digit() || last_char == '.' {
+            let mut num = String::new();
+            num.push(last_char);
 
-            while let Some(c) = self.step() {
-                if c.is_ascii_digit() || c == '.' {
-                    num.push(c)
-                } else {
+            while let Some(c) = self.step() {
+                if c.is_ascii_digit() || c == '.' {
+                    num.push(c)
+                } else {
                     break;
                 }
             }
 
-            let num: f64 = num.parse().unwrap_or_default();
-            return Token::Number(num);
+            let num: f64 = num.parse().unwrap_or_default();
+            return Token::Number(num);
         }
 
-        // Eat up comment.
-        if last_char == '#' {
-            loop {
-                match self.step() {
-                    Some(c) if c == '\r' || c == '\n' => return self.gettok(),
-                    None => return Token::Eof,
-                    _ => { /* consume comment */ }
+        // Eat up comment.
+        if last_char == '#' {
+            loop {
+                match self.step() {
+                    Some(c) if c == '\r' || c == '\n' => return self.gettok(),
+                    None => return Token::Eof,
+                    _ => { /* consume comment */ }
                 }
             }
         }
 
-        // Advance last char and return currently last char.
-        self.step();
-        Token::Char(last_char)
+        // Advance last char and return currently last char.
+        self.step();
+        Token::Char(last_char)
     }
 }
 
-#[cfg(test)]
-mod test {
-    use super::{Lexer, Token};
+#[cfg(test)]
+mod test {
+    use super::{Lexer, Token};
 
-    #[test]
-    fn test_identifier() {
-        let mut lex = Lexer::new("a b c".chars());
-        assert_eq!(Token::Identifier("a".into()), lex.gettok());
-        assert_eq!(Token::Identifier("b".into()), lex.gettok());
-        assert_eq!(Token::Identifier("c".into()), lex.gettok());
-        assert_eq!(Token::Eof, lex.gettok());
+    #[test]
+    fn test_identifier() {
+        let mut lex = Lexer::new("a b c".chars());
+        assert_eq!(Token::Identifier("a".into()), lex.gettok());
+        assert_eq!(Token::Identifier("b".into()), lex.gettok());
+        assert_eq!(Token::Identifier("c".into()), lex.gettok());
+        assert_eq!(Token::Eof, lex.gettok());
     }
 
-    #[test]
-    fn test_keyword() {
-        let mut lex = Lexer::new("def extern".chars());
-        assert_eq!(Token::Def, lex.gettok());
-        assert_eq!(Token::Extern, lex.gettok());
-        assert_eq!(Token::Eof, lex.gettok());
+    #[test]
+    fn test_keyword() {
+        let mut lex = Lexer::new("def extern".chars());
+        assert_eq!(Token::Def, lex.gettok());
+        assert_eq!(Token::Extern, lex.gettok());
+        assert_eq!(Token::Eof, lex.gettok());
     }
 
-    #[test]
-    fn test_number() {
-        let mut lex = Lexer::new("12.34".chars());
-        assert_eq!(Token::Number(12.34f64), lex.gettok());
-        assert_eq!(Token::Eof, lex.gettok());
+    #[test]
+    fn test_number() {
+        let mut lex = Lexer::new("12.34".chars());
+        assert_eq!(Token::Number(12.34f64), lex.gettok());
+        assert_eq!(Token::Eof, lex.gettok());
 
-        let mut lex = Lexer::new(" 1.0   2.0 3.0".chars());
-        assert_eq!(Token::Number(1.0f64), lex.gettok());
-        assert_eq!(Token::Number(2.0f64), lex.gettok());
-        assert_eq!(Token::Number(3.0f64), lex.gettok());
-        assert_eq!(Token::Eof, lex.gettok());
+        let mut lex = Lexer::new(" 1.0   2.0 3.0".chars());
+        assert_eq!(Token::Number(1.0f64), lex.gettok());
+        assert_eq!(Token::Number(2.0f64), lex.gettok());
+        assert_eq!(Token::Number(3.0f64), lex.gettok());
+        assert_eq!(Token::Eof, lex.gettok());
 
-        let mut lex = Lexer::new("12.34.56".chars());
-        assert_eq!(Token::Number(0f64), lex.gettok());
-        assert_eq!(Token::Eof, lex.gettok());
+        let mut lex = Lexer::new("12.34.56".chars());
+        assert_eq!(Token::Number(0f64), lex.gettok());
+        assert_eq!(Token::Eof, lex.gettok());
     }
 
-    #[test]
-    fn test_comment() {
-        let mut lex = Lexer::new("# some comment".chars());
-        assert_eq!(Token::Eof, lex.gettok());
+    #[test]
+    fn test_comment() {
+        let mut lex = Lexer::new("# some comment".chars());
+        assert_eq!(Token::Eof, lex.gettok());
 
-        let mut lex = Lexer::new("abc # some comment \n xyz".chars());
-        assert_eq!(Token::Identifier("abc".into()), lex.gettok());
-        assert_eq!(Token::Identifier("xyz".into()), lex.gettok());
-        assert_eq!(Token::Eof, lex.gettok());
+        let mut lex = Lexer::new("abc # some comment \n xyz".chars());
+        assert_eq!(Token::Identifier("abc".into()), lex.gettok());
+        assert_eq!(Token::Identifier("xyz".into()), lex.gettok());
+        assert_eq!(Token::Eof, lex.gettok());
     }
 
-    #[test]
-    fn test_chars() {
-        let mut lex = Lexer::new("a+b-c".chars());
-        assert_eq!(Token::Identifier("a".into()), lex.gettok());
-        assert_eq!(Token::Char('+'), lex.gettok());
-        assert_eq!(Token::Identifier("b".into()), lex.gettok());
-        assert_eq!(Token::Char('-'), lex.gettok());
-        assert_eq!(Token::Identifier("c".into()), lex.gettok());
-        assert_eq!(Token::Eof, lex.gettok());
+    #[test]
+    fn test_chars() {
+        let mut lex = Lexer::new("a+b-c".chars());
+        assert_eq!(Token::Identifier("a".into()), lex.gettok());
+        assert_eq!(Token::Char('+'), lex.gettok());
+        assert_eq!(Token::Identifier("b".into()), lex.gettok());
+        assert_eq!(Token::Char('-'), lex.gettok());
+        assert_eq!(Token::Identifier("c".into()), lex.gettok());
+        assert_eq!(Token::Eof, lex.gettok());
     }
 
-    #[test]
-    fn test_whitespaces() {
-        let mut lex = Lexer::new("    +a  b      c!    ".chars());
-        assert_eq!(Token::Char('+'), lex.gettok());
-        assert_eq!(Token::Identifier("a".into()), lex.gettok());
-        assert_eq!(Token::Identifier("b".into()), lex.gettok());
-        assert_eq!(Token::Identifier("c".into()), lex.gettok());
-        assert_eq!(Token::Char('!'), lex.gettok());
-        assert_eq!(Token::Eof, lex.gettok());
+    #[test]
+    fn test_whitespaces() {
+        let mut lex = Lexer::new("    +a  b      c!    ".chars());
+        assert_eq!(Token::Char('+'), lex.gettok());
+        assert_eq!(Token::Identifier("a".into()), lex.gettok());
+        assert_eq!(Token::Identifier("b".into()), lex.gettok());
+        assert_eq!(Token::Identifier("c".into()), lex.gettok());
+        assert_eq!(Token::Char('!'), lex.gettok());
+        assert_eq!(Token::Eof, lex.gettok());
 
-        let mut lex = Lexer::new("\n    a \n\r  b \r \n     c \r\r  \n   ".chars());
-        assert_eq!(Token::Identifier("a".into()), lex.gettok());
-        assert_eq!(Token::Identifier("b".into()), lex.gettok());
-        assert_eq!(Token::Identifier("c".into()), lex.gettok());
-        assert_eq!(Token::Eof, lex.gettok());
+        let mut lex = Lexer::new("\n    a \n\r  b \r \n     c \r\r  \n   ".chars());
+        assert_eq!(Token::Identifier("a".into()), lex.gettok());
+        assert_eq!(Token::Identifier("b".into()), lex.gettok());
+        assert_eq!(Token::Identifier("c".into()), lex.gettok());
+        assert_eq!(Token::Eof, lex.gettok());
     }
 
-    #[test]
-    fn test_ite() {
-        let mut lex = Lexer::new("if then else".chars());
-        assert_eq!(Token::If, lex.gettok());
-        assert_eq!(Token::Then, lex.gettok());
-        assert_eq!(Token::Else, lex.gettok());
+    #[test]
+    fn test_ite() {
+        let mut lex = Lexer::new("if then else".chars());
+        assert_eq!(Token::If, lex.gettok());
+        assert_eq!(Token::Then, lex.gettok());
+        assert_eq!(Token::Else, lex.gettok());
     }
 
-    #[test]
-    fn test_for() {
-        let mut lex = Lexer::new("for in".chars());
-        assert_eq!(Token::For, lex.gettok());
-        assert_eq!(Token::In, lex.gettok());
+    #[test]
+    fn test_for() {
+        let mut lex = Lexer::new("for in".chars());
+        assert_eq!(Token::For, lex.gettok());
+        assert_eq!(Token::In, lex.gettok());
     }
 }
 
-
- \ No newline at end of file +
\ No newline at end of file diff --git a/src/llvm_kaleidoscope_rs/lib.rs.html b/src/llvm_kaleidoscope_rs/lib.rs.html index 97ad5f7..acd8915 100644 --- a/src/llvm_kaleidoscope_rs/lib.rs.html +++ b/src/llvm_kaleidoscope_rs/lib.rs.html @@ -1,10 +1,4 @@ -lib.rs - source -
1
+lib.rs - source
1
 2
 3
 4
@@ -115,117 +109,116 @@
 109
 110
 111
-
use std::convert::TryFrom;
-
-pub mod codegen;
-pub mod lexer;
-pub mod llvm;
-pub mod parser;
-
-/// Fixed size of [`SmallCStr`] including the trailing `\0` byte.
-pub const SMALL_STR_SIZE: usize = 16;
-
-/// Small C string on the stack with fixed size [`SMALL_STR_SIZE`].
-///
-/// This is specially crafted to interact with the LLVM C API and get rid of some heap allocations.
-#[derive(Debug, PartialEq)]
-pub struct SmallCStr([u8; SMALL_STR_SIZE]);
-
-impl SmallCStr {
-    /// Create a new C string from `src`.
-    /// Returns [`None`] if `src` exceeds the fixed size or contains any `\0` bytes.
-    pub fn new<T: AsRef<[u8]>>(src: &T) -> Option<SmallCStr> {
-        let src = src.as_ref();
-        let len = src.len();
-
-        // Check for \0 bytes.
-        let contains_null = unsafe { !libc::memchr(src.as_ptr().cast(), 0, len).is_null() };
-
-        if contains_null || len > SMALL_STR_SIZE - 1 {
-            None
-        } else {
-            let mut dest = [0; SMALL_STR_SIZE];
-            dest[..len].copy_from_slice(src);
-            Some(SmallCStr(dest))
+
use std::convert::TryFrom;
+
+pub mod codegen;
+pub mod lexer;
+pub mod llvm;
+pub mod parser;
+
+/// Fixed size of [`SmallCStr`] including the trailing `\0` byte.
+pub const SMALL_STR_SIZE: usize = 16;
+
+/// Small C string on the stack with fixed size [`SMALL_STR_SIZE`].
+///
+/// This is specially crafted to interact with the LLVM C API and get rid of some heap allocations.
+#[derive(Debug, PartialEq)]
+pub struct SmallCStr([u8; SMALL_STR_SIZE]);
+
+impl SmallCStr {
+    /// Create a new C string from `src`.
+    /// Returns [`None`] if `src` exceeds the fixed size or contains any `\0` bytes.
+    pub fn new<T: AsRef<[u8]>>(src: &T) -> Option<SmallCStr> {
+        let src = src.as_ref();
+        let len = src.len();
+
+        // Check for \0 bytes.
+        let contains_null = unsafe { !libc::memchr(src.as_ptr().cast(), 0, len).is_null() };
+
+        if contains_null || len > SMALL_STR_SIZE - 1 {
+            None
+        } else {
+            let mut dest = [0; SMALL_STR_SIZE];
+            dest[..len].copy_from_slice(src);
+            Some(SmallCStr(dest))
         }
     }
 
-    /// Return pointer to C string.
-    pub const fn as_ptr(&self) -> *const libc::c_char {
-        self.0.as_ptr().cast()
+    /// Return pointer to C string.
+    pub const fn as_ptr(&self) -> *const libc::c_char {
+        self.0.as_ptr().cast()
     }
 }
 
-impl TryFrom<&str> for SmallCStr {
-    type Error = ();
+impl TryFrom<&str> for SmallCStr {
+    type Error = ();
 
-    fn try_from(value: &str) -> Result<Self, Self::Error> {
-        SmallCStr::new(&value).ok_or(())
+    fn try_from(value: &str) -> Result<Self, Self::Error> {
+        SmallCStr::new(&value).ok_or(())
     }
 }
 
-/// Either type, for APIs accepting two types.
-pub enum Either<A, B> {
-    A(A),
-    B(B),
+/// Either type, for APIs accepting two types.
+pub enum Either<A, B> {
+    A(A),
+    B(B),
 }
 
-#[cfg(test)]
-mod test {
-    use super::{SmallCStr, SMALL_STR_SIZE};
-    use std::convert::TryInto;
+#[cfg(test)]
+mod test {
+    use super::{SmallCStr, SMALL_STR_SIZE};
+    use std::convert::TryInto;
 
-    #[test]
-    fn test_create() {
-        let src = "\x30\x31\x32\x33";
-        let scs = SmallCStr::new(&src).unwrap();
-        assert_eq!(&scs.0[..5], &[0x30, 0x31, 0x32, 0x33, 0x00]);
+    #[test]
+    fn test_create() {
+        let src = "\x30\x31\x32\x33";
+        let scs = SmallCStr::new(&src).unwrap();
+        assert_eq!(&scs.0[..5], &[0x30, 0x31, 0x32, 0x33, 0x00]);
 
-        let src = b"abcd1234";
-        let scs = SmallCStr::new(&src).unwrap();
+        let src = b"abcd1234";
+        let scs = SmallCStr::new(&src).unwrap();
         assert_eq!(
-            &scs.0[..9],
+            &scs.0[..9],
             &[0x61, 0x62, 0x63, 0x64, 0x31, 0x32, 0x33, 0x34, 0x00]
         );
     }
 
-    #[test]
-    fn test_contain_null() {
-        let src = "\x30\x00\x32\x33";
-        let scs = SmallCStr::new(&src);
-        assert_eq!(scs, None);
+    #[test]
+    fn test_contain_null() {
+        let src = "\x30\x00\x32\x33";
+        let scs = SmallCStr::new(&src);
+        assert_eq!(scs, None);
 
-        let src = "\x30\x31\x32\x33\x00";
-        let scs = SmallCStr::new(&src);
-        assert_eq!(scs, None);
+        let src = "\x30\x31\x32\x33\x00";
+        let scs = SmallCStr::new(&src);
+        assert_eq!(scs, None);
     }
 
-    #[test]
-    fn test_too_large() {
-        let src = (0..SMALL_STR_SIZE).map(|_| 'a').collect::<String>();
-        let scs = SmallCStr::new(&src);
-        assert_eq!(scs, None);
+    #[test]
+    fn test_too_large() {
+        let src = (0..SMALL_STR_SIZE).map(|_| 'a').collect::<String>();
+        let scs = SmallCStr::new(&src);
+        assert_eq!(scs, None);
 
-        let src = (0..SMALL_STR_SIZE + 10).map(|_| 'a').collect::<String>();
-        let scs = SmallCStr::new(&src);
-        assert_eq!(scs, None);
+        let src = (0..SMALL_STR_SIZE + 10).map(|_| 'a').collect::<String>();
+        let scs = SmallCStr::new(&src);
+        assert_eq!(scs, None);
     }
 
-    #[test]
-    fn test_try_into() {
-        let src = "\x30\x31\x32\x33";
-        let scs: Result<SmallCStr, ()> = src.try_into();
-        assert!(scs.is_ok());
+    #[test]
+    fn test_try_into() {
+        let src = "\x30\x31\x32\x33";
+        let scs: Result<SmallCStr, ()> = src.try_into();
+        assert!(scs.is_ok());
 
-        let src = (0..SMALL_STR_SIZE).map(|_| 'a').collect::<String>();
-        let scs: Result<SmallCStr, ()> = src.as_str().try_into();
-        assert!(scs.is_err());
+        let src = (0..SMALL_STR_SIZE).map(|_| 'a').collect::<String>();
+        let scs: Result<SmallCStr, ()> = src.as_str().try_into();
+        assert!(scs.is_err());
 
-        let src = (0..SMALL_STR_SIZE + 10).map(|_| 'a').collect::<String>();
-        let scs: Result<SmallCStr, ()> = src.as_str().try_into();
-        assert!(scs.is_err());
+        let src = (0..SMALL_STR_SIZE + 10).map(|_| 'a').collect::<String>();
+        let scs: Result<SmallCStr, ()> = src.as_str().try_into();
+        assert!(scs.is_err());
     }
 }
 
-
- \ No newline at end of file +
\ No newline at end of file diff --git a/src/llvm_kaleidoscope_rs/llvm/basic_block.rs.html b/src/llvm_kaleidoscope_rs/llvm/basic_block.rs.html index 581b8e2..2370022 100644 --- a/src/llvm_kaleidoscope_rs/llvm/basic_block.rs.html +++ b/src/llvm_kaleidoscope_rs/llvm/basic_block.rs.html @@ -1,10 +1,4 @@ -basic_block.rs - source -
1
+basic_block.rs - source
1
 2
 3
 4
@@ -43,45 +37,44 @@
 37
 38
 39
-
use llvm_sys::{core::LLVMGetBasicBlockParent, prelude::LLVMBasicBlockRef};
+
use llvm_sys::{core::LLVMGetBasicBlockParent, prelude::LLVMBasicBlockRef};
 
-use std::marker::PhantomData;
+use std::marker::PhantomData;
 
-use super::FnValue;
+use super::FnValue;
 
-/// Wrapper for a LLVM Basic Block.
-#[derive(Copy, Clone)]
-pub struct BasicBlock<'llvm>(LLVMBasicBlockRef, PhantomData<&'llvm ()>);
+/// Wrapper for a LLVM Basic Block.
+#[derive(Copy, Clone)]
+pub struct BasicBlock<'llvm>(LLVMBasicBlockRef, PhantomData<&'llvm ()>);
 
-impl<'llvm> BasicBlock<'llvm> {
-    /// Create a new BasicBlock instance.
-    ///
-    /// # Panics
-    ///
-    /// Panics if `bb_ref` is a null pointer.
-    pub(super) fn new(bb_ref: LLVMBasicBlockRef) -> BasicBlock<'llvm> {
-        assert!(!bb_ref.is_null());
-        BasicBlock(bb_ref, PhantomData)
+impl<'llvm> BasicBlock<'llvm> {
+    /// Create a new BasicBlock instance.
+    ///
+    /// # Panics
+    ///
+    /// Panics if `bb_ref` is a null pointer.
+    pub(super) fn new(bb_ref: LLVMBasicBlockRef) -> BasicBlock<'llvm> {
+        assert!(!bb_ref.is_null());
+        BasicBlock(bb_ref, PhantomData)
     }
 
-    /// Get the raw LLVM value reference.
-    #[inline]
-    pub(super) fn bb_ref(&self) -> LLVMBasicBlockRef {
-        self.0
-    }
+    /// Get the raw LLVM value reference.
+    #[inline]
+    pub(super) fn bb_ref(&self) -> LLVMBasicBlockRef {
+        self.0
+    }
 
-    /// Get the function to which the basic block belongs.
-    ///
-    /// # Panics
-    ///
-    /// Panics if LLVM API returns a `null` pointer.
-    pub fn get_parent(&self) -> FnValue<'llvm> {
-        let value_ref = unsafe { LLVMGetBasicBlockParent(self.bb_ref()) };
-        assert!(!value_ref.is_null());
+    /// Get the function to which the basic block belongs.
+    ///
+    /// # Panics
+    ///
+    /// Panics if LLVM API returns a `null` pointer.
+    pub fn get_parent(&self) -> FnValue<'llvm> {
+        let value_ref = unsafe { LLVMGetBasicBlockParent(self.bb_ref()) };
+        assert!(!value_ref.is_null());
 
-        FnValue::new(value_ref)
+        FnValue::new(value_ref)
     }
 }
 
-
- \ No newline at end of file +
\ No newline at end of file diff --git a/src/llvm_kaleidoscope_rs/llvm/builder.rs.html b/src/llvm_kaleidoscope_rs/llvm/builder.rs.html index 934351a..fad1867 100644 --- a/src/llvm_kaleidoscope_rs/llvm/builder.rs.html +++ b/src/llvm_kaleidoscope_rs/llvm/builder.rs.html @@ -1,10 +1,4 @@ -builder.rs - source -
1
+builder.rs - source
1
 2
 3
 4
@@ -283,285 +277,284 @@
 277
 278
 279
-
use llvm_sys::{
-    core::{
-        LLVMAddIncoming, LLVMBuildBr, LLVMBuildCondBr, LLVMBuildFAdd, LLVMBuildFCmp, LLVMBuildFMul,
-        LLVMBuildFSub, LLVMBuildPhi, LLVMBuildRet, LLVMBuildUIToFP, LLVMCreateBuilderInContext,
-        LLVMDisposeBuilder, LLVMGetInsertBlock, LLVMPositionBuilderAtEnd,
+
use llvm_sys::{
+    core::{
+        LLVMAddIncoming, LLVMBuildBr, LLVMBuildCondBr, LLVMBuildFAdd, LLVMBuildFCmp, LLVMBuildFMul,
+        LLVMBuildFSub, LLVMBuildPhi, LLVMBuildRet, LLVMBuildUIToFP, LLVMCreateBuilderInContext,
+        LLVMDisposeBuilder, LLVMGetInsertBlock, LLVMPositionBuilderAtEnd,
     },
-    prelude::{LLVMBuilderRef, LLVMValueRef},
-    LLVMRealPredicate,
+    prelude::{LLVMBuilderRef, LLVMValueRef},
+    LLVMRealPredicate,
 };
 
-use std::marker::PhantomData;
+use std::marker::PhantomData;
 
-use super::{BasicBlock, FnValue, Module, PhiValue, Type, Value};
+use super::{BasicBlock, FnValue, Module, PhiValue, Type, Value};
 
-// Definition of LLVM C API functions using our `repr(transparent)` types.
-extern "C" {
-    fn LLVMBuildCall2(
-        arg1: LLVMBuilderRef,
-        arg2: Type<'_>,
-        Fn: FnValue<'_>,
-        Args: *mut Value<'_>,
-        NumArgs: ::libc::c_uint,
-        Name: *const ::libc::c_char,
-    ) -> LLVMValueRef;
+// Definition of LLVM C API functions using our `repr(transparent)` types.
+extern "C" {
+    fn LLVMBuildCall2(
+        arg1: LLVMBuilderRef,
+        arg2: Type<'_>,
+        Fn: FnValue<'_>,
+        Args: *mut Value<'_>,
+        NumArgs: ::libc::c_uint,
+        Name: *const ::libc::c_char,
+    ) -> LLVMValueRef;
 }
 
-/// Wrapper for a LLVM IR Builder.
-pub struct IRBuilder<'llvm> {
-    builder: LLVMBuilderRef,
-    _ctx: PhantomData<&'llvm ()>,
+/// Wrapper for a LLVM IR Builder.
+pub struct IRBuilder<'llvm> {
+    builder: LLVMBuilderRef,
+    _ctx: PhantomData<&'llvm ()>,
 }
 
-impl<'llvm> IRBuilder<'llvm> {
-    /// Create a new LLVM IR Builder with the `module`s context.
-    ///
-    /// # Panics
-    ///
-    /// Panics if creating the IR Builder fails.
-    pub fn with_ctx(module: &'llvm Module) -> IRBuilder<'llvm> {
-        let builder = unsafe { LLVMCreateBuilderInContext(module.ctx()) };
-        assert!(!builder.is_null());
+impl<'llvm> IRBuilder<'llvm> {
+    /// Create a new LLVM IR Builder with the `module`s context.
+    ///
+    /// # Panics
+    ///
+    /// Panics if creating the IR Builder fails.
+    pub fn with_ctx(module: &'llvm Module) -> IRBuilder<'llvm> {
+        let builder = unsafe { LLVMCreateBuilderInContext(module.ctx()) };
+        assert!(!builder.is_null());
 
-        IRBuilder {
-            builder,
-            _ctx: PhantomData,
+        IRBuilder {
+            builder,
+            _ctx: PhantomData,
         }
     }
 
-    /// Position the IR Builder at the end of the given Basic Block.
-    pub fn pos_at_end(&self, bb: BasicBlock<'llvm>) {
-        unsafe {
-            LLVMPositionBuilderAtEnd(self.builder, bb.bb_ref());
+    /// Position the IR Builder at the end of the given Basic Block.
+    pub fn pos_at_end(&self, bb: BasicBlock<'llvm>) {
+        unsafe {
+            LLVMPositionBuilderAtEnd(self.builder, bb.bb_ref());
         }
     }
 
-    /// Get the BasicBlock the IRBuilder currently inputs into.
-    ///
-    /// # Panics
-    ///
-    /// Panics if LLVM API returns a `null` pointer.
-    pub fn get_insert_block(&self) -> BasicBlock<'llvm> {
-        let bb_ref = unsafe { LLVMGetInsertBlock(self.builder) };
-        assert!(!bb_ref.is_null());
+    /// Get the BasicBlock the IRBuilder currently inputs into.
+    ///
+    /// # Panics
+    ///
+    /// Panics if LLVM API returns a `null` pointer.
+    pub fn get_insert_block(&self) -> BasicBlock<'llvm> {
+        let bb_ref = unsafe { LLVMGetInsertBlock(self.builder) };
+        assert!(!bb_ref.is_null());
 
-        BasicBlock::new(bb_ref)
+        BasicBlock::new(bb_ref)
     }
 
-    /// Emit a [fadd](https://llvm.org/docs/LangRef.html#fadd-instruction) instruction.
-    ///
-    /// # Panics
-    ///
-    /// Panics if LLVM API returns a `null` pointer.
-    pub fn fadd(&self, lhs: Value<'llvm>, rhs: Value<'llvm>) -> Value<'llvm> {
-        debug_assert!(lhs.is_f64(), "fadd: Expected f64 as lhs operand!");
-        debug_assert!(rhs.is_f64(), "fadd: Expected f64 as rhs operand!");
+    /// Emit a [fadd](https://llvm.org/docs/LangRef.html#fadd-instruction) instruction.
+    ///
+    /// # Panics
+    ///
+    /// Panics if LLVM API returns a `null` pointer.
+    pub fn fadd(&self, lhs: Value<'llvm>, rhs: Value<'llvm>) -> Value<'llvm> {
+        debug_assert!(lhs.is_f64(), "fadd: Expected f64 as lhs operand!");
+        debug_assert!(rhs.is_f64(), "fadd: Expected f64 as rhs operand!");
 
-        let value_ref = unsafe {
-            LLVMBuildFAdd(
-                self.builder,
-                lhs.value_ref(),
-                rhs.value_ref(),
-                b"fadd\0".as_ptr().cast(),
+        let value_ref = unsafe {
+            LLVMBuildFAdd(
+                self.builder,
+                lhs.value_ref(),
+                rhs.value_ref(),
+                b"fadd\0".as_ptr().cast(),
             )
         };
-        Value::new(value_ref)
+        Value::new(value_ref)
     }
 
-    /// Emit a [fsub](https://llvm.org/docs/LangRef.html#fsub-instruction) instruction.
-    ///
-    /// # Panics
-    ///
-    /// Panics if LLVM API returns a `null` pointer.
-    pub fn fsub(&self, lhs: Value<'llvm>, rhs: Value<'llvm>) -> Value<'llvm> {
-        debug_assert!(lhs.is_f64(), "fsub: Expected f64 as lhs operand!");
-        debug_assert!(rhs.is_f64(), "fsub: Expected f64 as rhs operand!");
+    /// Emit a [fsub](https://llvm.org/docs/LangRef.html#fsub-instruction) instruction.
+    ///
+    /// # Panics
+    ///
+    /// Panics if LLVM API returns a `null` pointer.
+    pub fn fsub(&self, lhs: Value<'llvm>, rhs: Value<'llvm>) -> Value<'llvm> {
+        debug_assert!(lhs.is_f64(), "fsub: Expected f64 as lhs operand!");
+        debug_assert!(rhs.is_f64(), "fsub: Expected f64 as rhs operand!");
 
-        let value_ref = unsafe {
-            LLVMBuildFSub(
-                self.builder,
-                lhs.value_ref(),
-                rhs.value_ref(),
-                b"fsub\0".as_ptr().cast(),
+        let value_ref = unsafe {
+            LLVMBuildFSub(
+                self.builder,
+                lhs.value_ref(),
+                rhs.value_ref(),
+                b"fsub\0".as_ptr().cast(),
             )
         };
-        Value::new(value_ref)
+        Value::new(value_ref)
     }
 
-    /// Emit a [fmul](https://llvm.org/docs/LangRef.html#fmul-instruction) instruction.
-    ///
-    /// # Panics
-    ///
-    /// Panics if LLVM API returns a `null` pointer.
-    pub fn fmul(&self, lhs: Value<'llvm>, rhs: Value<'llvm>) -> Value<'llvm> {
-        debug_assert!(lhs.is_f64(), "fmul: Expected f64 as lhs operand!");
-        debug_assert!(rhs.is_f64(), "fmul: Expected f64 as rhs operand!");
+    /// Emit a [fmul](https://llvm.org/docs/LangRef.html#fmul-instruction) instruction.
+    ///
+    /// # Panics
+    ///
+    /// Panics if LLVM API returns a `null` pointer.
+    pub fn fmul(&self, lhs: Value<'llvm>, rhs: Value<'llvm>) -> Value<'llvm> {
+        debug_assert!(lhs.is_f64(), "fmul: Expected f64 as lhs operand!");
+        debug_assert!(rhs.is_f64(), "fmul: Expected f64 as rhs operand!");
 
-        let value_ref = unsafe {
-            LLVMBuildFMul(
-                self.builder,
-                lhs.value_ref(),
-                rhs.value_ref(),
-                b"fmul\0".as_ptr().cast(),
+        let value_ref = unsafe {
+            LLVMBuildFMul(
+                self.builder,
+                lhs.value_ref(),
+                rhs.value_ref(),
+                b"fmul\0".as_ptr().cast(),
             )
         };
-        Value::new(value_ref)
+        Value::new(value_ref)
     }
 
-    /// Emit a [fcmpult](https://llvm.org/docs/LangRef.html#fcmp-instruction) instruction.
-    ///
-    /// # Panics
-    ///
-    /// Panics if LLVM API returns a `null` pointer.
-    pub fn fcmpult(&self, lhs: Value<'llvm>, rhs: Value<'llvm>) -> Value<'llvm> {
-        debug_assert!(lhs.is_f64(), "fcmpult: Expected f64 as lhs operand!");
-        debug_assert!(rhs.is_f64(), "fcmpult: Expected f64 as rhs operand!");
+    /// Emit a [fcmpult](https://llvm.org/docs/LangRef.html#fcmp-instruction) instruction.
+    ///
+    /// # Panics
+    ///
+    /// Panics if LLVM API returns a `null` pointer.
+    pub fn fcmpult(&self, lhs: Value<'llvm>, rhs: Value<'llvm>) -> Value<'llvm> {
+        debug_assert!(lhs.is_f64(), "fcmpult: Expected f64 as lhs operand!");
+        debug_assert!(rhs.is_f64(), "fcmpult: Expected f64 as rhs operand!");
 
-        let value_ref = unsafe {
-            LLVMBuildFCmp(
-                self.builder,
-                LLVMRealPredicate::LLVMRealULT,
-                lhs.value_ref(),
-                rhs.value_ref(),
-                b"fcmpult\0".as_ptr().cast(),
+        let value_ref = unsafe {
+            LLVMBuildFCmp(
+                self.builder,
+                LLVMRealPredicate::LLVMRealULT,
+                lhs.value_ref(),
+                rhs.value_ref(),
+                b"fcmpult\0".as_ptr().cast(),
             )
         };
-        Value::new(value_ref)
+        Value::new(value_ref)
     }
 
-    /// Emit a [fcmpone](https://llvm.org/docs/LangRef.html#fcmp-instruction) instruction.
-    ///
-    /// # Panics
-    ///
-    /// Panics if LLVM API returns a `null` pointer.
-    pub fn fcmpone(&self, lhs: Value<'llvm>, rhs: Value<'llvm>) -> Value<'llvm> {
-        debug_assert!(lhs.is_f64(), "fcmone: Expected f64 as lhs operand!");
-        debug_assert!(rhs.is_f64(), "fcmone: Expected f64 as rhs operand!");
+    /// Emit a [fcmpone](https://llvm.org/docs/LangRef.html#fcmp-instruction) instruction.
+    ///
+    /// # Panics
+    ///
+    /// Panics if LLVM API returns a `null` pointer.
+    pub fn fcmpone(&self, lhs: Value<'llvm>, rhs: Value<'llvm>) -> Value<'llvm> {
+        debug_assert!(lhs.is_f64(), "fcmone: Expected f64 as lhs operand!");
+        debug_assert!(rhs.is_f64(), "fcmone: Expected f64 as rhs operand!");
 
-        let value_ref = unsafe {
-            LLVMBuildFCmp(
-                self.builder,
-                LLVMRealPredicate::LLVMRealONE,
-                lhs.value_ref(),
-                rhs.value_ref(),
-                b"fcmpone\0".as_ptr().cast(),
+        let value_ref = unsafe {
+            LLVMBuildFCmp(
+                self.builder,
+                LLVMRealPredicate::LLVMRealONE,
+                lhs.value_ref(),
+                rhs.value_ref(),
+                b"fcmpone\0".as_ptr().cast(),
             )
         };
-        Value::new(value_ref)
+        Value::new(value_ref)
     }
 
-    /// Emit a [uitofp](https://llvm.org/docs/LangRef.html#uitofp-to-instruction) instruction.
-    ///
-    /// # Panics
-    ///
-    /// Panics if LLVM API returns a `null` pointer.
-    pub fn uitofp(&self, val: Value<'llvm>, dest_type: Type<'llvm>) -> Value<'llvm> {
-        debug_assert!(val.is_int(), "uitofp: Expected integer operand!");
+    /// Emit a [uitofp](https://llvm.org/docs/LangRef.html#uitofp-to-instruction) instruction.
+    ///
+    /// # Panics
+    ///
+    /// Panics if LLVM API returns a `null` pointer.
+    pub fn uitofp(&self, val: Value<'llvm>, dest_type: Type<'llvm>) -> Value<'llvm> {
+        debug_assert!(val.is_int(), "uitofp: Expected integer operand!");
 
-        let value_ref = unsafe {
-            LLVMBuildUIToFP(
-                self.builder,
-                val.value_ref(),
-                dest_type.type_ref(),
-                b"uitofp\0".as_ptr().cast(),
+        let value_ref = unsafe {
+            LLVMBuildUIToFP(
+                self.builder,
+                val.value_ref(),
+                dest_type.type_ref(),
+                b"uitofp\0".as_ptr().cast(),
             )
         };
-        Value::new(value_ref)
+        Value::new(value_ref)
     }
 
-    /// Emit a [call](https://llvm.org/docs/LangRef.html#call-instruction) instruction.
-    ///
-    /// # Panics
-    ///
-    /// Panics if LLVM API returns a `null` pointer.
-    pub fn call(&self, fn_value: FnValue<'llvm>, args: &mut [Value<'llvm>]) -> Value<'llvm> {
-        let value_ref = unsafe {
-            LLVMBuildCall2(
-                self.builder,
-                fn_value.ret_type(),
-                fn_value,
-                args.as_mut_ptr(),
-                args.len() as libc::c_uint,
-                b"call\0".as_ptr().cast(),
+    /// Emit a [call](https://llvm.org/docs/LangRef.html#call-instruction) instruction.
+    ///
+    /// # Panics
+    ///
+    /// Panics if LLVM API returns a `null` pointer.
+    pub fn call(&self, fn_value: FnValue<'llvm>, args: &mut [Value<'llvm>]) -> Value<'llvm> {
+        let value_ref = unsafe {
+            LLVMBuildCall2(
+                self.builder,
+                fn_value.ret_type(),
+                fn_value,
+                args.as_mut_ptr(),
+                args.len() as libc::c_uint,
+                b"call\0".as_ptr().cast(),
             )
         };
-        Value::new(value_ref)
+        Value::new(value_ref)
     }
 
-    /// Emit a [ret](https://llvm.org/docs/LangRef.html#ret-instruction) instruction.
-    ///
-    /// # Panics
-    ///
-    /// Panics if LLVM API returns a `null` pointer.
-    pub fn ret(&self, ret: Value<'llvm>) {
-        let ret = unsafe { LLVMBuildRet(self.builder, ret.value_ref()) };
-        assert!(!ret.is_null());
+    /// Emit a [ret](https://llvm.org/docs/LangRef.html#ret-instruction) instruction.
+    ///
+    /// # Panics
+    ///
+    /// Panics if LLVM API returns a `null` pointer.
+    pub fn ret(&self, ret: Value<'llvm>) {
+        let ret = unsafe { LLVMBuildRet(self.builder, ret.value_ref()) };
+        assert!(!ret.is_null());
     }
 
-    /// Emit an unconditional [br](https://llvm.org/docs/LangRef.html#br-instruction) instruction.
-    ///
-    /// # Panics
-    ///
-    /// Panics if LLVM API returns a `null` pointer.
-    pub fn br(&self, dest: BasicBlock<'llvm>) {
-        let br_ref = unsafe { LLVMBuildBr(self.builder, dest.bb_ref()) };
-        assert!(!br_ref.is_null());
+    /// Emit an unconditional [br](https://llvm.org/docs/LangRef.html#br-instruction) instruction.
+    ///
+    /// # Panics
+    ///
+    /// Panics if LLVM API returns a `null` pointer.
+    pub fn br(&self, dest: BasicBlock<'llvm>) {
+        let br_ref = unsafe { LLVMBuildBr(self.builder, dest.bb_ref()) };
+        assert!(!br_ref.is_null());
     }
 
-    /// Emit a conditional [br](https://llvm.org/docs/LangRef.html#br-instruction) instruction.
-    ///
-    /// # Panics
-    ///
-    /// Panics if LLVM API returns a `null` pointer.
-    pub fn cond_br(&self, cond: Value<'llvm>, then: BasicBlock<'llvm>, else_: BasicBlock<'llvm>) {
-        let br_ref = unsafe {
-            LLVMBuildCondBr(
-                self.builder,
-                cond.value_ref(),
-                then.bb_ref(),
-                else_.bb_ref(),
+    /// Emit a conditional [br](https://llvm.org/docs/LangRef.html#br-instruction) instruction.
+    ///
+    /// # Panics
+    ///
+    /// Panics if LLVM API returns a `null` pointer.
+    pub fn cond_br(&self, cond: Value<'llvm>, then: BasicBlock<'llvm>, else_: BasicBlock<'llvm>) {
+        let br_ref = unsafe {
+            LLVMBuildCondBr(
+                self.builder,
+                cond.value_ref(),
+                then.bb_ref(),
+                else_.bb_ref(),
             )
         };
-        assert!(!br_ref.is_null());
+        assert!(!br_ref.is_null());
     }
 
-    /// Emit a [phi](https://llvm.org/docs/LangRef.html#phi-instruction) instruction.
-    ///
-    /// # Panics
-    ///
-    /// Panics if LLVM API returns a `null` pointer.
-    pub fn phi(
+    /// Emit a [phi](https://llvm.org/docs/LangRef.html#phi-instruction) instruction.
+    ///
+    /// # Panics
+    ///
+    /// Panics if LLVM API returns a `null` pointer.
+    pub fn phi(
         &self,
-        phi_type: Type<'llvm>,
-        incoming: &[(Value<'llvm>, BasicBlock<'llvm>)],
-    ) -> PhiValue<'llvm> {
-        let phi_ref =
-            unsafe { LLVMBuildPhi(self.builder, phi_type.type_ref(), b"phi\0".as_ptr().cast()) };
-        assert!(!phi_ref.is_null());
+        phi_type: Type<'llvm>,
+        incoming: &[(Value<'llvm>, BasicBlock<'llvm>)],
+    ) -> PhiValue<'llvm> {
+        let phi_ref =
+            unsafe { LLVMBuildPhi(self.builder, phi_type.type_ref(), b"phi\0".as_ptr().cast()) };
+        assert!(!phi_ref.is_null());
 
-        for (val, bb) in incoming {
+        for (val, bb) in incoming {
             debug_assert_eq!(
-                val.type_of().kind(),
-                phi_type.kind(),
-                "Type of incoming phi value must be the same as the type used to build the phi node."
-            );
+                val.type_of().kind(),
+                phi_type.kind(),
+                "Type of incoming phi value must be the same as the type used to build the phi node."
+            );
 
-            unsafe {
-                LLVMAddIncoming(phi_ref, &mut val.value_ref() as _, &mut bb.bb_ref() as _, 1);
+            unsafe {
+                LLVMAddIncoming(phi_ref, &mut val.value_ref() as _, &mut bb.bb_ref() as _, 1);
             }
         }
 
-        PhiValue::new(phi_ref)
+        PhiValue::new(phi_ref)
     }
 }
 
-impl Drop for IRBuilder<'_> {
-    fn drop(&mut self) {
-        unsafe { LLVMDisposeBuilder(self.builder) }
+impl Drop for IRBuilder<'_> {
+    fn drop(&mut self) {
+        unsafe { LLVMDisposeBuilder(self.builder) }
     }
 }
 
-
- \ No newline at end of file +
\ No newline at end of file diff --git a/src/llvm_kaleidoscope_rs/llvm/lljit.rs.html b/src/llvm_kaleidoscope_rs/llvm/lljit.rs.html index 5a5a376..80be225 100644 --- a/src/llvm_kaleidoscope_rs/llvm/lljit.rs.html +++ b/src/llvm_kaleidoscope_rs/llvm/lljit.rs.html @@ -1,10 +1,4 @@ -lljit.rs - source -
1
+lljit.rs - source
1
 2
 3
 4
@@ -158,160 +152,159 @@
 152
 153
 154
-
use llvm_sys::orc2::{
-    lljit::{
-        LLVMOrcCreateLLJIT, LLVMOrcLLJITAddLLVMIRModuleWithRT, LLVMOrcLLJITGetGlobalPrefix,
-        LLVMOrcLLJITGetMainJITDylib, LLVMOrcLLJITLookup, LLVMOrcLLJITRef,
+
use llvm_sys::orc2::{
+    lljit::{
+        LLVMOrcCreateLLJIT, LLVMOrcLLJITAddLLVMIRModuleWithRT, LLVMOrcLLJITGetGlobalPrefix,
+        LLVMOrcLLJITGetMainJITDylib, LLVMOrcLLJITLookup, LLVMOrcLLJITRef,
     },
-    LLVMOrcCreateDynamicLibrarySearchGeneratorForProcess, LLVMOrcDefinitionGeneratorRef,
-    LLVMOrcJITDylibAddGenerator, LLVMOrcJITDylibCreateResourceTracker, LLVMOrcJITDylibRef,
-    LLVMOrcReleaseResourceTracker, LLVMOrcResourceTrackerRef, LLVMOrcResourceTrackerRemove,
+    LLVMOrcCreateDynamicLibrarySearchGeneratorForProcess, LLVMOrcDefinitionGeneratorRef,
+    LLVMOrcJITDylibAddGenerator, LLVMOrcJITDylibCreateResourceTracker, LLVMOrcJITDylibRef,
+    LLVMOrcReleaseResourceTracker, LLVMOrcResourceTrackerRef, LLVMOrcResourceTrackerRemove,
 };
 
-use std::convert::TryFrom;
-use std::marker::PhantomData;
+use std::convert::TryFrom;
+use std::marker::PhantomData;
 
-use super::{Error, Module};
-use crate::SmallCStr;
+use super::{Error, Module};
+use crate::SmallCStr;
 
-/// Marker trait to constrain function signatures that can be looked up in the JIT.
-pub trait JitFn {}
+/// Marker trait to constrain function signatures that can be looked up in the JIT.
+pub trait JitFn {}
 
-impl JitFn for unsafe extern "C" fn() -> f64 {}
+impl JitFn for unsafe extern "C" fn() -> f64 {}
 
-/// Wrapper for a LLVM [LLJIT](https://www.llvm.org/docs/ORCv2.html#lljit-and-lllazyjit).
-pub struct LLJit {
-    jit: LLVMOrcLLJITRef,
-    dylib: LLVMOrcJITDylibRef,
+/// Wrapper for a LLVM [LLJIT](https://www.llvm.org/docs/ORCv2.html#lljit-and-lllazyjit).
+pub struct LLJit {
+    jit: LLVMOrcLLJITRef,
+    dylib: LLVMOrcJITDylibRef,
 }
 
-impl LLJit {
-    /// Create a new LLJit instance.
-    ///
-    /// # Panics
-    ///
-    /// Panics if LLVM API returns a `null` pointer or an error.
-    pub fn new() -> LLJit {
-        let (jit, dylib) = unsafe {
-            let mut jit = std::ptr::null_mut();
-            let err = LLVMOrcCreateLLJIT(
-                &mut jit as _,
-                std::ptr::null_mut(), /* builder: nullptr -> default */
-            );
+impl LLJit {
+    /// Create a new LLJit instance.
+    ///
+    /// # Panics
+    ///
+    /// Panics if LLVM API returns a `null` pointer or an error.
+    pub fn new() -> LLJit {
+        let (jit, dylib) = unsafe {
+            let mut jit = std::ptr::null_mut();
+            let err = LLVMOrcCreateLLJIT(
+                &mut jit as _,
+                std::ptr::null_mut(), /* builder: nullptr -> default */
+            );
 
-            if let Some(err) = Error::from(err) {
-                panic!("Error: {}", err.as_str());
+            if let Some(err) = Error::from(err) {
+                panic!("Error: {}", err.as_str());
             }
 
-            let dylib = LLVMOrcLLJITGetMainJITDylib(jit);
-            assert!(!dylib.is_null());
+            let dylib = LLVMOrcLLJITGetMainJITDylib(jit);
+            assert!(!dylib.is_null());
 
-            (jit, dylib)
+            (jit, dylib)
         };
 
-        LLJit { jit, dylib }
+        LLJit { jit, dylib }
     }
 
-    /// Add an LLVM IR module to the JIT. Return a [`ResourceTracker`], which when dropped, will
-    /// remove the code of the LLVM IR module from the JIT.
-    ///
-    /// # Panics
-    ///
-    /// Panics if LLVM API returns a `null` pointer or an error.
-    pub fn add_module(&self, module: Module) -> ResourceTracker<'_> {
-        let tsmod = module.into_raw_thread_safe_module();
+    /// Add an LLVM IR module to the JIT. Return a [`ResourceTracker`], which when dropped, will
+    /// remove the code of the LLVM IR module from the JIT.
+    ///
+    /// # Panics
+    ///
+    /// Panics if LLVM API returns a `null` pointer or an error.
+    pub fn add_module(&self, module: Module) -> ResourceTracker<'_> {
+        let tsmod = module.into_raw_thread_safe_module();
 
-        let rt = unsafe {
-            let rt = LLVMOrcJITDylibCreateResourceTracker(self.dylib);
-            let err = LLVMOrcLLJITAddLLVMIRModuleWithRT(self.jit, rt, tsmod);
+        let rt = unsafe {
+            let rt = LLVMOrcJITDylibCreateResourceTracker(self.dylib);
+            let err = LLVMOrcLLJITAddLLVMIRModuleWithRT(self.jit, rt, tsmod);
 
-            if let Some(err) = Error::from(err) {
-                panic!("Error: {}", err.as_str());
+            if let Some(err) = Error::from(err) {
+                panic!("Error: {}", err.as_str());
             }
 
-            rt
+            rt
         };
 
-        ResourceTracker::new(rt)
+        ResourceTracker::new(rt)
     }
 
-    /// Find the symbol with the name `sym` in the JIT.
-    ///
-    /// # Panics
-    ///
-    /// Panics if the symbol is not found in the JIT.
-    pub fn find_symbol<F: JitFn>(&self, sym: &str) -> F {
-        let sym =
-            SmallCStr::try_from(sym).expect("Failed to convert 'sym' argument to small C string!");
+    /// Find the symbol with the name `sym` in the JIT.
+    ///
+    /// # Panics
+    ///
+    /// Panics if the symbol is not found in the JIT.
+    pub fn find_symbol<F: JitFn>(&self, sym: &str) -> F {
+        let sym =
+            SmallCStr::try_from(sym).expect("Failed to convert 'sym' argument to small C string!");
 
-        unsafe {
-            let mut addr = 0u64;
-            let err = LLVMOrcLLJITLookup(self.jit, &mut addr as _, sym.as_ptr());
+        unsafe {
+            let mut addr = 0u64;
+            let err = LLVMOrcLLJITLookup(self.jit, &mut addr as _, sym.as_ptr());
 
-            if let Some(err) = Error::from(err) {
-                panic!("Error: {}", err.as_str());
+            if let Some(err) = Error::from(err) {
+                panic!("Error: {}", err.as_str());
             }
 
-            debug_assert_eq!(core::mem::size_of_val(&addr), core::mem::size_of::<F>());
-            std::mem::transmute_copy(&addr)
+            debug_assert_eq!(core::mem::size_of_val(&addr), core::mem::size_of::<F>());
+            std::mem::transmute_copy(&addr)
         }
     }
 
-    /// Enable lookup of dynamic symbols available in the current process from the JIT.
-    ///
-    /// # Panics
-    ///
-    /// Panics if LLVM API returns an error.
-    pub fn enable_process_symbols(&self) {
-        unsafe {
-            let mut proc_syms_gen: LLVMOrcDefinitionGeneratorRef = std::ptr::null_mut();
-            let err = LLVMOrcCreateDynamicLibrarySearchGeneratorForProcess(
-                &mut proc_syms_gen as _,
-                self.global_prefix(),
-                None,                 /* filter */
-                std::ptr::null_mut(), /* filter ctx */
-            );
+    /// Enable lookup of dynamic symbols available in the current process from the JIT.
+    ///
+    /// # Panics
+    ///
+    /// Panics if LLVM API returns an error.
+    pub fn enable_process_symbols(&self) {
+        unsafe {
+            let mut proc_syms_gen: LLVMOrcDefinitionGeneratorRef = std::ptr::null_mut();
+            let err = LLVMOrcCreateDynamicLibrarySearchGeneratorForProcess(
+                &mut proc_syms_gen as _,
+                self.global_prefix(),
+                None,                 /* filter */
+                std::ptr::null_mut(), /* filter ctx */
+            );
 
-            if let Some(err) = Error::from(err) {
-                panic!("Error: {}", err.as_str());
+            if let Some(err) = Error::from(err) {
+                panic!("Error: {}", err.as_str());
             }
 
-            LLVMOrcJITDylibAddGenerator(self.dylib, proc_syms_gen);
+            LLVMOrcJITDylibAddGenerator(self.dylib, proc_syms_gen);
         }
     }
 
-    /// Return the global prefix character according to the LLJITs data layout.
-    fn global_prefix(&self) -> libc::c_char {
-        unsafe { LLVMOrcLLJITGetGlobalPrefix(self.jit) }
+    /// Return the global prefix character according to the LLJITs data layout.
+    fn global_prefix(&self) -> libc::c_char {
+        unsafe { LLVMOrcLLJITGetGlobalPrefix(self.jit) }
     }
 }
 
-/// A resource handle for code added to an [`LLJit`] instance.
-///
-/// When a `ResourceTracker` handle is dropped, the code corresponding to the handle will be
-/// removed from the JIT.
-pub struct ResourceTracker<'jit>(LLVMOrcResourceTrackerRef, PhantomData<&'jit ()>);
+/// A resource handle for code added to an [`LLJit`] instance.
+///
+/// When a `ResourceTracker` handle is dropped, the code corresponding to the handle will be
+/// removed from the JIT.
+pub struct ResourceTracker<'jit>(LLVMOrcResourceTrackerRef, PhantomData<&'jit ()>);
 
-impl<'jit> ResourceTracker<'jit> {
-    fn new(rt: LLVMOrcResourceTrackerRef) -> ResourceTracker<'jit> {
-        assert!(!rt.is_null());
-        ResourceTracker(rt, PhantomData)
+impl<'jit> ResourceTracker<'jit> {
+    fn new(rt: LLVMOrcResourceTrackerRef) -> ResourceTracker<'jit> {
+        assert!(!rt.is_null());
+        ResourceTracker(rt, PhantomData)
     }
 }
 
-impl Drop for ResourceTracker<'_> {
-    fn drop(&mut self) {
-        unsafe {
-            let err = LLVMOrcResourceTrackerRemove(self.0);
+impl Drop for ResourceTracker<'_> {
+    fn drop(&mut self) {
+        unsafe {
+            let err = LLVMOrcResourceTrackerRemove(self.0);
 
-            if let Some(err) = Error::from(err) {
-                panic!("Error: {}", err.as_str());
+            if let Some(err) = Error::from(err) {
+                panic!("Error: {}", err.as_str());
             }
 
-            LLVMOrcReleaseResourceTracker(self.0);
+            LLVMOrcReleaseResourceTracker(self.0);
         };
     }
 }
 
-
- \ No newline at end of file +
\ No newline at end of file diff --git a/src/llvm_kaleidoscope_rs/llvm/mod.rs.html b/src/llvm_kaleidoscope_rs/llvm/mod.rs.html index 3dca9c7..87756d4 100644 --- a/src/llvm_kaleidoscope_rs/llvm/mod.rs.html +++ b/src/llvm_kaleidoscope_rs/llvm/mod.rs.html @@ -1,10 +1,4 @@ -mod.rs - source -
1
+mod.rs - source
1
 2
 3
 4
@@ -78,80 +72,79 @@
 72
 73
 74
-
//! Safe wrapper around the LLVM C API.
-//!
-//! References returned from the LLVM API are tied to the `'llvm` lifetime which is bound to the
-//! context where the objects are created in.
-//! We do not offer wrappers to remove or delete any objects in the context and therefore all the
-//! references will be valid for the liftime of the context.
-//!
-//! For the scope of this tutorial we mainly use assertions to validate the results from the LLVM
-//! API calls.
+
//! Safe wrapper around the LLVM C API.
+//!
+//! References returned from the LLVM API are tied to the `'llvm` lifetime which is bound to the
+//! context where the objects are created in.
+//! We do not offer wrappers to remove or delete any objects in the context and therefore all the
+//! references will be valid for the liftime of the context.
+//!
+//! For the scope of this tutorial we mainly use assertions to validate the results from the LLVM
+//! API calls.
 
-use llvm_sys::{
-    core::LLVMShutdown,
-    error::{LLVMDisposeErrorMessage, LLVMErrorRef, LLVMGetErrorMessage},
-    target::{
-        LLVM_InitializeNativeAsmParser, LLVM_InitializeNativeAsmPrinter,
-        LLVM_InitializeNativeTarget,
+use llvm_sys::{
+    core::LLVMShutdown,
+    error::{LLVMDisposeErrorMessage, LLVMErrorRef, LLVMGetErrorMessage},
+    target::{
+        LLVM_InitializeNativeAsmParser, LLVM_InitializeNativeAsmPrinter,
+        LLVM_InitializeNativeTarget,
     },
 };
 
-use std::ffi::CStr;
+use std::ffi::CStr;
 
-mod basic_block;
-mod builder;
-mod lljit;
-mod module;
-mod pass_manager;
-mod type_;
-mod value;
+mod basic_block;
+mod builder;
+mod lljit;
+mod module;
+mod pass_manager;
+mod type_;
+mod value;
 
-pub use basic_block::BasicBlock;
-pub use builder::IRBuilder;
-pub use lljit::{LLJit, ResourceTracker};
-pub use module::Module;
-pub use pass_manager::FunctionPassManager;
-pub use type_::Type;
-pub use value::{FnValue, PhiValue, Value};
+pub use basic_block::BasicBlock;
+pub use builder::IRBuilder;
+pub use lljit::{LLJit, ResourceTracker};
+pub use module::Module;
+pub use pass_manager::FunctionPassManager;
+pub use type_::Type;
+pub use value::{FnValue, PhiValue, Value};
 
-struct Error<'llvm>(&'llvm mut libc::c_char);
+struct Error<'llvm>(&'llvm mut libc::c_char);
 
-impl<'llvm> Error<'llvm> {
-    fn from(err: LLVMErrorRef) -> Option<Error<'llvm>> {
-        (!err.is_null()).then(|| Error(unsafe { &mut *LLVMGetErrorMessage(err) }))
+impl<'llvm> Error<'llvm> {
+    fn from(err: LLVMErrorRef) -> Option<Error<'llvm>> {
+        (!err.is_null()).then(|| Error(unsafe { &mut *LLVMGetErrorMessage(err) }))
     }
 
-    fn as_str(&self) -> &str {
-        unsafe { CStr::from_ptr(self.0) }
-            .to_str()
-            .expect("Expected valid UTF8 string from LLVM API")
+    fn as_str(&self) -> &str {
+        unsafe { CStr::from_ptr(self.0) }
+            .to_str()
+            .expect("Expected valid UTF8 string from LLVM API")
     }
 }
 
-impl Drop for Error<'_> {
-    fn drop(&mut self) {
-        unsafe {
-            LLVMDisposeErrorMessage(self.0 as *mut libc::c_char);
+impl Drop for Error<'_> {
+    fn drop(&mut self) {
+        unsafe {
+            LLVMDisposeErrorMessage(self.0 as *mut libc::c_char);
         }
     }
 }
 
-/// Initialize native target for corresponding to host (useful for jitting).
-pub fn initialize_native_taget() {
-    unsafe {
-        assert_eq!(LLVM_InitializeNativeTarget(), 0);
-        assert_eq!(LLVM_InitializeNativeAsmParser(), 0);
-        assert_eq!(LLVM_InitializeNativeAsmPrinter(), 0);
+/// Initialize native target for corresponding to host (useful for jitting).
+pub fn initialize_native_taget() {
+    unsafe {
+        assert_eq!(LLVM_InitializeNativeTarget(), 0);
+        assert_eq!(LLVM_InitializeNativeAsmParser(), 0);
+        assert_eq!(LLVM_InitializeNativeAsmPrinter(), 0);
     }
 }
 
-/// Deallocate and destroy all "ManagedStatic" variables.
-pub fn shutdown() {
-    unsafe {
-        LLVMShutdown();
+/// Deallocate and destroy all "ManagedStatic" variables.
+pub fn shutdown() {
+    unsafe {
+        LLVMShutdown();
     };
 }
 
-
- \ No newline at end of file +
\ No newline at end of file diff --git a/src/llvm_kaleidoscope_rs/llvm/module.rs.html b/src/llvm_kaleidoscope_rs/llvm/module.rs.html index 99846f4..127ba39 100644 --- a/src/llvm_kaleidoscope_rs/llvm/module.rs.html +++ b/src/llvm_kaleidoscope_rs/llvm/module.rs.html @@ -1,10 +1,4 @@ -module.rs - source -
1
+module.rs - source
1
 2
 3
 4
@@ -214,216 +208,215 @@
 208
 209
 210
-
use llvm_sys::{
-    core::{
-        LLVMAddFunction, LLVMAppendBasicBlockInContext, LLVMCreateBasicBlockInContext,
-        LLVMDisposeModule, LLVMDoubleTypeInContext, LLVMDumpModule, LLVMGetNamedFunction,
-        LLVMModuleCreateWithNameInContext,
+
use llvm_sys::{
+    core::{
+        LLVMAddFunction, LLVMAppendBasicBlockInContext, LLVMCreateBasicBlockInContext,
+        LLVMDisposeModule, LLVMDoubleTypeInContext, LLVMDumpModule, LLVMGetNamedFunction,
+        LLVMModuleCreateWithNameInContext,
     },
-    orc2::{
-        LLVMOrcCreateNewThreadSafeContext, LLVMOrcCreateNewThreadSafeModule,
-        LLVMOrcDisposeThreadSafeContext, LLVMOrcThreadSafeContextGetContext,
-        LLVMOrcThreadSafeContextRef, LLVMOrcThreadSafeModuleRef,
+    orc2::{
+        LLVMOrcCreateNewThreadSafeContext, LLVMOrcCreateNewThreadSafeModule,
+        LLVMOrcDisposeThreadSafeContext, LLVMOrcThreadSafeContextGetContext,
+        LLVMOrcThreadSafeContextRef, LLVMOrcThreadSafeModuleRef,
     },
-    prelude::{LLVMBool, LLVMContextRef, LLVMModuleRef, LLVMTypeRef},
-    LLVMTypeKind,
+    prelude::{LLVMBool, LLVMContextRef, LLVMModuleRef, LLVMTypeRef},
+    LLVMTypeKind,
 };
 
-use std::convert::TryFrom;
+use std::convert::TryFrom;
 
-use super::{BasicBlock, FnValue, Type};
-use crate::SmallCStr;
+use super::{BasicBlock, FnValue, Type};
+use crate::SmallCStr;
 
-// Definition of LLVM C API functions using our `repr(transparent)` types.
-extern "C" {
-    fn LLVMFunctionType(
-        ReturnType: Type<'_>,
-        ParamTypes: *mut Type<'_>,
-        ParamCount: ::libc::c_uint,
-        IsVarArg: LLVMBool,
-    ) -> LLVMTypeRef;
+// Definition of LLVM C API functions using our `repr(transparent)` types.
+extern "C" {
+    fn LLVMFunctionType(
+        ReturnType: Type<'_>,
+        ParamTypes: *mut Type<'_>,
+        ParamCount: ::libc::c_uint,
+        IsVarArg: LLVMBool,
+    ) -> LLVMTypeRef;
 }
 
-/// Wrapper for a LLVM Module with its own LLVM Context.
-pub struct Module {
-    tsctx: LLVMOrcThreadSafeContextRef,
-    ctx: LLVMContextRef,
-    module: LLVMModuleRef,
+/// Wrapper for a LLVM Module with its own LLVM Context.
+pub struct Module {
+    tsctx: LLVMOrcThreadSafeContextRef,
+    ctx: LLVMContextRef,
+    module: LLVMModuleRef,
 }
 
-impl<'llvm> Module {
-    /// Create a new Module instance.
-    ///
-    /// # Panics
-    ///
-    /// Panics if creating the context or the module fails.
-    pub fn new() -> Self {
-        let (tsctx, ctx, module) = unsafe {
-            // We generate a thread safe context because we are going to jit this IR module and
-            // there is no method to create a thread safe context wrapper from an existing context
-            // reference (at the time of writing this).
-            //
-            // ThreadSafeContext has shared ownership (start with ref count 1).
-            // We must explicitly dispose our reference (dec ref count).
-            let tc = LLVMOrcCreateNewThreadSafeContext();
-            assert!(!tc.is_null());
+impl<'llvm> Module {
+    /// Create a new Module instance.
+    ///
+    /// # Panics
+    ///
+    /// Panics if creating the context or the module fails.
+    pub fn new() -> Self {
+        let (tsctx, ctx, module) = unsafe {
+            // We generate a thread safe context because we are going to jit this IR module and
+            // there is no method to create a thread safe context wrapper from an existing context
+            // reference (at the time of writing this).
+            //
+            // ThreadSafeContext has shared ownership (start with ref count 1).
+            // We must explicitly dispose our reference (dec ref count).
+            let tc = LLVMOrcCreateNewThreadSafeContext();
+            assert!(!tc.is_null());
 
-            let c = LLVMOrcThreadSafeContextGetContext(tc);
-            let m = LLVMModuleCreateWithNameInContext(b"module\0".as_ptr().cast(), c);
-            assert!(!c.is_null() && !m.is_null());
-            (tc, c, m)
+            let c = LLVMOrcThreadSafeContextGetContext(tc);
+            let m = LLVMModuleCreateWithNameInContext(b"module\0".as_ptr().cast(), c);
+            assert!(!c.is_null() && !m.is_null());
+            (tc, c, m)
         };
 
-        Module { tsctx, ctx, module }
+        Module { tsctx, ctx, module }
     }
 
-    /// Get the raw LLVM context reference.
-    #[inline]
-    pub(super) fn ctx(&self) -> LLVMContextRef {
-        self.ctx
+    /// Get the raw LLVM context reference.
+    #[inline]
+    pub(super) fn ctx(&self) -> LLVMContextRef {
+        self.ctx
     }
 
-    /// Get the raw LLVM module reference.
-    #[inline]
-    pub(super) fn module(&self) -> LLVMModuleRef {
-        self.module
+    /// Get the raw LLVM module reference.
+    #[inline]
+    pub(super) fn module(&self) -> LLVMModuleRef {
+        self.module
     }
 
-    /// Consume the module and turn in into a raw LLVM ThreadSafeModule reference.
-    ///
-    /// If ownership of the raw reference is not transferred (eg to the JIT), memory will be leaked
-    /// in case the reference is disposed explicitly with LLVMOrcDisposeThreadSafeModule.
-    #[inline]
-    pub(super) fn into_raw_thread_safe_module(mut self) -> LLVMOrcThreadSafeModuleRef {
-        let m = std::mem::replace(&mut self.module, std::ptr::null_mut());
+    /// Consume the module and turn in into a raw LLVM ThreadSafeModule reference.
+    ///
+    /// If ownership of the raw reference is not transferred (eg to the JIT), memory will be leaked
+    /// in case the reference is disposed explicitly with LLVMOrcDisposeThreadSafeModule.
+    #[inline]
+    pub(super) fn into_raw_thread_safe_module(mut self) -> LLVMOrcThreadSafeModuleRef {
+        let m = std::mem::replace(&mut self.module, std::ptr::null_mut());
 
-        // ThreadSafeModule has unique ownership.
-        // Takes ownership of module and increments ThreadSafeContext ref count.
-        //
-        // We must not reference/dispose `m` after this call, but we need to dispose our `tsctx`
-        // reference.
-        let tm = unsafe { LLVMOrcCreateNewThreadSafeModule(m, self.tsctx) };
-        assert!(!tm.is_null());
+        // ThreadSafeModule has unique ownership.
+        // Takes ownership of module and increments ThreadSafeContext ref count.
+        //
+        // We must not reference/dispose `m` after this call, but we need to dispose our `tsctx`
+        // reference.
+        let tm = unsafe { LLVMOrcCreateNewThreadSafeModule(m, self.tsctx) };
+        assert!(!tm.is_null());
 
-        tm
+        tm
     }
 
-    /// Dump LLVM IR emitted into the Module to stdout.
-    pub fn dump(&self) {
-        unsafe { LLVMDumpModule(self.module) };
+    /// Dump LLVM IR emitted into the Module to stdout.
+    pub fn dump(&self) {
+        unsafe { LLVMDumpModule(self.module) };
     }
 
-    /// Get a type reference representing a `f64` float.
-    ///
-    /// # Panics
-    ///
-    /// Panics if LLVM API returns a `null` pointer.
-    pub fn type_f64(&self) -> Type<'llvm> {
-        let type_ref = unsafe { LLVMDoubleTypeInContext(self.ctx) };
-        Type::new(type_ref)
+    /// Get a type reference representing a `f64` float.
+    ///
+    /// # Panics
+    ///
+    /// Panics if LLVM API returns a `null` pointer.
+    pub fn type_f64(&self) -> Type<'llvm> {
+        let type_ref = unsafe { LLVMDoubleTypeInContext(self.ctx) };
+        Type::new(type_ref)
     }
 
-    /// Get a type reference representing a `fn(args) -> ret` function.
-    ///
-    /// # Panics
-    ///
-    /// Panics if LLVM API returns a `null` pointer.
-    pub fn type_fn(&'llvm self, args: &mut [Type<'llvm>], ret: Type<'llvm>) -> Type<'llvm> {
-        let type_ref = unsafe {
-            LLVMFunctionType(
-                ret,
-                args.as_mut_ptr(),
-                args.len() as libc::c_uint,
-                0, /* IsVarArg */
-            )
+    /// Get a type reference representing a `fn(args) -> ret` function.
+    ///
+    /// # Panics
+    ///
+    /// Panics if LLVM API returns a `null` pointer.
+    pub fn type_fn(&'llvm self, args: &mut [Type<'llvm>], ret: Type<'llvm>) -> Type<'llvm> {
+        let type_ref = unsafe {
+            LLVMFunctionType(
+                ret,
+                args.as_mut_ptr(),
+                args.len() as libc::c_uint,
+                0, /* IsVarArg */
+            )
         };
-        Type::new(type_ref)
+        Type::new(type_ref)
     }
 
-    /// Add a function with the given `name` and `fn_type` to the module and return a value
-    /// reference representing the function.
-    ///
-    /// # Panics
-    ///
-    /// Panics if LLVM API returns a `null` pointer or `name` could not be converted to a
-    /// [`SmallCStr`].
-    pub fn add_fn(&'llvm self, name: &str, fn_type: Type<'llvm>) -> FnValue<'llvm> {
+    /// Add a function with the given `name` and `fn_type` to the module and return a value
+    /// reference representing the function.
+    ///
+    /// # Panics
+    ///
+    /// Panics if LLVM API returns a `null` pointer or `name` could not be converted to a
+    /// [`SmallCStr`].
+    pub fn add_fn(&'llvm self, name: &str, fn_type: Type<'llvm>) -> FnValue<'llvm> {
         debug_assert_eq!(
-            fn_type.kind(),
-            LLVMTypeKind::LLVMFunctionTypeKind,
-            "Expected a function type when adding a function!"
-        );
+            fn_type.kind(),
+            LLVMTypeKind::LLVMFunctionTypeKind,
+            "Expected a function type when adding a function!"
+        );
 
-        let name = SmallCStr::try_from(name)
-            .expect("Failed to convert 'name' argument to small C string!");
+        let name = SmallCStr::try_from(name)
+            .expect("Failed to convert 'name' argument to small C string!");
 
-        let value_ref = unsafe { LLVMAddFunction(self.module, name.as_ptr(), fn_type.type_ref()) };
-        FnValue::new(value_ref)
+        let value_ref = unsafe { LLVMAddFunction(self.module, name.as_ptr(), fn_type.type_ref()) };
+        FnValue::new(value_ref)
     }
 
-    /// Get a function value reference to the function with the given `name` if it was previously
-    /// added to the module with [`add_fn`][Module::add_fn].
-    ///
-    /// # Panics
-    ///
-    /// Panics if `name` could not be converted to a [`SmallCStr`].
-    pub fn get_fn(&'llvm self, name: &str) -> Option<FnValue<'llvm>> {
-        let name = SmallCStr::try_from(name)
-            .expect("Failed to convert 'name' argument to small C string!");
+    /// Get a function value reference to the function with the given `name` if it was previously
+    /// added to the module with [`add_fn`][Module::add_fn].
+    ///
+    /// # Panics
+    ///
+    /// Panics if `name` could not be converted to a [`SmallCStr`].
+    pub fn get_fn(&'llvm self, name: &str) -> Option<FnValue<'llvm>> {
+        let name = SmallCStr::try_from(name)
+            .expect("Failed to convert 'name' argument to small C string!");
 
-        let value_ref = unsafe { LLVMGetNamedFunction(self.module, name.as_ptr()) };
+        let value_ref = unsafe { LLVMGetNamedFunction(self.module, name.as_ptr()) };
 
-        (!value_ref.is_null()).then(|| FnValue::new(value_ref))
+        (!value_ref.is_null()).then(|| FnValue::new(value_ref))
     }
 
-    /// Append a Basic Block to the end of the function referenced by the value reference
-    /// `fn_value`.
-    ///
-    /// # Panics
-    ///
-    /// Panics if LLVM API returns a `null` pointer.
-    pub fn append_basic_block(&'llvm self, fn_value: FnValue<'llvm>) -> BasicBlock<'llvm> {
-        let block = unsafe {
-            LLVMAppendBasicBlockInContext(
-                self.ctx,
-                fn_value.value_ref(),
-                b"block\0".as_ptr().cast(),
+    /// Append a Basic Block to the end of the function referenced by the value reference
+    /// `fn_value`.
+    ///
+    /// # Panics
+    ///
+    /// Panics if LLVM API returns a `null` pointer.
+    pub fn append_basic_block(&'llvm self, fn_value: FnValue<'llvm>) -> BasicBlock<'llvm> {
+        let block = unsafe {
+            LLVMAppendBasicBlockInContext(
+                self.ctx,
+                fn_value.value_ref(),
+                b"block\0".as_ptr().cast(),
             )
         };
-        assert!(!block.is_null());
+        assert!(!block.is_null());
 
-        BasicBlock::new(block)
+        BasicBlock::new(block)
     }
 
-    /// Create a free-standing Basic Block without adding it to a function.
-    /// This can be added to a function at a later point in time with
-    /// [`FnValue::append_basic_block`].
-    ///
-    /// # Panics
-    ///
-    /// Panics if LLVM API returns a `null` pointer.
-    pub fn create_basic_block(&self) -> BasicBlock<'llvm> {
-        let block = unsafe { LLVMCreateBasicBlockInContext(self.ctx, b"block\0".as_ptr().cast()) };
-        assert!(!block.is_null());
+    /// Create a free-standing Basic Block without adding it to a function.
+    /// This can be added to a function at a later point in time with
+    /// [`FnValue::append_basic_block`].
+    ///
+    /// # Panics
+    ///
+    /// Panics if LLVM API returns a `null` pointer.
+    pub fn create_basic_block(&self) -> BasicBlock<'llvm> {
+        let block = unsafe { LLVMCreateBasicBlockInContext(self.ctx, b"block\0".as_ptr().cast()) };
+        assert!(!block.is_null());
 
-        BasicBlock::new(block)
+        BasicBlock::new(block)
     }
 }
 
-impl Drop for Module {
-    fn drop(&mut self) {
-        unsafe {
-            // In case we turned the module into a ThreadSafeModule, we must not dispose the module
-            // reference because ThreadSafeModule took ownership!
-            if !self.module.is_null() {
-                LLVMDisposeModule(self.module);
+impl Drop for Module {
+    fn drop(&mut self) {
+        unsafe {
+            // In case we turned the module into a ThreadSafeModule, we must not dispose the module
+            // reference because ThreadSafeModule took ownership!
+            if !self.module.is_null() {
+                LLVMDisposeModule(self.module);
             }
 
-            // Dispose ThreadSafeContext reference (dec ref count) in any case.
-            LLVMOrcDisposeThreadSafeContext(self.tsctx);
+            // Dispose ThreadSafeContext reference (dec ref count) in any case.
+            LLVMOrcDisposeThreadSafeContext(self.tsctx);
         }
     }
 }
 
-
- \ No newline at end of file +
\ No newline at end of file diff --git a/src/llvm_kaleidoscope_rs/llvm/pass_manager.rs.html b/src/llvm_kaleidoscope_rs/llvm/pass_manager.rs.html index ebf9b28..968856f 100644 --- a/src/llvm_kaleidoscope_rs/llvm/pass_manager.rs.html +++ b/src/llvm_kaleidoscope_rs/llvm/pass_manager.rs.html @@ -1,10 +1,4 @@ -pass_manager.rs - source -
1
+pass_manager.rs - source
1
 2
 3
 4
@@ -79,81 +73,80 @@
 73
 74
 75
-
use llvm_sys::{
-    core::{
-        LLVMCreateFunctionPassManagerForModule, LLVMDisposePassManager,
-        LLVMInitializeFunctionPassManager, LLVMRunFunctionPassManager,
+
use llvm_sys::{
+    core::{
+        LLVMCreateFunctionPassManagerForModule, LLVMDisposePassManager,
+        LLVMInitializeFunctionPassManager, LLVMRunFunctionPassManager,
     },
-    prelude::LLVMPassManagerRef,
-    transforms::{
-        instcombine::LLVMAddInstructionCombiningPass,
-        scalar::{LLVMAddCFGSimplificationPass, LLVMAddNewGVNPass, LLVMAddReassociatePass},
+    prelude::LLVMPassManagerRef,
+    transforms::{
+        instcombine::LLVMAddInstructionCombiningPass,
+        scalar::{LLVMAddCFGSimplificationPass, LLVMAddNewGVNPass, LLVMAddReassociatePass},
     },
 };
 
-use std::marker::PhantomData;
+use std::marker::PhantomData;
 
-use super::{FnValue, Module};
+use super::{FnValue, Module};
 
-/// Wrapper for a LLVM Function PassManager (legacy).
-pub struct FunctionPassManager<'llvm> {
-    fpm: LLVMPassManagerRef,
-    _ctx: PhantomData<&'llvm ()>,
+/// Wrapper for a LLVM Function PassManager (legacy).
+pub struct FunctionPassManager<'llvm> {
+    fpm: LLVMPassManagerRef,
+    _ctx: PhantomData<&'llvm ()>,
 }
 
-impl<'llvm> FunctionPassManager<'llvm> {
-    /// Create a new Function PassManager with the following optimization passes
-    /// - InstructionCombiningPass
-    /// - ReassociatePass
-    /// - NewGVNPass
-    /// - CFGSimplificationPass
-    ///
-    /// The list of selected optimization passes is taken from the tutorial chapter [LLVM
-    /// Optimization Passes](https://llvm.org/docs/tutorial/MyFirstLanguageFrontend/LangImpl04.html#id3).
-    pub fn with_ctx(module: &'llvm Module) -> FunctionPassManager<'llvm> {
-        let fpm = unsafe {
-            // Borrows module reference.
-            LLVMCreateFunctionPassManagerForModule(module.module())
+impl<'llvm> FunctionPassManager<'llvm> {
+    /// Create a new Function PassManager with the following optimization passes
+    /// - InstructionCombiningPass
+    /// - ReassociatePass
+    /// - NewGVNPass
+    /// - CFGSimplificationPass
+    ///
+    /// The list of selected optimization passes is taken from the tutorial chapter [LLVM
+    /// Optimization Passes](https://llvm.org/docs/tutorial/MyFirstLanguageFrontend/LangImpl04.html#id3).
+    pub fn with_ctx(module: &'llvm Module) -> FunctionPassManager<'llvm> {
+        let fpm = unsafe {
+            // Borrows module reference.
+            LLVMCreateFunctionPassManagerForModule(module.module())
         };
-        assert!(!fpm.is_null());
+        assert!(!fpm.is_null());
 
-        unsafe {
-            // Do simple "peephole" optimizations and bit-twiddling optzns.
-            LLVMAddInstructionCombiningPass(fpm);
-            // Reassociate expressions.
-            LLVMAddReassociatePass(fpm);
-            // Eliminate Common SubExpressions.
-            LLVMAddNewGVNPass(fpm);
-            // Simplify the control flow graph (deleting unreachable blocks, etc).
-            LLVMAddCFGSimplificationPass(fpm);
+        unsafe {
+            // Do simple "peephole" optimizations and bit-twiddling optzns.
+            LLVMAddInstructionCombiningPass(fpm);
+            // Reassociate expressions.
+            LLVMAddReassociatePass(fpm);
+            // Eliminate Common SubExpressions.
+            LLVMAddNewGVNPass(fpm);
+            // Simplify the control flow graph (deleting unreachable blocks, etc).
+            LLVMAddCFGSimplificationPass(fpm);
 
-            let fail = LLVMInitializeFunctionPassManager(fpm);
-            assert_eq!(fail, 0);
+            let fail = LLVMInitializeFunctionPassManager(fpm);
+            assert_eq!(fail, 0);
         }
 
-        FunctionPassManager {
-            fpm,
-            _ctx: PhantomData,
+        FunctionPassManager {
+            fpm,
+            _ctx: PhantomData,
         }
     }
 
-    /// Run the optimization passes registered with the Function PassManager on the function
-    /// referenced by `fn_value`.
-    pub fn run(&'llvm self, fn_value: FnValue<'llvm>) {
-        unsafe {
-            // Returns 1 if any of the passes modified the function, false otherwise.
-            LLVMRunFunctionPassManager(self.fpm, fn_value.value_ref());
+    /// Run the optimization passes registered with the Function PassManager on the function
+    /// referenced by `fn_value`.
+    pub fn run(&'llvm self, fn_value: FnValue<'llvm>) {
+        unsafe {
+            // Returns 1 if any of the passes modified the function, false otherwise.
+            LLVMRunFunctionPassManager(self.fpm, fn_value.value_ref());
         }
     }
 }
 
-impl Drop for FunctionPassManager<'_> {
-    fn drop(&mut self) {
-        unsafe {
-            LLVMDisposePassManager(self.fpm);
+impl Drop for FunctionPassManager<'_> {
+    fn drop(&mut self) {
+        unsafe {
+            LLVMDisposePassManager(self.fpm);
         }
     }
 }
 
-
- \ No newline at end of file +
\ No newline at end of file diff --git a/src/llvm_kaleidoscope_rs/llvm/type_.rs.html b/src/llvm_kaleidoscope_rs/llvm/type_.rs.html index 98daee4..7df4f4d 100644 --- a/src/llvm_kaleidoscope_rs/llvm/type_.rs.html +++ b/src/llvm_kaleidoscope_rs/llvm/type_.rs.html @@ -1,10 +1,4 @@ -type_.rs - source -
1
+type_.rs - source
1
 2
 3
 4
@@ -62,64 +56,63 @@
 56
 57
 58
-
use llvm_sys::{
-    core::{LLVMConstReal, LLVMDumpType, LLVMGetTypeKind},
-    prelude::LLVMTypeRef,
-    LLVMTypeKind,
+
use llvm_sys::{
+    core::{LLVMConstReal, LLVMDumpType, LLVMGetTypeKind},
+    prelude::LLVMTypeRef,
+    LLVMTypeKind,
 };
 
-use std::marker::PhantomData;
+use std::marker::PhantomData;
 
-use super::Value;
+use super::Value;
 
-/// Wrapper for a LLVM Type Reference.
-#[derive(Copy, Clone)]
-#[repr(transparent)]
-pub struct Type<'llvm>(LLVMTypeRef, PhantomData<&'llvm ()>);
+/// Wrapper for a LLVM Type Reference.
+#[derive(Copy, Clone)]
+#[repr(transparent)]
+pub struct Type<'llvm>(LLVMTypeRef, PhantomData<&'llvm ()>);
 
-impl<'llvm> Type<'llvm> {
-    /// Create a new Type instance.
-    ///
-    /// # Panics
-    ///
-    /// Panics if `type_ref` is a null pointer.
-    pub(super) fn new(type_ref: LLVMTypeRef) -> Self {
-        assert!(!type_ref.is_null());
-        Type(type_ref, PhantomData)
+impl<'llvm> Type<'llvm> {
+    /// Create a new Type instance.
+    ///
+    /// # Panics
+    ///
+    /// Panics if `type_ref` is a null pointer.
+    pub(super) fn new(type_ref: LLVMTypeRef) -> Self {
+        assert!(!type_ref.is_null());
+        Type(type_ref, PhantomData)
     }
 
-    /// Get the raw LLVM type reference.
-    #[inline]
-    pub(super) fn type_ref(&self) -> LLVMTypeRef {
-        self.0
-    }
+    /// Get the raw LLVM type reference.
+    #[inline]
+    pub(super) fn type_ref(&self) -> LLVMTypeRef {
+        self.0
+    }
 
-    /// Get the LLVM type kind for the given type reference.
-    pub(super) fn kind(&self) -> LLVMTypeKind {
-        unsafe { LLVMGetTypeKind(self.type_ref()) }
+    /// Get the LLVM type kind for the given type reference.
+    pub(super) fn kind(&self) -> LLVMTypeKind {
+        unsafe { LLVMGetTypeKind(self.type_ref()) }
     }
 
-    /// Dump the LLVM Type to stdout.
-    pub fn dump(&self) {
-        unsafe { LLVMDumpType(self.type_ref()) };
+    /// Dump the LLVM Type to stdout.
+    pub fn dump(&self) {
+        unsafe { LLVMDumpType(self.type_ref()) };
     }
 
-    /// Get a value reference representing the const `f64` value.
-    ///
-    /// # Panics
-    ///
-    /// Panics if LLVM API returns a `null` pointer.
-    pub fn const_f64(self, n: f64) -> Value<'llvm> {
+    /// Get a value reference representing the const `f64` value.
+    ///
+    /// # Panics
+    ///
+    /// Panics if LLVM API returns a `null` pointer.
+    pub fn const_f64(self, n: f64) -> Value<'llvm> {
         debug_assert_eq!(
-            self.kind(),
-            LLVMTypeKind::LLVMDoubleTypeKind,
-            "Expected a double type when creating const f64 value!"
-        );
+            self.kind(),
+            LLVMTypeKind::LLVMDoubleTypeKind,
+            "Expected a double type when creating const f64 value!"
+        );
 
-        let value_ref = unsafe { LLVMConstReal(self.type_ref(), n) };
-        Value::new(value_ref)
+        let value_ref = unsafe { LLVMConstReal(self.type_ref(), n) };
+        Value::new(value_ref)
     }
 }
 
-
- \ No newline at end of file +
\ No newline at end of file diff --git a/src/llvm_kaleidoscope_rs/llvm/value.rs.html b/src/llvm_kaleidoscope_rs/llvm/value.rs.html index eaea9c3..102c957 100644 --- a/src/llvm_kaleidoscope_rs/llvm/value.rs.html +++ b/src/llvm_kaleidoscope_rs/llvm/value.rs.html @@ -1,10 +1,4 @@ -value.rs - source -
1
+value.rs - source
1
 2
 3
 4
@@ -241,243 +235,242 @@
 235
 236
 237
-
#![allow(unused)]
-
-use llvm_sys::{
-    analysis::{LLVMVerifierFailureAction, LLVMVerifyFunction},
-    core::{
-        LLVMAddIncoming, LLVMAppendExistingBasicBlock, LLVMCountBasicBlocks, LLVMCountParams,
-        LLVMDumpValue, LLVMGetParam, LLVMGetReturnType, LLVMGetValueKind, LLVMGetValueName2,
-        LLVMIsAFunction, LLVMIsAPHINode, LLVMSetValueName2, LLVMTypeOf,
+
#![allow(unused)]
+
+use llvm_sys::{
+    analysis::{LLVMVerifierFailureAction, LLVMVerifyFunction},
+    core::{
+        LLVMAddIncoming, LLVMAppendExistingBasicBlock, LLVMCountBasicBlocks, LLVMCountParams,
+        LLVMDumpValue, LLVMGetParam, LLVMGetReturnType, LLVMGetValueKind, LLVMGetValueName2,
+        LLVMIsAFunction, LLVMIsAPHINode, LLVMSetValueName2, LLVMTypeOf,
     },
-    prelude::LLVMValueRef,
-    LLVMTypeKind, LLVMValueKind,
+    prelude::LLVMValueRef,
+    LLVMTypeKind, LLVMValueKind,
 };
 
-use std::ffi::CStr;
-use std::marker::PhantomData;
-use std::ops::Deref;
-
-use super::BasicBlock;
-use super::Type;
-
-/// Wrapper for a LLVM Value Reference.
-#[derive(Copy, Clone)]
-#[repr(transparent)]
-pub struct Value<'llvm>(LLVMValueRef, PhantomData<&'llvm ()>);
-
-impl<'llvm> Value<'llvm> {
-    /// Create a new Value instance.
-    ///
-    /// # Panics
-    ///
-    /// Panics if `value_ref` is a null pointer.
-    pub(super) fn new(value_ref: LLVMValueRef) -> Self {
-        assert!(!value_ref.is_null());
-        Value(value_ref, PhantomData)
+use std::ffi::CStr;
+use std::marker::PhantomData;
+use std::ops::Deref;
+
+use super::BasicBlock;
+use super::Type;
+
+/// Wrapper for a LLVM Value Reference.
+#[derive(Copy, Clone)]
+#[repr(transparent)]
+pub struct Value<'llvm>(LLVMValueRef, PhantomData<&'llvm ()>);
+
+impl<'llvm> Value<'llvm> {
+    /// Create a new Value instance.
+    ///
+    /// # Panics
+    ///
+    /// Panics if `value_ref` is a null pointer.
+    pub(super) fn new(value_ref: LLVMValueRef) -> Self {
+        assert!(!value_ref.is_null());
+        Value(value_ref, PhantomData)
     }
 
-    /// Get the raw LLVM value reference.
-    #[inline]
-    pub(super) fn value_ref(&self) -> LLVMValueRef {
-        self.0
-    }
+    /// Get the raw LLVM value reference.
+    #[inline]
+    pub(super) fn value_ref(&self) -> LLVMValueRef {
+        self.0
+    }
 
-    /// Get the LLVM value kind for the given value reference.
-    pub(super) fn kind(&self) -> LLVMValueKind {
-        unsafe { LLVMGetValueKind(self.value_ref()) }
+    /// Get the LLVM value kind for the given value reference.
+    pub(super) fn kind(&self) -> LLVMValueKind {
+        unsafe { LLVMGetValueKind(self.value_ref()) }
     }
 
-    /// Check if value is `function` type.
-    pub(super) fn is_function(&self) -> bool {
-        let cast = unsafe { LLVMIsAFunction(self.value_ref()) };
-        !cast.is_null()
+    /// Check if value is `function` type.
+    pub(super) fn is_function(&self) -> bool {
+        let cast = unsafe { LLVMIsAFunction(self.value_ref()) };
+        !cast.is_null()
     }
 
-    /// Check if value is `phinode` type.
-    pub(super) fn is_phinode(&self) -> bool {
-        let cast = unsafe { LLVMIsAPHINode(self.value_ref()) };
-        !cast.is_null()
+    /// Check if value is `phinode` type.
+    pub(super) fn is_phinode(&self) -> bool {
+        let cast = unsafe { LLVMIsAPHINode(self.value_ref()) };
+        !cast.is_null()
     }
 
-    /// Dump the LLVM Value to stdout.
-    pub fn dump(&self) {
-        unsafe { LLVMDumpValue(self.value_ref()) };
+    /// Dump the LLVM Value to stdout.
+    pub fn dump(&self) {
+        unsafe { LLVMDumpValue(self.value_ref()) };
     }
 
-    /// Get a type reference representing for the given value reference.
-    ///
-    /// # Panics
-    ///
-    /// Panics if LLVM API returns a `null` pointer.
-    pub fn type_of(&self) -> Type<'llvm> {
-        let type_ref = unsafe { LLVMTypeOf(self.value_ref()) };
-        Type::new(type_ref)
+    /// Get a type reference representing for the given value reference.
+    ///
+    /// # Panics
+    ///
+    /// Panics if LLVM API returns a `null` pointer.
+    pub fn type_of(&self) -> Type<'llvm> {
+        let type_ref = unsafe { LLVMTypeOf(self.value_ref()) };
+        Type::new(type_ref)
     }
 
-    /// Set the name for the given value reference.
-    ///
-    /// # Panics
-    ///
-    /// Panics if LLVM API returns a `null` pointer.
-    pub fn set_name(&self, name: &str) {
-        unsafe { LLVMSetValueName2(self.value_ref(), name.as_ptr().cast(), name.len()) };
+    /// Set the name for the given value reference.
+    ///
+    /// # Panics
+    ///
+    /// Panics if LLVM API returns a `null` pointer.
+    pub fn set_name(&self, name: &str) {
+        unsafe { LLVMSetValueName2(self.value_ref(), name.as_ptr().cast(), name.len()) };
     }
 
-    /// Get the name for the given value reference.
-    ///
-    /// # Panics
-    ///
-    /// Panics if LLVM API returns a `null` pointer.
-    pub fn get_name(&self) -> &'llvm str {
-        let name = unsafe {
-            let mut len: libc::size_t = 0;
-            let name = LLVMGetValueName2(self.0, &mut len as _);
-            assert!(!name.is_null());
-
-            CStr::from_ptr(name)
+    /// Get the name for the given value reference.
+    ///
+    /// # Panics
+    ///
+    /// Panics if LLVM API returns a `null` pointer.
+    pub fn get_name(&self) -> &'llvm str {
+        let name = unsafe {
+            let mut len: libc::size_t = 0;
+            let name = LLVMGetValueName2(self.0, &mut len as _);
+            assert!(!name.is_null());
+
+            CStr::from_ptr(name)
         };
 
-        // TODO: Does this string live for the time of the LLVM context?!
-        name.to_str()
-            .expect("Expected valid UTF8 string from LLVM API")
+        // TODO: Does this string live for the time of the LLVM context?!
+        name.to_str()
+            .expect("Expected valid UTF8 string from LLVM API")
     }
 
-    /// Check if value is of `f64` type.
-    pub fn is_f64(&self) -> bool {
-        self.type_of().kind() == LLVMTypeKind::LLVMDoubleTypeKind
+    /// Check if value is of `f64` type.
+    pub fn is_f64(&self) -> bool {
+        self.type_of().kind() == LLVMTypeKind::LLVMDoubleTypeKind
     }
 
-    /// Check if value is of integer type.
-    pub fn is_int(&self) -> bool {
-        self.type_of().kind() == LLVMTypeKind::LLVMIntegerTypeKind
+    /// Check if value is of integer type.
+    pub fn is_int(&self) -> bool {
+        self.type_of().kind() == LLVMTypeKind::LLVMIntegerTypeKind
     }
 }
 
-/// Wrapper for a LLVM Value Reference specialized for contexts where function values are needed.
-#[derive(Copy, Clone)]
-#[repr(transparent)]
-pub struct FnValue<'llvm>(Value<'llvm>);
+/// Wrapper for a LLVM Value Reference specialized for contexts where function values are needed.
+#[derive(Copy, Clone)]
+#[repr(transparent)]
+pub struct FnValue<'llvm>(Value<'llvm>);
 
-impl<'llvm> Deref for FnValue<'llvm> {
-    type Target = Value<'llvm>;
-    fn deref(&self) -> &Self::Target {
-        &self.0
-    }
+impl<'llvm> Deref for FnValue<'llvm> {
+    type Target = Value<'llvm>;
+    fn deref(&self) -> &Self::Target {
+        &self.0
+    }
 }
 
-impl<'llvm> FnValue<'llvm> {
-    /// Create a new FnValue instance.
-    ///
-    /// # Panics
-    ///
-    /// Panics if `value_ref` is a null pointer.
-    pub(super) fn new(value_ref: LLVMValueRef) -> Self {
-        let value = Value::new(value_ref);
+impl<'llvm> FnValue<'llvm> {
+    /// Create a new FnValue instance.
+    ///
+    /// # Panics
+    ///
+    /// Panics if `value_ref` is a null pointer.
+    pub(super) fn new(value_ref: LLVMValueRef) -> Self {
+        let value = Value::new(value_ref);
         debug_assert!(
-            value.is_function(),
-            "Expected a fn value when constructing FnValue!"
-        );
+            value.is_function(),
+            "Expected a fn value when constructing FnValue!"
+        );
 
-        FnValue(value)
+        FnValue(value)
     }
 
-    /// Get a type reference representing the return value of the given function value.
-    ///
-    /// # Panics
-    ///
-    /// Panics if LLVM API returns a `null` pointer.
-    pub fn ret_type(&self) -> Type<'llvm> {
-        let type_ref = unsafe { LLVMGetReturnType(LLVMTypeOf(self.value_ref())) };
-        Type::new(type_ref)
+    /// Get a type reference representing the return value of the given function value.
+    ///
+    /// # Panics
+    ///
+    /// Panics if LLVM API returns a `null` pointer.
+    pub fn ret_type(&self) -> Type<'llvm> {
+        let type_ref = unsafe { LLVMGetReturnType(LLVMTypeOf(self.value_ref())) };
+        Type::new(type_ref)
     }
 
-    /// Get the number of function arguments for the given function value.
-    pub fn args(&self) -> usize {
-        unsafe { LLVMCountParams(self.value_ref()) as usize }
+    /// Get the number of function arguments for the given function value.
+    pub fn args(&self) -> usize {
+        unsafe { LLVMCountParams(self.value_ref()) as usize }
     }
 
-    /// Get a value reference for the function argument at index `idx`.
-    ///
-    /// # Panics
-    ///
-    /// Panics if LLVM API returns a `null` pointer or indexed out of bounds.
-    pub fn arg(&self, idx: usize) -> Value<'llvm> {
-        assert!(idx < self.args());
+    /// Get a value reference for the function argument at index `idx`.
+    ///
+    /// # Panics
+    ///
+    /// Panics if LLVM API returns a `null` pointer or indexed out of bounds.
+    pub fn arg(&self, idx: usize) -> Value<'llvm> {
+        assert!(idx < self.args());
 
-        let value_ref = unsafe { LLVMGetParam(self.value_ref(), idx as libc::c_uint) };
-        Value::new(value_ref)
+        let value_ref = unsafe { LLVMGetParam(self.value_ref(), idx as libc::c_uint) };
+        Value::new(value_ref)
     }
 
-    /// Get the number of Basic Blocks for the given function value.
-    pub fn basic_blocks(&self) -> usize {
-        unsafe { LLVMCountBasicBlocks(self.value_ref()) as usize }
+    /// Get the number of Basic Blocks for the given function value.
+    pub fn basic_blocks(&self) -> usize {
+        unsafe { LLVMCountBasicBlocks(self.value_ref()) as usize }
     }
 
-    /// Append a Basic Block to the end of the function value.
-    pub fn append_basic_block(&self, bb: BasicBlock<'llvm>) {
-        unsafe {
-            LLVMAppendExistingBasicBlock(self.value_ref(), bb.bb_ref());
+    /// Append a Basic Block to the end of the function value.
+    pub fn append_basic_block(&self, bb: BasicBlock<'llvm>) {
+        unsafe {
+            LLVMAppendExistingBasicBlock(self.value_ref(), bb.bb_ref());
         }
     }
 
-    /// Verify that the given function is valid.
-    pub fn verify(&self) -> bool {
-        unsafe {
-            LLVMVerifyFunction(
-                self.value_ref(),
-                LLVMVerifierFailureAction::LLVMPrintMessageAction,
-            ) == 0
-        }
+    /// Verify that the given function is valid.
+    pub fn verify(&self) -> bool {
+        unsafe {
+            LLVMVerifyFunction(
+                self.value_ref(),
+                LLVMVerifierFailureAction::LLVMPrintMessageAction,
+            ) == 0
+        }
     }
 }
 
-/// Wrapper for a LLVM Value Reference specialized for contexts where phi values are needed.
-#[derive(Copy, Clone)]
-#[repr(transparent)]
-pub struct PhiValue<'llvm>(Value<'llvm>);
+/// Wrapper for a LLVM Value Reference specialized for contexts where phi values are needed.
+#[derive(Copy, Clone)]
+#[repr(transparent)]
+pub struct PhiValue<'llvm>(Value<'llvm>);
 
-impl<'llvm> Deref for PhiValue<'llvm> {
-    type Target = Value<'llvm>;
-    fn deref(&self) -> &Self::Target {
-        &self.0
-    }
+impl<'llvm> Deref for PhiValue<'llvm> {
+    type Target = Value<'llvm>;
+    fn deref(&self) -> &Self::Target {
+        &self.0
+    }
 }
 
-impl<'llvm> PhiValue<'llvm> {
-    /// Create a new PhiValue instance.
-    ///
-    /// # Panics
-    ///
-    /// Panics if `value_ref` is a null pointer.
-    pub(super) fn new(value_ref: LLVMValueRef) -> Self {
-        let value = Value::new(value_ref);
+impl<'llvm> PhiValue<'llvm> {
+    /// Create a new PhiValue instance.
+    ///
+    /// # Panics
+    ///
+    /// Panics if `value_ref` is a null pointer.
+    pub(super) fn new(value_ref: LLVMValueRef) -> Self {
+        let value = Value::new(value_ref);
         debug_assert!(
-            value.is_phinode(),
-            "Expected a phinode value when constructing PhiValue!"
-        );
+            value.is_phinode(),
+            "Expected a phinode value when constructing PhiValue!"
+        );
 
-        PhiValue(value)
+        PhiValue(value)
     }
 
-    /// Add an incoming value to the end of a PHI list.
-    pub fn add_incoming(&self, ival: Value<'llvm>, ibb: BasicBlock<'llvm>) {
+    /// Add an incoming value to the end of a PHI list.
+    pub fn add_incoming(&self, ival: Value<'llvm>, ibb: BasicBlock<'llvm>) {
         debug_assert_eq!(
-            ival.type_of().kind(),
-            self.type_of().kind(),
-            "Type of incoming phi value must be the same as the type used to build the phi node."
-        );
-
-        unsafe {
-            LLVMAddIncoming(
-                self.value_ref(),
-                &mut ival.value_ref() as _,
-                &mut ibb.bb_ref() as _,
+            ival.type_of().kind(),
+            self.type_of().kind(),
+            "Type of incoming phi value must be the same as the type used to build the phi node."
+        );
+
+        unsafe {
+            LLVMAddIncoming(
+                self.value_ref(),
+                &mut ival.value_ref() as _,
+                &mut ibb.bb_ref() as _,
                 1,
             );
         }
     }
 }
 
-
- \ No newline at end of file +
\ No newline at end of file diff --git a/src/llvm_kaleidoscope_rs/parser.rs.html b/src/llvm_kaleidoscope_rs/parser.rs.html index d3c9594..1751341 100644 --- a/src/llvm_kaleidoscope_rs/parser.rs.html +++ b/src/llvm_kaleidoscope_rs/parser.rs.html @@ -1,10 +1,4 @@ -parser.rs - source -
1
+parser.rs - source
1
 2
 3
 4
@@ -658,660 +652,659 @@
 652
 653
 654
-
use crate::lexer::{Lexer, Token};
+
use crate::lexer::{Lexer, Token};
 
-#[derive(Debug, PartialEq)]
-pub enum ExprAST {
-    /// Number - Expression class for numeric literals like "1.0".
-    Number(f64),
+#[derive(Debug, PartialEq)]
+pub enum ExprAST {
+    /// Number - Expression class for numeric literals like "1.0".
+    Number(f64),
 
-    /// Variable - Expression class for referencing a variable, like "a".
-    Variable(String),
+    /// Variable - Expression class for referencing a variable, like "a".
+    Variable(String),
 
-    /// Binary - Expression class for a binary operator.
-    Binary(char, Box<ExprAST>, Box<ExprAST>),
+    /// Binary - Expression class for a binary operator.
+    Binary(char, Box<ExprAST>, Box<ExprAST>),
 
-    /// Call - Expression class for function calls.
-    Call(String, Vec<ExprAST>),
+    /// Call - Expression class for function calls.
+    Call(String, Vec<ExprAST>),
 
-    /// If - Expression class for if/then/else.
-    If {
-        cond: Box<ExprAST>,
-        then: Box<ExprAST>,
-        else_: Box<ExprAST>,
+    /// If - Expression class for if/then/else.
+    If {
+        cond: Box<ExprAST>,
+        then: Box<ExprAST>,
+        else_: Box<ExprAST>,
     },
 
-    /// ForExprAST - Expression class for for/in.
-    For {
-        var: String,
-        start: Box<ExprAST>,
-        end: Box<ExprAST>,
-        step: Option<Box<ExprAST>>,
-        body: Box<ExprAST>,
+    /// ForExprAST - Expression class for for/in.
+    For {
+        var: String,
+        start: Box<ExprAST>,
+        end: Box<ExprAST>,
+        step: Option<Box<ExprAST>>,
+        body: Box<ExprAST>,
     },
 }
 
-/// PrototypeAST - This class represents the "prototype" for a function,
-/// which captures its name, and its argument names (thus implicitly the number
-/// of arguments the function takes).
-#[derive(Debug, PartialEq, Clone)]
-pub struct PrototypeAST(pub String, pub Vec<String>);
+/// PrototypeAST - This class represents the "prototype" for a function,
+/// which captures its name, and its argument names (thus implicitly the number
+/// of arguments the function takes).
+#[derive(Debug, PartialEq, Clone)]
+pub struct PrototypeAST(pub String, pub Vec<String>);
 
-/// FunctionAST - This class represents a function definition itself.
-#[derive(Debug, PartialEq)]
-pub struct FunctionAST(pub PrototypeAST, pub ExprAST);
+/// FunctionAST - This class represents a function definition itself.
+#[derive(Debug, PartialEq)]
+pub struct FunctionAST(pub PrototypeAST, pub ExprAST);
 
-/// Parse result with String as Error type (to be compliant with tutorial).
-type ParseResult<T> = Result<T, String>;
+/// Parse result with String as Error type (to be compliant with tutorial).
+type ParseResult<T> = Result<T, String>;
 
-/// Parser for the `kaleidoscope` language.
-pub struct Parser<I>
-where
-    I: Iterator<Item = char>,
+/// Parser for the `kaleidoscope` language.
+pub struct Parser<I>
+where
+    I: Iterator<Item = char>,
 {
-    lexer: Lexer<I>,
-    cur_tok: Option<Token>,
+    lexer: Lexer<I>,
+    cur_tok: Option<Token>,
 }
 
-impl<I> Parser<I>
-where
-    I: Iterator<Item = char>,
+impl<I> Parser<I>
+where
+    I: Iterator<Item = char>,
 {
-    pub fn new(lexer: Lexer<I>) -> Self {
-        Parser {
-            lexer,
-            cur_tok: None,
+    pub fn new(lexer: Lexer<I>) -> Self {
+        Parser {
+            lexer,
+            cur_tok: None,
         }
     }
 
-    // -----------------------
-    //   Simple Token Buffer
-    // -----------------------
+    // -----------------------
+    //   Simple Token Buffer
+    // -----------------------
 
-    /// Implement the global variable `int CurTok;` from the tutorial.
-    ///
-    /// # Panics
-    /// Panics if the parser doesn't have a current token.
-    pub fn cur_tok(&self) -> &Token {
-        self.cur_tok.as_ref().expect("Parser: Expected cur_token!")
+    /// Implement the global variable `int CurTok;` from the tutorial.
+    ///
+    /// # Panics
+    /// Panics if the parser doesn't have a current token.
+    pub fn cur_tok(&self) -> &Token {
+        self.cur_tok.as_ref().expect("Parser: Expected cur_token!")
     }
 
-    /// Advance the `cur_tok` by getting the next token from the lexer.
-    ///
-    /// Implement the fucntion `int getNextToken();` from the tutorial.
-    pub fn get_next_token(&mut self) {
-        self.cur_tok = Some(self.lexer.gettok());
+    /// Advance the `cur_tok` by getting the next token from the lexer.
+    ///
+    /// Implement the fucntion `int getNextToken();` from the tutorial.
+    pub fn get_next_token(&mut self) {
+        self.cur_tok = Some(self.lexer.gettok());
     }
 
-    // ----------------------------
-    //   Basic Expression Parsing
-    // ----------------------------
-
-    /// numberexpr ::= number
-    ///
-    /// Implement `std::unique_ptr<ExprAST> ParseNumberExpr();` from the tutorial.
-    fn parse_num_expr(&mut self) -> ParseResult<ExprAST> {
-        match *self.cur_tok() {
-            Token::Number(num) => {
-                // Consume the number token.
-                self.get_next_token();
-                Ok(ExprAST::Number(num))
+    // ----------------------------
+    //   Basic Expression Parsing
+    // ----------------------------
+
+    /// numberexpr ::= number
+    ///
+    /// Implement `std::unique_ptr<ExprAST> ParseNumberExpr();` from the tutorial.
+    fn parse_num_expr(&mut self) -> ParseResult<ExprAST> {
+        match *self.cur_tok() {
+            Token::Number(num) => {
+                // Consume the number token.
+                self.get_next_token();
+                Ok(ExprAST::Number(num))
             }
-            _ => unreachable!(),
+            _ => unreachable!(),
         }
     }
 
-    /// parenexpr ::= '(' expression ')'
-    ///
-    /// Implement `std::unique_ptr<ExprAST> ParseParenExpr();` from the tutorial.
-    fn parse_paren_expr(&mut self) -> ParseResult<ExprAST> {
-        // Eat '(' token.
-        assert_eq!(*self.cur_tok(), Token::Char('('));
-        self.get_next_token();
-
-        let v = self.parse_expression()?;
-
-        if *self.cur_tok() == Token::Char(')') {
-            // Eat ')' token.
-            self.get_next_token();
-            Ok(v)
-        } else {
-            Err("expected ')'".into())
+    /// parenexpr ::= '(' expression ')'
+    ///
+    /// Implement `std::unique_ptr<ExprAST> ParseParenExpr();` from the tutorial.
+    fn parse_paren_expr(&mut self) -> ParseResult<ExprAST> {
+        // Eat '(' token.
+        assert_eq!(*self.cur_tok(), Token::Char('('));
+        self.get_next_token();
+
+        let v = self.parse_expression()?;
+
+        if *self.cur_tok() == Token::Char(')') {
+            // Eat ')' token.
+            self.get_next_token();
+            Ok(v)
+        } else {
+            Err("expected ')'".into())
         }
     }
 
-    /// identifierexpr
-    ///   ::= identifier
-    ///   ::= identifier '(' expression* ')'
-    ///
-    /// Implement `std::unique_ptr<ExprAST> ParseIdentifierExpr();` from the tutorial.
-    fn parse_identifier_expr(&mut self) -> ParseResult<ExprAST> {
-        let id_name = match self.cur_tok.take() {
-            Some(Token::Identifier(id)) => {
-                // Consume identifier.
-                self.get_next_token();
-                id
+    /// identifierexpr
+    ///   ::= identifier
+    ///   ::= identifier '(' expression* ')'
+    ///
+    /// Implement `std::unique_ptr<ExprAST> ParseIdentifierExpr();` from the tutorial.
+    fn parse_identifier_expr(&mut self) -> ParseResult<ExprAST> {
+        let id_name = match self.cur_tok.take() {
+            Some(Token::Identifier(id)) => {
+                // Consume identifier.
+                self.get_next_token();
+                id
             }
-            _ => unreachable!(),
+            _ => unreachable!(),
         };
 
-        if *self.cur_tok() != Token::Char('(') {
-            // Simple variable reference.
-            Ok(ExprAST::Variable(id_name))
-        } else {
-            // Call.
+        if *self.cur_tok() != Token::Char('(') {
+            // Simple variable reference.
+            Ok(ExprAST::Variable(id_name))
+        } else {
+            // Call.
 
-            // Eat '(' token.
-            self.get_next_token();
+            // Eat '(' token.
+            self.get_next_token();
 
-            let mut args: Vec<ExprAST> = Vec::new();
+            let mut args: Vec<ExprAST> = Vec::new();
 
-            // If there are arguments collect them.
-            if *self.cur_tok() != Token::Char(')') {
-                loop {
-                    let arg = self.parse_expression()?;
-                    args.push(arg);
+            // If there are arguments collect them.
+            if *self.cur_tok() != Token::Char(')') {
+                loop {
+                    let arg = self.parse_expression()?;
+                    args.push(arg);
 
-                    if *self.cur_tok() == Token::Char(')') {
+                    if *self.cur_tok() == Token::Char(')') {
                         break;
                     }
 
-                    if *self.cur_tok() != Token::Char(',') {
-                        return Err("Expected ')' or ',' in argument list".into());
+                    if *self.cur_tok() != Token::Char(',') {
+                        return Err("Expected ')' or ',' in argument list".into());
                     }
 
-                    self.get_next_token();
+                    self.get_next_token();
                 }
             }
 
-            assert_eq!(*self.cur_tok(), Token::Char(')'));
-            // Eat ')' token.
-            self.get_next_token();
+            assert_eq!(*self.cur_tok(), Token::Char(')'));
+            // Eat ')' token.
+            self.get_next_token();
 
-            Ok(ExprAST::Call(id_name, args))
+            Ok(ExprAST::Call(id_name, args))
         }
     }
 
-    /// ifexpr ::= 'if' expression 'then' expression 'else' expression
-    ///
-    /// Implement `std::unique_ptr<ExprAST> ParseIfExpr();` from the tutorial.
-    fn parse_if_expr(&mut self) -> ParseResult<ExprAST> {
-        // Consume 'if' token.
-        assert_eq!(*self.cur_tok(), Token::If);
-        self.get_next_token();
+    /// ifexpr ::= 'if' expression 'then' expression 'else' expression
+    ///
+    /// Implement `std::unique_ptr<ExprAST> ParseIfExpr();` from the tutorial.
+    fn parse_if_expr(&mut self) -> ParseResult<ExprAST> {
+        // Consume 'if' token.
+        assert_eq!(*self.cur_tok(), Token::If);
+        self.get_next_token();
 
-        let cond = self.parse_expression()?;
+        let cond = self.parse_expression()?;
 
-        if *dbg!(self.cur_tok()) != Token::Then {
-            return Err("Expected 'then'".into());
+        if *dbg!(self.cur_tok()) != Token::Then {
+            return Err("Expected 'then'".into());
         }
-        // Consume 'then' token.
-        self.get_next_token();
+        // Consume 'then' token.
+        self.get_next_token();
 
-        let then = self.parse_expression()?;
+        let then = self.parse_expression()?;
 
-        if *self.cur_tok() != Token::Else {
-            return Err("Expected 'else'".into());
+        if *self.cur_tok() != Token::Else {
+            return Err("Expected 'else'".into());
         }
-        // Consume 'else' token.
-        self.get_next_token();
+        // Consume 'else' token.
+        self.get_next_token();
 
-        let else_ = self.parse_expression()?;
+        let else_ = self.parse_expression()?;
 
-        Ok(ExprAST::If {
-            cond: Box::new(cond),
-            then: Box::new(then),
-            else_: Box::new(else_),
+        Ok(ExprAST::If {
+            cond: Box::new(cond),
+            then: Box::new(then),
+            else_: Box::new(else_),
         })
     }
 
-    /// forexpr ::= 'for' identifier '=' expr ',' expr (',' expr)? 'in' expression
-    ///
-    /// Implement `std::unique_ptr<ExprAST> ParseForExpr();` from the tutorial.
-    fn parse_for_expr(&mut self) -> ParseResult<ExprAST> {
-        // Consume the 'for' token.
-        assert_eq!(*self.cur_tok(), Token::For);
-        self.get_next_token();
-
-        let var = match self
-            .parse_identifier_expr()
-            .map_err(|_| String::from("expected identifier after 'for'"))?
-        {
-            ExprAST::Variable(var) => var,
-            _ => unreachable!(),
+    /// forexpr ::= 'for' identifier '=' expr ',' expr (',' expr)? 'in' expression
+    ///
+    /// Implement `std::unique_ptr<ExprAST> ParseForExpr();` from the tutorial.
+    fn parse_for_expr(&mut self) -> ParseResult<ExprAST> {
+        // Consume the 'for' token.
+        assert_eq!(*self.cur_tok(), Token::For);
+        self.get_next_token();
+
+        let var = match self
+            .parse_identifier_expr()
+            .map_err(|_| String::from("expected identifier after 'for'"))?
+        {
+            ExprAST::Variable(var) => var,
+            _ => unreachable!(),
         };
 
-        // Consume the '=' token.
-        if *self.cur_tok() != Token::Char('=') {
-            return Err("expected '=' after for".into());
+        // Consume the '=' token.
+        if *self.cur_tok() != Token::Char('=') {
+            return Err("expected '=' after for".into());
         }
-        self.get_next_token();
+        self.get_next_token();
 
-        let start = self.parse_expression()?;
+        let start = self.parse_expression()?;
 
-        // Consume the ',' token.
-        if *self.cur_tok() != Token::Char(',') {
-            return Err("expected ',' after for start value".into());
+        // Consume the ',' token.
+        if *self.cur_tok() != Token::Char(',') {
+            return Err("expected ',' after for start value".into());
         }
-        self.get_next_token();
+        self.get_next_token();
 
-        let end = self.parse_expression()?;
+        let end = self.parse_expression()?;
 
-        let step = if *self.cur_tok() == Token::Char(',') {
-            // Consume the ',' token.
-            self.get_next_token();
+        let step = if *self.cur_tok() == Token::Char(',') {
+            // Consume the ',' token.
+            self.get_next_token();
 
-            Some(self.parse_expression()?)
-        } else {
-            None
-        };
+            Some(self.parse_expression()?)
+        } else {
+            None
+        };
 
-        // Consume the 'in' token.
-        if *self.cur_tok() != Token::In {
-            return Err("expected 'in' after for".into());
+        // Consume the 'in' token.
+        if *self.cur_tok() != Token::In {
+            return Err("expected 'in' after for".into());
         }
-        self.get_next_token();
+        self.get_next_token();
 
-        let body = self.parse_expression()?;
+        let body = self.parse_expression()?;
 
-        Ok(ExprAST::For {
-            var,
-            start: Box::new(start),
-            end: Box::new(end),
-            step: step.map(|s| Box::new(s)),
-            body: Box::new(body),
+        Ok(ExprAST::For {
+            var,
+            start: Box::new(start),
+            end: Box::new(end),
+            step: step.map(|s| Box::new(s)),
+            body: Box::new(body),
         })
     }
 
-    /// primary
-    ///   ::= identifierexpr
-    ///   ::= numberexpr
-    ///   ::= parenexpr
-    ///
-    /// Implement `std::unique_ptr<ExprAST> ParsePrimary();` from the tutorial.
-    fn parse_primary(&mut self) -> ParseResult<ExprAST> {
-        match *self.cur_tok() {
-            Token::Identifier(_) => self.parse_identifier_expr(),
-            Token::Number(_) => self.parse_num_expr(),
-            Token::Char('(') => self.parse_paren_expr(),
-            Token::If => self.parse_if_expr(),
-            Token::For => self.parse_for_expr(),
-            _ => Err("unknown token when expecting an expression".into()),
+    /// primary
+    ///   ::= identifierexpr
+    ///   ::= numberexpr
+    ///   ::= parenexpr
+    ///
+    /// Implement `std::unique_ptr<ExprAST> ParsePrimary();` from the tutorial.
+    fn parse_primary(&mut self) -> ParseResult<ExprAST> {
+        match *self.cur_tok() {
+            Token::Identifier(_) => self.parse_identifier_expr(),
+            Token::Number(_) => self.parse_num_expr(),
+            Token::Char('(') => self.parse_paren_expr(),
+            Token::If => self.parse_if_expr(),
+            Token::For => self.parse_for_expr(),
+            _ => Err("unknown token when expecting an expression".into()),
         }
     }
 
-    // -----------------------------
-    //   Binary Expression Parsing
-    // -----------------------------
-
-    /// /// expression
-    ///   ::= primary binoprhs
-    ///
-    /// Implement `std::unique_ptr<ExprAST> ParseExpression();` from the tutorial.
-    fn parse_expression(&mut self) -> ParseResult<ExprAST> {
-        let lhs = self.parse_primary()?;
-        self.parse_bin_op_rhs(0, lhs)
+    // -----------------------------
+    //   Binary Expression Parsing
+    // -----------------------------
+
+    /// /// expression
+    ///   ::= primary binoprhs
+    ///
+    /// Implement `std::unique_ptr<ExprAST> ParseExpression();` from the tutorial.
+    fn parse_expression(&mut self) -> ParseResult<ExprAST> {
+        let lhs = self.parse_primary()?;
+        self.parse_bin_op_rhs(0, lhs)
     }
 
-    /// binoprhs
-    ///   ::= ('+' primary)*
-    ///
-    /// Implement `std::unique_ptr<ExprAST> ParseBinOpRHS(int ExprPrec, std::unique_ptr<ExprAST> LHS);` from the tutorial.
-    fn parse_bin_op_rhs(&mut self, expr_prec: isize, mut lhs: ExprAST) -> ParseResult<ExprAST> {
-        loop {
-            let tok_prec = get_tok_precedence(self.cur_tok());
-
-            // Not a binary operator or precedence is too small.
-            if tok_prec < expr_prec {
-                return Ok(lhs);
+    /// binoprhs
+    ///   ::= ('+' primary)*
+    ///
+    /// Implement `std::unique_ptr<ExprAST> ParseBinOpRHS(int ExprPrec, std::unique_ptr<ExprAST> LHS);` from the tutorial.
+    fn parse_bin_op_rhs(&mut self, expr_prec: isize, mut lhs: ExprAST) -> ParseResult<ExprAST> {
+        loop {
+            let tok_prec = get_tok_precedence(self.cur_tok());
+
+            // Not a binary operator or precedence is too small.
+            if tok_prec < expr_prec {
+                return Ok(lhs);
             }
 
-            let binop = match self.cur_tok.take() {
-                Some(Token::Char(c)) => {
-                    // Eat binary operator.
-                    self.get_next_token();
-                    c
+            let binop = match self.cur_tok.take() {
+                Some(Token::Char(c)) => {
+                    // Eat binary operator.
+                    self.get_next_token();
+                    c
                 }
-                _ => unreachable!(),
+                _ => unreachable!(),
             };
 
-            // lhs BINOP1 rhs BINOP2 remrhs
-            //     ^^^^^^     ^^^^^^
-            //     tok_prec   next_prec
-            //
-            // In case BINOP1 has higher precedence, we are done here and can build a 'Binary' AST
-            // node between 'lhs' and 'rhs'.
-            //
-            // In case BINOP2 has higher precedence, we take 'rhs' as 'lhs' and recurse into the
-            // 'remrhs' expression first.
-
-            // Parse primary expression after binary operator.
-            let mut rhs = self.parse_primary()?;
-
-            let next_prec = get_tok_precedence(self.cur_tok());
-            if tok_prec < next_prec {
-                // BINOP2 has higher precedence thatn BINOP1, recurse into 'remhs'.
-                rhs = self.parse_bin_op_rhs(tok_prec + 1, rhs)?
-            }
-
-            lhs = ExprAST::Binary(binop, Box::new(lhs), Box::new(rhs));
+            // lhs BINOP1 rhs BINOP2 remrhs
+            //     ^^^^^^     ^^^^^^
+            //     tok_prec   next_prec
+            //
+            // In case BINOP1 has higher precedence, we are done here and can build a 'Binary' AST
+            // node between 'lhs' and 'rhs'.
+            //
+            // In case BINOP2 has higher precedence, we take 'rhs' as 'lhs' and recurse into the
+            // 'remrhs' expression first.
+
+            // Parse primary expression after binary operator.
+            let mut rhs = self.parse_primary()?;
+
+            let next_prec = get_tok_precedence(self.cur_tok());
+            if tok_prec < next_prec {
+                // BINOP2 has higher precedence thatn BINOP1, recurse into 'remhs'.
+                rhs = self.parse_bin_op_rhs(tok_prec + 1, rhs)?
+            }
+
+            lhs = ExprAST::Binary(binop, Box::new(lhs), Box::new(rhs));
         }
     }
 
-    // --------------------
-    //   Parsing the Rest
-    // --------------------
-
-    /// prototype
-    ///   ::= id '(' id* ')'
-    ///
-    /// Implement `std::unique_ptr<PrototypeAST> ParsePrototype();` from the tutorial.
-    fn parse_prototype(&mut self) -> ParseResult<PrototypeAST> {
-        let id_name = match self.cur_tok.take() {
-            Some(Token::Identifier(id)) => {
-                // Consume the identifier.
-                self.get_next_token();
-                id
+    // --------------------
+    //   Parsing the Rest
+    // --------------------
+
+    /// prototype
+    ///   ::= id '(' id* ')'
+    ///
+    /// Implement `std::unique_ptr<PrototypeAST> ParsePrototype();` from the tutorial.
+    fn parse_prototype(&mut self) -> ParseResult<PrototypeAST> {
+        let id_name = match self.cur_tok.take() {
+            Some(Token::Identifier(id)) => {
+                // Consume the identifier.
+                self.get_next_token();
+                id
             }
-            other => {
-                // Plug back current token.
-                self.cur_tok = other;
-                return Err("Expected function name in prototype".into());
+            other => {
+                // Plug back current token.
+                self.cur_tok = other;
+                return Err("Expected function name in prototype".into());
             }
         };
 
-        if *self.cur_tok() != Token::Char('(') {
-            return Err("Expected '(' in prototype".into());
+        if *self.cur_tok() != Token::Char('(') {
+            return Err("Expected '(' in prototype".into());
         }
 
-        let mut args: Vec<String> = Vec::new();
-        loop {
-            self.get_next_token();
+        let mut args: Vec<String> = Vec::new();
+        loop {
+            self.get_next_token();
 
-            match self.cur_tok.take() {
-                Some(Token::Identifier(arg)) => args.push(arg),
-                Some(Token::Char(',')) => {}
-                other => {
-                    self.cur_tok = other;
+            match self.cur_tok.take() {
+                Some(Token::Identifier(arg)) => args.push(arg),
+                Some(Token::Char(',')) => {}
+                other => {
+                    self.cur_tok = other;
                     break;
                 }
             }
         }
 
-        if *self.cur_tok() != Token::Char(')') {
-            return Err("Expected ')' in prototype".into());
+        if *self.cur_tok() != Token::Char(')') {
+            return Err("Expected ')' in prototype".into());
         }
 
-        // Consume ')'.
-        self.get_next_token();
+        // Consume ')'.
+        self.get_next_token();
 
-        Ok(PrototypeAST(id_name, args))
+        Ok(PrototypeAST(id_name, args))
     }
 
-    /// definition ::= 'def' prototype expression
-    ///
-    /// Implement `std::unique_ptr<FunctionAST> ParseDefinition();` from the tutorial.
-    pub fn parse_definition(&mut self) -> ParseResult<FunctionAST> {
-        // Consume 'def' token.
-        assert_eq!(*self.cur_tok(), Token::Def);
-        self.get_next_token();
+    /// definition ::= 'def' prototype expression
+    ///
+    /// Implement `std::unique_ptr<FunctionAST> ParseDefinition();` from the tutorial.
+    pub fn parse_definition(&mut self) -> ParseResult<FunctionAST> {
+        // Consume 'def' token.
+        assert_eq!(*self.cur_tok(), Token::Def);
+        self.get_next_token();
 
-        let proto = self.parse_prototype()?;
-        let expr = self.parse_expression()?;
+        let proto = self.parse_prototype()?;
+        let expr = self.parse_expression()?;
 
-        Ok(FunctionAST(proto, expr))
+        Ok(FunctionAST(proto, expr))
     }
 
-    /// external ::= 'extern' prototype
-    ///
-    /// Implement `std::unique_ptr<PrototypeAST> ParseExtern();` from the tutorial.
-    pub fn parse_extern(&mut self) -> ParseResult<PrototypeAST> {
-        // Consume 'extern' token.
-        assert_eq!(*self.cur_tok(), Token::Extern);
-        self.get_next_token();
+    /// external ::= 'extern' prototype
+    ///
+    /// Implement `std::unique_ptr<PrototypeAST> ParseExtern();` from the tutorial.
+    pub fn parse_extern(&mut self) -> ParseResult<PrototypeAST> {
+        // Consume 'extern' token.
+        assert_eq!(*self.cur_tok(), Token::Extern);
+        self.get_next_token();
 
-        self.parse_prototype()
+        self.parse_prototype()
     }
 
-    /// toplevelexpr ::= expression
-    ///
-    /// Implement `std::unique_ptr<FunctionAST> ParseTopLevelExpr();` from the tutorial.
-    pub fn parse_top_level_expr(&mut self) -> ParseResult<FunctionAST> {
-        let e = self.parse_expression()?;
-        let proto = PrototypeAST("__anon_expr".into(), Vec::new());
-        Ok(FunctionAST(proto, e))
+    /// toplevelexpr ::= expression
+    ///
+    /// Implement `std::unique_ptr<FunctionAST> ParseTopLevelExpr();` from the tutorial.
+    pub fn parse_top_level_expr(&mut self) -> ParseResult<FunctionAST> {
+        let e = self.parse_expression()?;
+        let proto = PrototypeAST("__anon_expr".into(), Vec::new());
+        Ok(FunctionAST(proto, e))
     }
 }
 
-/// Get the binary operator precedence.
-///
-/// Implement `int GetTokPrecedence();` from the tutorial.
-fn get_tok_precedence(tok: &Token) -> isize {
-    match tok {
-        Token::Char('<') => 10,
-        Token::Char('+') => 20,
-        Token::Char('-') => 20,
-        Token::Char('*') => 40,
-        _ => -1,
+/// Get the binary operator precedence.
+///
+/// Implement `int GetTokPrecedence();` from the tutorial.
+fn get_tok_precedence(tok: &Token) -> isize {
+    match tok {
+        Token::Char('<') => 10,
+        Token::Char('+') => 20,
+        Token::Char('-') => 20,
+        Token::Char('*') => 40,
+        _ => -1,
     }
 }
 
-#[cfg(test)]
-mod test {
-    use super::{ExprAST, FunctionAST, Parser, PrototypeAST};
-    use crate::lexer::Lexer;
+#[cfg(test)]
+mod test {
+    use super::{ExprAST, FunctionAST, Parser, PrototypeAST};
+    use crate::lexer::Lexer;
 
-    fn parser(input: &str) -> Parser<std::str::Chars> {
-        let l = Lexer::new(input.chars());
-        let mut p = Parser::new(l);
+    fn parser(input: &str) -> Parser<std::str::Chars> {
+        let l = Lexer::new(input.chars());
+        let mut p = Parser::new(l);
 
-        // Drop initial coin, initialize cur_tok.
-        p.get_next_token();
+        // Drop initial coin, initialize cur_tok.
+        p.get_next_token();
 
-        p
+        p
     }
 
-    #[test]
-    fn parse_number() {
-        let mut p = parser("13.37");
+    #[test]
+    fn parse_number() {
+        let mut p = parser("13.37");
 
-        assert_eq!(p.parse_num_expr(), Ok(ExprAST::Number(13.37f64)));
+        assert_eq!(p.parse_num_expr(), Ok(ExprAST::Number(13.37f64)));
     }
 
-    #[test]
-    fn parse_variable() {
-        let mut p = parser("foop");
+    #[test]
+    fn parse_variable() {
+        let mut p = parser("foop");
 
         assert_eq!(
-            p.parse_identifier_expr(),
-            Ok(ExprAST::Variable("foop".into()))
+            p.parse_identifier_expr(),
+            Ok(ExprAST::Variable("foop".into()))
         );
     }
 
-    #[test]
-    fn parse_if() {
-        let mut p = parser("if 1 then 2 else 3");
+    #[test]
+    fn parse_if() {
+        let mut p = parser("if 1 then 2 else 3");
 
-        let cond = Box::new(ExprAST::Number(1f64));
-        let then = Box::new(ExprAST::Number(2f64));
-        let else_ = Box::new(ExprAST::Number(3f64));
+        let cond = Box::new(ExprAST::Number(1f64));
+        let then = Box::new(ExprAST::Number(2f64));
+        let else_ = Box::new(ExprAST::Number(3f64));
 
-        assert_eq!(p.parse_if_expr(), Ok(ExprAST::If { cond, then, else_ }));
+        assert_eq!(p.parse_if_expr(), Ok(ExprAST::If { cond, then, else_ }));
 
-        let mut p = parser("if foo() then bar(2) else baz(3)");
+        let mut p = parser("if foo() then bar(2) else baz(3)");
 
-        let cond = Box::new(ExprAST::Call("foo".into(), vec![]));
-        let then = Box::new(ExprAST::Call("bar".into(), vec![ExprAST::Number(2f64)]));
-        let else_ = Box::new(ExprAST::Call("baz".into(), vec![ExprAST::Number(3f64)]));
+        let cond = Box::new(ExprAST::Call("foo".into(), vec![]));
+        let then = Box::new(ExprAST::Call("bar".into(), vec![ExprAST::Number(2f64)]));
+        let else_ = Box::new(ExprAST::Call("baz".into(), vec![ExprAST::Number(3f64)]));
 
-        assert_eq!(p.parse_if_expr(), Ok(ExprAST::If { cond, then, else_ }));
+        assert_eq!(p.parse_if_expr(), Ok(ExprAST::If { cond, then, else_ }));
     }
 
-    #[test]
-    fn parse_for() {
-        let mut p = parser("for i = 1, 2, 3 in 4");
+    #[test]
+    fn parse_for() {
+        let mut p = parser("for i = 1, 2, 3 in 4");
 
-        let var = String::from("i");
-        let start = Box::new(ExprAST::Number(1f64));
-        let end = Box::new(ExprAST::Number(2f64));
-        let step = Some(Box::new(ExprAST::Number(3f64)));
-        let body = Box::new(ExprAST::Number(4f64));
+        let var = String::from("i");
+        let start = Box::new(ExprAST::Number(1f64));
+        let end = Box::new(ExprAST::Number(2f64));
+        let step = Some(Box::new(ExprAST::Number(3f64)));
+        let body = Box::new(ExprAST::Number(4f64));
 
         assert_eq!(
-            p.parse_for_expr(),
-            Ok(ExprAST::For {
-                var,
-                start,
-                end,
-                step,
-                body
+            p.parse_for_expr(),
+            Ok(ExprAST::For {
+                var,
+                start,
+                end,
+                step,
+                body
             })
         );
     }
 
-    #[test]
-    fn parse_for_no_step() {
-        let mut p = parser("for i = 1, 2 in 4");
+    #[test]
+    fn parse_for_no_step() {
+        let mut p = parser("for i = 1, 2 in 4");
 
-        let var = String::from("i");
-        let start = Box::new(ExprAST::Number(1f64));
-        let end = Box::new(ExprAST::Number(2f64));
-        let step = None;
-        let body = Box::new(ExprAST::Number(4f64));
+        let var = String::from("i");
+        let start = Box::new(ExprAST::Number(1f64));
+        let end = Box::new(ExprAST::Number(2f64));
+        let step = None;
+        let body = Box::new(ExprAST::Number(4f64));
 
         assert_eq!(
-            p.parse_for_expr(),
-            Ok(ExprAST::For {
-                var,
-                start,
-                end,
-                step,
-                body
+            p.parse_for_expr(),
+            Ok(ExprAST::For {
+                var,
+                start,
+                end,
+                step,
+                body
             })
         );
     }
 
-    #[test]
-    fn parse_primary() {
-        let mut p = parser("1337 foop \n bla(123) \n if a then b else c \n for x=1,2 in 3");
+    #[test]
+    fn parse_primary() {
+        let mut p = parser("1337 foop \n bla(123) \n if a then b else c \n for x=1,2 in 3");
 
-        assert_eq!(p.parse_primary(), Ok(ExprAST::Number(1337f64)));
+        assert_eq!(p.parse_primary(), Ok(ExprAST::Number(1337f64)));
 
-        assert_eq!(p.parse_primary(), Ok(ExprAST::Variable("foop".into())));
+        assert_eq!(p.parse_primary(), Ok(ExprAST::Variable("foop".into())));
 
         assert_eq!(
-            p.parse_primary(),
-            Ok(ExprAST::Call("bla".into(), vec![ExprAST::Number(123f64)]))
+            p.parse_primary(),
+            Ok(ExprAST::Call("bla".into(), vec![ExprAST::Number(123f64)]))
         );
 
         assert_eq!(
-            p.parse_primary(),
-            Ok(ExprAST::If {
-                cond: Box::new(ExprAST::Variable("a".into())),
-                then: Box::new(ExprAST::Variable("b".into())),
-                else_: Box::new(ExprAST::Variable("c".into())),
+            p.parse_primary(),
+            Ok(ExprAST::If {
+                cond: Box::new(ExprAST::Variable("a".into())),
+                then: Box::new(ExprAST::Variable("b".into())),
+                else_: Box::new(ExprAST::Variable("c".into())),
             })
         );
 
         assert_eq!(
-            p.parse_primary(),
-            Ok(ExprAST::For {
-                var: String::from("x"),
-                start: Box::new(ExprAST::Number(1f64)),
-                end: Box::new(ExprAST::Number(2f64)),
-                step: None,
-                body: Box::new(ExprAST::Number(3f64)),
+            p.parse_primary(),
+            Ok(ExprAST::For {
+                var: String::from("x"),
+                start: Box::new(ExprAST::Number(1f64)),
+                end: Box::new(ExprAST::Number(2f64)),
+                step: None,
+                body: Box::new(ExprAST::Number(3f64)),
             })
         );
     }
 
-    #[test]
-    fn parse_binary_op() {
-        // Operator before RHS has higher precedence, expected AST
-        //
-        //       -
-        //      / \
-        //     +     c
-        //    / \
-        //   a   b
-        let mut p = parser("a + b - c");
-
-        let binexpr_ab = ExprAST::Binary(
+    #[test]
+    fn parse_binary_op() {
+        // Operator before RHS has higher precedence, expected AST
+        //
+        //       -
+        //      / \
+        //     +     c
+        //    / \
+        //   a   b
+        let mut p = parser("a + b - c");
+
+        let binexpr_ab = ExprAST::Binary(
             '+',
-            Box::new(ExprAST::Variable("a".into())),
-            Box::new(ExprAST::Variable("b".into())),
+            Box::new(ExprAST::Variable("a".into())),
+            Box::new(ExprAST::Variable("b".into())),
         );
 
-        let binexpr_abc = ExprAST::Binary(
+        let binexpr_abc = ExprAST::Binary(
             '-',
-            Box::new(binexpr_ab),
-            Box::new(ExprAST::Variable("c".into())),
+            Box::new(binexpr_ab),
+            Box::new(ExprAST::Variable("c".into())),
         );
 
-        assert_eq!(p.parse_expression(), Ok(binexpr_abc));
+        assert_eq!(p.parse_expression(), Ok(binexpr_abc));
     }
 
-    #[test]
-    fn parse_binary_op2() {
-        // Operator after RHS has higher precedence, expected AST
-        //
-        //       +
-        //      / \
-        //     a   *
-        //        / \
-        //       b   c
-        let mut p = parser("a + b * c");
-
-        let binexpr_bc = ExprAST::Binary(
+    #[test]
+    fn parse_binary_op2() {
+        // Operator after RHS has higher precedence, expected AST
+        //
+        //       +
+        //      / \
+        //     a   *
+        //        / \
+        //       b   c
+        let mut p = parser("a + b * c");
+
+        let binexpr_bc = ExprAST::Binary(
             '*',
-            Box::new(ExprAST::Variable("b".into())),
-            Box::new(ExprAST::Variable("c".into())),
+            Box::new(ExprAST::Variable("b".into())),
+            Box::new(ExprAST::Variable("c".into())),
         );
 
-        let binexpr_abc = ExprAST::Binary(
+        let binexpr_abc = ExprAST::Binary(
             '+',
-            Box::new(ExprAST::Variable("a".into())),
-            Box::new(binexpr_bc),
+            Box::new(ExprAST::Variable("a".into())),
+            Box::new(binexpr_bc),
         );
 
-        assert_eq!(p.parse_expression(), Ok(binexpr_abc));
+        assert_eq!(p.parse_expression(), Ok(binexpr_abc));
     }
 
-    #[test]
-    fn parse_prototype() {
-        let mut p = parser("foo(a,b)");
+    #[test]
+    fn parse_prototype() {
+        let mut p = parser("foo(a,b)");
 
-        let proto = PrototypeAST("foo".into(), vec!["a".into(), "b".into()]);
+        let proto = PrototypeAST("foo".into(), vec!["a".into(), "b".into()]);
 
-        assert_eq!(p.parse_prototype(), Ok(proto));
+        assert_eq!(p.parse_prototype(), Ok(proto));
     }
 
-    #[test]
-    fn parse_definition() {
-        let mut p = parser("def bar( arg0 , arg1 ) arg0 + arg1");
+    #[test]
+    fn parse_definition() {
+        let mut p = parser("def bar( arg0 , arg1 ) arg0 + arg1");
 
-        let proto = PrototypeAST("bar".into(), vec!["arg0".into(), "arg1".into()]);
+        let proto = PrototypeAST("bar".into(), vec!["arg0".into(), "arg1".into()]);
 
-        let body = ExprAST::Binary(
+        let body = ExprAST::Binary(
             '+',
-            Box::new(ExprAST::Variable("arg0".into())),
-            Box::new(ExprAST::Variable("arg1".into())),
+            Box::new(ExprAST::Variable("arg0".into())),
+            Box::new(ExprAST::Variable("arg1".into())),
         );
 
-        let func = FunctionAST(proto, body);
+        let func = FunctionAST(proto, body);
 
-        assert_eq!(p.parse_definition(), Ok(func));
+        assert_eq!(p.parse_definition(), Ok(func));
     }
 
-    #[test]
-    fn parse_extern() {
-        let mut p = parser("extern baz()");
+    #[test]
+    fn parse_extern() {
+        let mut p = parser("extern baz()");
 
-        let proto = PrototypeAST("baz".into(), vec![]);
+        let proto = PrototypeAST("baz".into(), vec![]);
 
-        assert_eq!(p.parse_extern(), Ok(proto));
+        assert_eq!(p.parse_extern(), Ok(proto));
     }
 }
 
-
- \ No newline at end of file +
\ No newline at end of file diff --git a/storage.js b/storage.js index ad14b2a..07f8962 100644 --- a/storage.js +++ b/storage.js @@ -1 +1 @@ -"use strict";const darkThemes=["dark","ayu"];window.currentTheme=document.getElementById("themeStyle");window.mainTheme=document.getElementById("mainThemeStyle");const settingsDataset=(function(){const settingsElement=document.getElementById("default-settings");if(settingsElement===null){return null}const dataset=settingsElement.dataset;if(dataset===undefined){return null}return dataset})();function getSettingValue(settingName){const current=getCurrentValue(settingName);if(current!==null){return current}if(settingsDataset!==null){const def=settingsDataset[settingName.replace(/-/g,"_")];if(def!==undefined){return def}}return null}const localStoredTheme=getSettingValue("theme");const savedHref=[];function hasClass(elem,className){return elem&&elem.classList&&elem.classList.contains(className)}function addClass(elem,className){if(!elem||!elem.classList){return}elem.classList.add(className)}function removeClass(elem,className){if(!elem||!elem.classList){return}elem.classList.remove(className)}function onEach(arr,func,reversed){if(arr&&arr.length>0&&func){if(reversed){const length=arr.length;for(let i=length-1;i>=0;--i){if(func(arr[i])){return true}}}else{for(const elem of arr){if(func(elem)){return true}}}}return false}function onEachLazy(lazyArray,func,reversed){return onEach(Array.prototype.slice.call(lazyArray),func,reversed)}function updateLocalStorage(name,value){try{window.localStorage.setItem("rustdoc-"+name,value)}catch(e){}}function getCurrentValue(name){try{return window.localStorage.getItem("rustdoc-"+name)}catch(e){return null}}function switchTheme(styleElem,mainStyleElem,newTheme,saveTheme){const newHref=mainStyleElem.href.replace(/\/rustdoc([^/]*)\.css/,"/"+newTheme+"$1"+".css");if(saveTheme){updateLocalStorage("theme",newTheme)}if(styleElem.href===newHref){return}let found=false;if(savedHref.length===0){onEachLazy(document.getElementsByTagName("link"),el=>{savedHref.push(el.href)})}onEach(savedHref,el=>{if(el===newHref){found=true;return true}});if(found){styleElem.href=newHref}}function useSystemTheme(value){if(value===undefined){value=true}updateLocalStorage("use-system-theme",value);const toggle=document.getElementById("use-system-theme");if(toggle&&toggle instanceof HTMLInputElement){toggle.checked=value}}const updateSystemTheme=(function(){if(!window.matchMedia){return()=>{const cssTheme=getComputedStyle(document.documentElement).getPropertyValue("content");switchTheme(window.currentTheme,window.mainTheme,JSON.parse(cssTheme)||"light",true)}}const mql=window.matchMedia("(prefers-color-scheme: dark)");function handlePreferenceChange(mql){const use=theme=>{switchTheme(window.currentTheme,window.mainTheme,theme,true)};if(getSettingValue("use-system-theme")!=="false"){const lightTheme=getSettingValue("preferred-light-theme")||"light";const darkTheme=getSettingValue("preferred-dark-theme")||"dark";if(mql.matches){use(darkTheme)}else{use(lightTheme)}}else{use(getSettingValue("theme"))}}mql.addListener(handlePreferenceChange);return()=>{handlePreferenceChange(mql)}})();function switchToSavedTheme(){switchTheme(window.currentTheme,window.mainTheme,getSettingValue("theme")||"light",false)}if(getSettingValue("use-system-theme")!=="false"&&window.matchMedia){if(getSettingValue("use-system-theme")===null&&getSettingValue("preferred-dark-theme")===null&&darkThemes.indexOf(localStoredTheme)>=0){updateLocalStorage("preferred-dark-theme",localStoredTheme)}updateSystemTheme()}else{switchToSavedTheme()}if(getSettingValue("source-sidebar-show")==="true"){addClass(document.documentElement,"source-sidebar-expanded")}window.addEventListener("pageshow",ev=>{if(ev.persisted){setTimeout(switchToSavedTheme,0)}}) \ No newline at end of file +"use strict";const darkThemes=["dark","ayu"];window.currentTheme=document.getElementById("themeStyle");window.mainTheme=document.getElementById("mainThemeStyle");window.RUSTDOC_MOBILE_BREAKPOINT=701;const settingsDataset=(function(){const settingsElement=document.getElementById("default-settings");if(settingsElement===null){return null}const dataset=settingsElement.dataset;if(dataset===undefined){return null}return dataset})();function getSettingValue(settingName){const current=getCurrentValue(settingName);if(current!==null){return current}if(settingsDataset!==null){const def=settingsDataset[settingName.replace(/-/g,"_")];if(def!==undefined){return def}}return null}const localStoredTheme=getSettingValue("theme");const savedHref=[];function hasClass(elem,className){return elem&&elem.classList&&elem.classList.contains(className)}function addClass(elem,className){if(!elem||!elem.classList){return}elem.classList.add(className)}function removeClass(elem,className){if(!elem||!elem.classList){return}elem.classList.remove(className)}function onEach(arr,func,reversed){if(arr&&arr.length>0&&func){if(reversed){const length=arr.length;for(let i=length-1;i>=0;--i){if(func(arr[i])){return true}}}else{for(const elem of arr){if(func(elem)){return true}}}}return false}function onEachLazy(lazyArray,func,reversed){return onEach(Array.prototype.slice.call(lazyArray),func,reversed)}function updateLocalStorage(name,value){try{window.localStorage.setItem("rustdoc-"+name,value)}catch(e){}}function getCurrentValue(name){try{return window.localStorage.getItem("rustdoc-"+name)}catch(e){return null}}function switchTheme(styleElem,mainStyleElem,newTheme,saveTheme){const newHref=mainStyleElem.href.replace(/\/rustdoc([^/]*)\.css/,"/"+newTheme+"$1"+".css");if(saveTheme){updateLocalStorage("theme",newTheme)}if(styleElem.href===newHref){return}let found=false;if(savedHref.length===0){onEachLazy(document.getElementsByTagName("link"),el=>{savedHref.push(el.href)})}onEach(savedHref,el=>{if(el===newHref){found=true;return true}});if(found){styleElem.href=newHref}}function useSystemTheme(value){if(value===undefined){value=true}updateLocalStorage("use-system-theme",value);const toggle=document.getElementById("use-system-theme");if(toggle&&toggle instanceof HTMLInputElement){toggle.checked=value}}const updateSystemTheme=(function(){if(!window.matchMedia){return()=>{const cssTheme=getComputedStyle(document.documentElement).getPropertyValue("content");switchTheme(window.currentTheme,window.mainTheme,JSON.parse(cssTheme)||"light",true)}}const mql=window.matchMedia("(prefers-color-scheme: dark)");function handlePreferenceChange(mql){const use=theme=>{switchTheme(window.currentTheme,window.mainTheme,theme,true)};if(getSettingValue("use-system-theme")!=="false"){const lightTheme=getSettingValue("preferred-light-theme")||"light";const darkTheme=getSettingValue("preferred-dark-theme")||"dark";if(mql.matches){use(darkTheme)}else{use(lightTheme)}}else{use(getSettingValue("theme"))}}mql.addListener(handlePreferenceChange);return()=>{handlePreferenceChange(mql)}})();function switchToSavedTheme(){switchTheme(window.currentTheme,window.mainTheme,getSettingValue("theme")||"light",false)}if(getSettingValue("use-system-theme")!=="false"&&window.matchMedia){if(getSettingValue("use-system-theme")===null&&getSettingValue("preferred-dark-theme")===null&&darkThemes.indexOf(localStoredTheme)>=0){updateLocalStorage("preferred-dark-theme",localStoredTheme)}updateSystemTheme()}else{switchToSavedTheme()}if(getSettingValue("source-sidebar-show")==="true"){addClass(document.documentElement,"source-sidebar-expanded")}window.addEventListener("pageshow",ev=>{if(ev.persisted){setTimeout(switchToSavedTheme,0)}}) \ No newline at end of file -- cgit v1.2.3