From 94499e0df0f40bb492126c9f991dd8392f3f6fdd Mon Sep 17 00:00:00 2001 From: Adrian Alic Date: Wed, 28 Jun 2023 23:35:09 +0200 Subject: [PATCH] Initial commit --- .cargo/config.toml | 2 + .gitignore | 2 + Cargo.lock | 95 + Cargo.toml | 33 + LICENSE | 373 ++ benches/lexer.rs | 64 + diff.sh | 1 + rustfmt.toml | 1 + src/ast.rs | 179 + src/bin/main.rs | 24 + src/bin/perfhash.rs | 84 + src/bin/stats.rs | 82 + src/example.ln | 7927 +++++++++++++++++++++++++++++++++++++++ src/experimental/mod.rs | 98 + src/lexer/aarch64.rs | 227 ++ src/lexer/common.rs | 130 + src/lexer/generic.rs | 153 + src/lexer/mod.rs | 36 + src/lib.rs | 451 +++ src/stackvec.rs | 43 + 20 files changed, 10005 insertions(+) create mode 100644 .cargo/config.toml create mode 100644 .gitignore create mode 100644 Cargo.lock create mode 100644 Cargo.toml create mode 100644 LICENSE create mode 100644 benches/lexer.rs create mode 100755 diff.sh create mode 100644 rustfmt.toml create mode 100644 src/ast.rs create mode 100644 src/bin/main.rs create mode 100644 src/bin/perfhash.rs create mode 100644 src/bin/stats.rs create mode 100644 src/example.ln create mode 100644 src/experimental/mod.rs create mode 100644 src/lexer/aarch64.rs create mode 100644 src/lexer/common.rs create mode 100644 src/lexer/generic.rs create mode 100644 src/lexer/mod.rs create mode 100644 src/lib.rs create mode 100644 src/stackvec.rs diff --git a/.cargo/config.toml b/.cargo/config.toml new file mode 100644 index 0000000..8e7b9a7 --- /dev/null +++ b/.cargo/config.toml @@ -0,0 +1,2 @@ +[build] +rustflags = ["-Zpolonius"] \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..7160e41 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +wishlist.ln +/target/ diff --git a/Cargo.lock b/Cargo.lock new file mode 100644 index 0000000..73cfbae --- /dev/null +++ b/Cargo.lock @@ -0,0 +1,95 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "beef" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a8241f3ebb85c056b509d4327ad0358fbbba6ffb340bf388f26350aeda225b1" + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "lnpl" +version = "0.1.0" +dependencies = [ + "logos", +] + +[[package]] +name = "logos" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c000ca4d908ff18ac99b93a062cb8958d331c3220719c52e77cb19cc6ac5d2c1" +dependencies = [ + "logos-derive", +] + +[[package]] +name = "logos-codegen" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc487311295e0002e452025d6b580b77bb17286de87b57138f3b5db711cded68" +dependencies = [ + "beef", + "fnv", + "proc-macro2", + "quote", + "regex-syntax", + "syn", +] + +[[package]] +name = "logos-derive" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dbfc0d229f1f42d790440136d941afd806bc9e949e2bcb8faa813b0f00d1267e" +dependencies = [ + "logos-codegen", +] + +[[package]] +name = "proc-macro2" +version = "1.0.56" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b63bdb0cd06f1f4dedf69b254734f9b45af66e4a031e42a7480257d9898b435" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f4f29d145265ec1c483c7c654450edde0bfe043d3938d6972630663356d9500" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "regex-syntax" +version = "0.6.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" + +[[package]] +name = "syn" +version = "2.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a34fcf3e8b60f57e6a14301a2e916d323af98b0ea63c599441eec8558660c822" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "unicode-ident" +version = "1.0.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5464a87b239f13a63a501f2701565754bae92d243d4bb7eb12f6d57d2269bf4" diff --git a/Cargo.toml b/Cargo.toml new file mode 100644 index 0000000..c617271 --- /dev/null +++ b/Cargo.toml @@ -0,0 +1,33 @@ +[package] +name = "lnpl" +version = "0.1.0" +edition = "2021" + +[lib] +name = "lnpl" +doctest = false +bench = false + +[[bin]] +name = "main" +test = false +bench = false + +# FIXME: Delete this binary crate +[[bin]] +name = "stats" +test = false +bench = false + +[[bin]] +name = "perfhash" +test = false +bench = false + +[[bench]] +name = "lexer" +test = false + +[dependencies] +logos = "0.13.0" + diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..ee6256c --- /dev/null +++ b/LICENSE @@ -0,0 +1,373 @@ +Mozilla Public License Version 2.0 +================================== + +1. Definitions +-------------- + +1.1. "Contributor" + means each individual or legal entity that creates, contributes to + the creation of, or owns Covered Software. + +1.2. "Contributor Version" + means the combination of the Contributions of others (if any) used + by a Contributor and that particular Contributor's Contribution. + +1.3. "Contribution" + means Covered Software of a particular Contributor. + +1.4. "Covered Software" + means Source Code Form to which the initial Contributor has attached + the notice in Exhibit A, the Executable Form of such Source Code + Form, and Modifications of such Source Code Form, in each case + including portions thereof. + +1.5. "Incompatible With Secondary Licenses" + means + + (a) that the initial Contributor has attached the notice described + in Exhibit B to the Covered Software; or + + (b) that the Covered Software was made available under the terms of + version 1.1 or earlier of the License, but not also under the + terms of a Secondary License. + +1.6. "Executable Form" + means any form of the work other than Source Code Form. + +1.7. "Larger Work" + means a work that combines Covered Software with other material, in + a separate file or files, that is not Covered Software. + +1.8. "License" + means this document. + +1.9. "Licensable" + means having the right to grant, to the maximum extent possible, + whether at the time of the initial grant or subsequently, any and + all of the rights conveyed by this License. + +1.10. "Modifications" + means any of the following: + + (a) any file in Source Code Form that results from an addition to, + deletion from, or modification of the contents of Covered + Software; or + + (b) any new file in Source Code Form that contains any Covered + Software. + +1.11. "Patent Claims" of a Contributor + means any patent claim(s), including without limitation, method, + process, and apparatus claims, in any patent Licensable by such + Contributor that would be infringed, but for the grant of the + License, by the making, using, selling, offering for sale, having + made, import, or transfer of either its Contributions or its + Contributor Version. + +1.12. "Secondary License" + means either the GNU General Public License, Version 2.0, the GNU + Lesser General Public License, Version 2.1, the GNU Affero General + Public License, Version 3.0, or any later versions of those + licenses. + +1.13. "Source Code Form" + means the form of the work preferred for making modifications. + +1.14. "You" (or "Your") + means an individual or a legal entity exercising rights under this + License. For legal entities, "You" includes any entity that + controls, is controlled by, or is under common control with You. For + purposes of this definition, "control" means (a) the power, direct + or indirect, to cause the direction or management of such entity, + whether by contract or otherwise, or (b) ownership of more than + fifty percent (50%) of the outstanding shares or beneficial + ownership of such entity. + +2. License Grants and Conditions +-------------------------------- + +2.1. Grants + +Each Contributor hereby grants You a world-wide, royalty-free, +non-exclusive license: + +(a) under intellectual property rights (other than patent or trademark) + Licensable by such Contributor to use, reproduce, make available, + modify, display, perform, distribute, and otherwise exploit its + Contributions, either on an unmodified basis, with Modifications, or + as part of a Larger Work; and + +(b) under Patent Claims of such Contributor to make, use, sell, offer + for sale, have made, import, and otherwise transfer either its + Contributions or its Contributor Version. + +2.2. Effective Date + +The licenses granted in Section 2.1 with respect to any Contribution +become effective for each Contribution on the date the Contributor first +distributes such Contribution. + +2.3. Limitations on Grant Scope + +The licenses granted in this Section 2 are the only rights granted under +this License. No additional rights or licenses will be implied from the +distribution or licensing of Covered Software under this License. +Notwithstanding Section 2.1(b) above, no patent license is granted by a +Contributor: + +(a) for any code that a Contributor has removed from Covered Software; + or + +(b) for infringements caused by: (i) Your and any other third party's + modifications of Covered Software, or (ii) the combination of its + Contributions with other software (except as part of its Contributor + Version); or + +(c) under Patent Claims infringed by Covered Software in the absence of + its Contributions. + +This License does not grant any rights in the trademarks, service marks, +or logos of any Contributor (except as may be necessary to comply with +the notice requirements in Section 3.4). + +2.4. Subsequent Licenses + +No Contributor makes additional grants as a result of Your choice to +distribute the Covered Software under a subsequent version of this +License (see Section 10.2) or under the terms of a Secondary License (if +permitted under the terms of Section 3.3). + +2.5. Representation + +Each Contributor represents that the Contributor believes its +Contributions are its original creation(s) or it has sufficient rights +to grant the rights to its Contributions conveyed by this License. + +2.6. Fair Use + +This License is not intended to limit any rights You have under +applicable copyright doctrines of fair use, fair dealing, or other +equivalents. + +2.7. Conditions + +Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted +in Section 2.1. + +3. Responsibilities +------------------- + +3.1. Distribution of Source Form + +All distribution of Covered Software in Source Code Form, including any +Modifications that You create or to which You contribute, must be under +the terms of this License. You must inform recipients that the Source +Code Form of the Covered Software is governed by the terms of this +License, and how they can obtain a copy of this License. You may not +attempt to alter or restrict the recipients' rights in the Source Code +Form. + +3.2. Distribution of Executable Form + +If You distribute Covered Software in Executable Form then: + +(a) such Covered Software must also be made available in Source Code + Form, as described in Section 3.1, and You must inform recipients of + the Executable Form how they can obtain a copy of such Source Code + Form by reasonable means in a timely manner, at a charge no more + than the cost of distribution to the recipient; and + +(b) You may distribute such Executable Form under the terms of this + License, or sublicense it under different terms, provided that the + license for the Executable Form does not attempt to limit or alter + the recipients' rights in the Source Code Form under this License. + +3.3. Distribution of a Larger Work + +You may create and distribute a Larger Work under terms of Your choice, +provided that You also comply with the requirements of this License for +the Covered Software. If the Larger Work is a combination of Covered +Software with a work governed by one or more Secondary Licenses, and the +Covered Software is not Incompatible With Secondary Licenses, this +License permits You to additionally distribute such Covered Software +under the terms of such Secondary License(s), so that the recipient of +the Larger Work may, at their option, further distribute the Covered +Software under the terms of either this License or such Secondary +License(s). + +3.4. Notices + +You may not remove or alter the substance of any license notices +(including copyright notices, patent notices, disclaimers of warranty, +or limitations of liability) contained within the Source Code Form of +the Covered Software, except that You may alter any license notices to +the extent required to remedy known factual inaccuracies. + +3.5. Application of Additional Terms + +You may choose to offer, and to charge a fee for, warranty, support, +indemnity or liability obligations to one or more recipients of Covered +Software. However, You may do so only on Your own behalf, and not on +behalf of any Contributor. You must make it absolutely clear that any +such warranty, support, indemnity, or liability obligation is offered by +You alone, and You hereby agree to indemnify every Contributor for any +liability incurred by such Contributor as a result of warranty, support, +indemnity or liability terms You offer. You may include additional +disclaimers of warranty and limitations of liability specific to any +jurisdiction. + +4. Inability to Comply Due to Statute or Regulation +--------------------------------------------------- + +If it is impossible for You to comply with any of the terms of this +License with respect to some or all of the Covered Software due to +statute, judicial order, or regulation then You must: (a) comply with +the terms of this License to the maximum extent possible; and (b) +describe the limitations and the code they affect. Such description must +be placed in a text file included with all distributions of the Covered +Software under this License. Except to the extent prohibited by statute +or regulation, such description must be sufficiently detailed for a +recipient of ordinary skill to be able to understand it. + +5. Termination +-------------- + +5.1. The rights granted under this License will terminate automatically +if You fail to comply with any of its terms. However, if You become +compliant, then the rights granted under this License from a particular +Contributor are reinstated (a) provisionally, unless and until such +Contributor explicitly and finally terminates Your grants, and (b) on an +ongoing basis, if such Contributor fails to notify You of the +non-compliance by some reasonable means prior to 60 days after You have +come back into compliance. Moreover, Your grants from a particular +Contributor are reinstated on an ongoing basis if such Contributor +notifies You of the non-compliance by some reasonable means, this is the +first time You have received notice of non-compliance with this License +from such Contributor, and You become compliant prior to 30 days after +Your receipt of the notice. + +5.2. If You initiate litigation against any entity by asserting a patent +infringement claim (excluding declaratory judgment actions, +counter-claims, and cross-claims) alleging that a Contributor Version +directly or indirectly infringes any patent, then the rights granted to +You by any and all Contributors for the Covered Software under Section +2.1 of this License shall terminate. + +5.3. In the event of termination under Sections 5.1 or 5.2 above, all +end user license agreements (excluding distributors and resellers) which +have been validly granted by You or Your distributors under this License +prior to termination shall survive termination. + +************************************************************************ +* * +* 6. Disclaimer of Warranty * +* ------------------------- * +* * +* Covered Software is provided under this License on an "as is" * +* basis, without warranty of any kind, either expressed, implied, or * +* statutory, including, without limitation, warranties that the * +* Covered Software is free of defects, merchantable, fit for a * +* particular purpose or non-infringing. The entire risk as to the * +* quality and performance of the Covered Software is with You. * +* Should any Covered Software prove defective in any respect, You * +* (not any Contributor) assume the cost of any necessary servicing, * +* repair, or correction. This disclaimer of warranty constitutes an * +* essential part of this License. No use of any Covered Software is * +* authorized under this License except under this disclaimer. * +* * +************************************************************************ + +************************************************************************ +* * +* 7. Limitation of Liability * +* -------------------------- * +* * +* Under no circumstances and under no legal theory, whether tort * +* (including negligence), contract, or otherwise, shall any * +* Contributor, or anyone who distributes Covered Software as * +* permitted above, be liable to You for any direct, indirect, * +* special, incidental, or consequential damages of any character * +* including, without limitation, damages for lost profits, loss of * +* goodwill, work stoppage, computer failure or malfunction, or any * +* and all other commercial damages or losses, even if such party * +* shall have been informed of the possibility of such damages. This * +* limitation of liability shall not apply to liability for death or * +* personal injury resulting from such party's negligence to the * +* extent applicable law prohibits such limitation. Some * +* jurisdictions do not allow the exclusion or limitation of * +* incidental or consequential damages, so this exclusion and * +* limitation may not apply to You. * +* * +************************************************************************ + +8. Litigation +------------- + +Any litigation relating to this License may be brought only in the +courts of a jurisdiction where the defendant maintains its principal +place of business and such litigation shall be governed by laws of that +jurisdiction, without reference to its conflict-of-law provisions. +Nothing in this Section shall prevent a party's ability to bring +cross-claims or counter-claims. + +9. Miscellaneous +---------------- + +This License represents the complete agreement concerning the subject +matter hereof. If any provision of this License is held to be +unenforceable, such provision shall be reformed only to the extent +necessary to make it enforceable. Any law or regulation which provides +that the language of a contract shall be construed against the drafter +shall not be used to construe this License against a Contributor. + +10. Versions of the License +--------------------------- + +10.1. New Versions + +Mozilla Foundation is the license steward. Except as provided in Section +10.3, no one other than the license steward has the right to modify or +publish new versions of this License. Each version will be given a +distinguishing version number. + +10.2. Effect of New Versions + +You may distribute the Covered Software under the terms of the version +of the License under which You originally received the Covered Software, +or under the terms of any subsequent version published by the license +steward. + +10.3. Modified Versions + +If you create software not governed by this License, and you want to +create a new license for such software, you may create and use a +modified version of this License if you rename the license and remove +any references to the name of the license steward (except to note that +such modified license differs from this License). + +10.4. Distributing Source Code Form that is Incompatible With Secondary +Licenses + +If You choose to distribute Source Code Form that is Incompatible With +Secondary Licenses under the terms of this version of the License, the +notice described in Exhibit B of this License must be attached. + +Exhibit A - Source Code Form License Notice +------------------------------------------- + + This Source Code Form is subject to the terms of the Mozilla Public + License, v. 2.0. If a copy of the MPL was not distributed with this + file, You can obtain one at https://mozilla.org/MPL/2.0/. + +If it is not possible or desirable to put the notice in a particular +file, then You may include the notice in a location (such as a LICENSE +file in a relevant directory) where a recipient would be likely to look +for such a notice. + +You may add additional accurate notices of copyright ownership. + +Exhibit B - "Incompatible With Secondary Licenses" Notice +--------------------------------------------------------- + + This Source Code Form is "Incompatible With Secondary Licenses", as + defined by the Mozilla Public License, v. 2.0. diff --git a/benches/lexer.rs b/benches/lexer.rs new file mode 100644 index 0000000..0b801c6 --- /dev/null +++ b/benches/lexer.rs @@ -0,0 +1,64 @@ +/* + * Copyright (c) Adrian Alic + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. + */ + +#![feature(test)] + +use std::hint::black_box; + +use lnpl::lexer::Lexer; +use logos::Logos; +use test::Bencher; + +extern crate test; + +const SOURCE: &'static str = include_str!("../src/example.ln"); + +#[bench] +fn lnpl_version(b: &mut Bencher) { + assert_impl_parity(); + + b.iter(|| { + // let mut i = 0; + let mut x = Lexer::new(SOURCE); + while let Some(_) = x.next_token() {} + // while let Some(t) = x.next_token() { + // println!("{i} {:?}", t.kind); + // i += 1; + // if i > 57 { + // break; + // } + // } + black_box(x); + }) +} +fn assert_impl_parity() { + let mut x = lnpl::experimental::Token::lexer(SOURCE); + let mut y = Lexer::new(SOURCE); + for i in 0..10000 { + let xn = x.next().unwrap(); + if xn.is_err() { + panic!("{:?}", xn); + } + let logos = xn.unwrap(); + let lnpl = y.next_token().unwrap(); + eprintln!( + "Token #{i} logos: {: <8} lnpl: {: <8}", + std::str::from_utf8(x.slice().as_bytes()).unwrap(), + std::str::from_utf8(y.slice()).unwrap() + ); + assert_eq!(logos, lnpl.kind.into(), "{i}"); + } +} +#[bench] +fn logos_version(b: &mut Bencher) { + b.iter(|| { + let mut x = lnpl::experimental::Token::lexer(SOURCE); + while let Some(_) = x.next() {} + black_box(x); + }) +} diff --git a/diff.sh b/diff.sh new file mode 100755 index 0000000..5465859 --- /dev/null +++ b/diff.sh @@ -0,0 +1 @@ +diff asm_$1.s asm_$2.s diff --git a/rustfmt.toml b/rustfmt.toml new file mode 100644 index 0000000..a1ffd27 --- /dev/null +++ b/rustfmt.toml @@ -0,0 +1 @@ +max_width = 79 diff --git a/src/ast.rs b/src/ast.rs new file mode 100644 index 0000000..8ae651a --- /dev/null +++ b/src/ast.rs @@ -0,0 +1,179 @@ +/* + * Copyright (c) Adrian Alic + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. + */ + +use std::ops::Range; + +pub const MAX_FN_ARGS: usize = 5; +pub const MAX_STMTS_PER_BLOCK: usize = 30; + +pub enum ItemKind { + Type, +} + +#[derive(Debug, Clone)] +pub struct Stmt { + pub kind: StmtKind, +} +#[derive(Debug, Clone)] +pub enum StmtKind { + /// An expression + semicolon, like `foo();`, `a + b;`, `{ let x = 5; };` + Expr(ExprRef), +} +// ln { 324 } +#[derive(Default, Debug, Clone)] +pub struct Expr<'a> { + pub kind: ExprKind<'a>, +} +#[derive(Default, Debug, Clone, PartialEq)] +pub enum ExprKind<'a> { + #[default] + Unit, + /// A number literal + Number(usize), + /// A binary operation (e.g. `+`, `-`) + Binary(BinOp, ExprRef, ExprRef), + /// An identifier (variable, type, function name) + Ident(&'a str), + /// `()` + /// Evaluation operator (e.g. `foo()`, `Bar(1, 2)`) + Eval(ExprRef, Arguments), + /// Block expression delimited by `{}` + Block(ExprRef, StmtSlice), +} + +pub struct Container(Vec); +impl Container { + pub fn len(&self) -> usize { + self.0.len() + } + pub fn get>(&self, value: R) -> &T { + &self.0[value.index()] + } + pub fn get_slice>(&self, value: R) -> &[T] { + &self.0[value.range()] + } + pub fn push(&mut self, value: T) { + self.0.push(value) + } + pub fn pop(&mut self) -> Option { + self.0.pop() + } + pub fn last(&self) -> Option<&T> { + self.0.last() + } + pub fn extend_from_slice(&mut self, slice: &[T]) { + self.0.extend_from_slice(slice) + } +} +impl IntoIterator for Container { + type Item = T; + type IntoIter = std::vec::IntoIter; + fn into_iter(self) -> Self::IntoIter { + self.0.into_iter() + } +} +impl Default for Container { + fn default() -> Self { + Container(Vec::new()) + } +} +/// Structs implementing this for T can be used as references into Container. +pub trait ContainerIndex { + fn index(&self) -> usize; +} +/// Structs implementing this for T can be used as slices of Container elems. +pub trait ContainerRange { + fn range(&self) -> Range; +} + +#[derive(Default, Debug, Clone, Copy, PartialEq)] +pub struct ExprRef(u32); +impl ExprRef { + pub const MAX: usize = (1 << 22); + pub fn new(value: usize) -> Self { + assert!(value < Self::MAX, "expression limit hit"); + Self(value as u32) + } +} +impl<'a> ContainerIndex> for ExprRef { + fn index(&self) -> usize { + self.0 as usize + } +} + +/// Arguments is a fat pointer into [`Container`] +#[derive(Default, Debug, Clone, Copy, PartialEq)] +pub struct Arguments(u32); +impl Arguments { + pub fn new(index: usize, count: usize) -> Self { + assert!((index + count) < ExprRef::MAX); + let upper = (index as u32) << 8; + let lower = (count as u32) & 0xff; + Self(upper | lower) + } + pub fn count(&self) -> usize { + (self.0 & 0xff) as usize + } +} +impl<'a> ContainerRange> for Arguments { + fn range(&self) -> Range { + let lower = (self.0) & 0xff; + let upper = (self.0) >> 8; + (upper as usize)..(upper + lower) as usize + } +} + +/// StmtSlice is a fat pointer into [`Container`] +#[derive(Debug, Clone, Copy, PartialEq)] +pub struct StmtSlice(u32); +impl ContainerRange for StmtSlice { + fn range(&self) -> Range { + let index = (self.0 >> 8) as usize; + let count = (self.0 & 0xff) as usize; + index..(index + count) + } +} + +impl StmtSlice { + pub fn new(index: usize, statement_count: usize) -> Self { + assert!(index < 1 << 24); + assert!(statement_count < 1 << 8); + Self(((index << 8) + statement_count) as u32) + } +} + +#[derive(Debug)] +pub enum Operator { + Infix(BinOp), + /// Start of an evaluation via '(' + StartEval, + Statement, + Prefix, +} +#[derive(Debug)] +pub enum Bracket { + Parens, + Bracket, + Brace, +} +#[derive(Debug, Clone, PartialEq)] +pub enum BinOp { + Add, + Sub, + Mul, + Div, +} + +impl BinOp { + pub fn binding_power(&self) -> (u8, u8) { + match self { + BinOp::Add | BinOp::Sub => (1, 2), // left assoc + BinOp::Mul | BinOp::Div => (3, 4), // left assoc + } + } +} diff --git a/src/bin/main.rs b/src/bin/main.rs new file mode 100644 index 0000000..95deda6 --- /dev/null +++ b/src/bin/main.rs @@ -0,0 +1,24 @@ +/* + * Copyright (c) Adrian Alic + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. + */ + +use std::{hint::black_box, time::Instant}; + +const SOURCE: &str = include_str!("../example.ln"); + +fn main() { + let start = Instant::now(); + let mut lexer = lnpl::lexer::Lexer::new(SOURCE); + let mut token = lexer.next_token(); + while token.is_some() { + token = lexer.next_token(); + } + let end = start.elapsed(); + println!("Time elapsed: {:?}", end); + black_box(token); + black_box(lexer); +} diff --git a/src/bin/perfhash.rs b/src/bin/perfhash.rs new file mode 100644 index 0000000..872df8d --- /dev/null +++ b/src/bin/perfhash.rs @@ -0,0 +1,84 @@ +/* + * Copyright (c) Adrian Alic + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. + */ + +use std::collections::BTreeSet; + +fn main() { + println!("Collision-free hash function:\n"); + + let kw_raw = [ + "class", // + "for", // + "fn", // + "let", // + "match", // + "struct", // + "ln", // + "while", // + ]; + let keywords: Vec<[u8; 8]> = kw_raw + .iter() + .map(|kw| { + let mut res = [0u8; 8]; + for (idx, b) in kw.as_bytes().iter().enumerate() { + res[idx] = *b; + } + res + }) + .collect(); + + let mut map = BTreeSet::::new(); + for i in 1..1000 { + let mut indices = vec![]; + for b in keywords.iter() { + let mut hash = 0usize; + hash += b[0] as usize + i; + hash += (b[2] as usize) * i; + hash &= 0b1111; + indices.push(hash as u8); + } + // check collision free-ness + map.clear(); + let mut collision_free = true; + for idx in indices.iter() { + if !map.insert(*idx) { + collision_free = false; + break; + } + } + if collision_free { + println!("#[rustfmt::skip]\nconst KEYWORD_MAP: [[u8; 8]; 16] = ["); + let mut v: Vec<_> = + indices.iter().zip(kw_raw.into_iter()).collect(); + v.sort_unstable_by(|a, b| a.0.cmp(b.0)); + let mut k = 0; + (0..16).for_each(|i| { + if i == *v[k].0 { + println!(" conv(\"{}\"),", v[k].1); + k += 1; + } else { + // empty line + println!(" [0, 0, 0, 0, 0, 0, 0, 0],"); + } + }); + println!("];\nconst KW_MAGIC_NUMBER: usize = {};\n", i); + println!(" let keyword = match hash {{"); + v.into_iter().for_each(|(&idx, kw)| { + println!(" {} => Keyword::{},", idx, title_case(kw)) + }); + println!(" _ => return (hash, None),\n }};\n"); + break; + } + } +} + +fn title_case(s: &str) -> String { + let mut upper_case = String::from(s); + upper_case.get_mut(0..1).unwrap().make_ascii_uppercase(); + upper_case +} diff --git a/src/bin/stats.rs b/src/bin/stats.rs new file mode 100644 index 0000000..1cd3019 --- /dev/null +++ b/src/bin/stats.rs @@ -0,0 +1,82 @@ +use std::{ + collections::BTreeMap, + fs::{read_dir, DirEntry}, +}; + +use lnpl::lexer::common::TokenKind; + +const FILE_EXT: &str = ".ln"; + +fn main() { + let working_dir = std::env::current_dir().unwrap(); + let mut source_files = vec![]; + let mut dir_stack: Vec = read_dir(working_dir.as_path()) + .unwrap() + .map(Result::unwrap) + .filter(|d| d.metadata().unwrap().is_dir()) + .collect(); + + while let Some(d) = dir_stack.pop() { + for f in std::fs::read_dir(d.path()).unwrap().map(Result::unwrap) { + let metadata = f.metadata().unwrap(); + if metadata.is_dir() { + dir_stack.push(f); + } else if metadata.is_file() + && f.path().to_str().unwrap().ends_with(FILE_EXT) + { + source_files.push(f); + } + } + } + + eprintln!("{:?}", source_files); + let result = source_files + .iter() + .map(|s| (s.file_name(), get_histograms(s))); + + for (file_name, r) in result { + println!("[{}]", file_name.to_str().unwrap()); + for (k, v) in r { + let sum: usize = v.values.into_iter().sum(); + println!( + "\t{: <8?}: {:?}", + k, + v.values + .iter() + .map(|x| (*x as f32) / (sum as f32)) + .collect::>(), + ); + println!("\t{: <8?}: {:?}\n\tSum: {}", k, v.values, sum); + } + } +} + +#[derive(Default)] +struct Histogram { + values: [usize; 8], +} + +fn get_histograms(f: &DirEntry) -> BTreeMap { + let mut res = BTreeMap::::new(); + // Add token kinds + res.insert(TokenKind::Ident, Default::default()); + res.insert(TokenKind::Number, Default::default()); + res.insert(TokenKind::Whitespace, Default::default()); + + let buf = std::fs::read_to_string(f.path()).unwrap(); + let mut lexer = lnpl::lexer::Lexer::new(buf.as_str()); + while let Some(t) = lexer.next_token() { + use TokenKind::*; + match t.kind { + Class | For | Fn | Let | Match | Struct | Ln | While | Ident => { + res.get_mut(&Ident).unwrap().values[lexer.slice().len()] += 1; + } + t @ (Whitespace | Number) => { + res.get_mut(&t).unwrap().values[lexer.slice().len()] += 1; + } + _ => continue, + } + } + println!("buffer length: {}", buf.len()); + res +} diff --git a/src/example.ln b/src/example.ln new file mode 100644 index 0000000..09af248 --- /dev/null +++ b/src/example.ln @@ -0,0 +1,7927 @@ +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +}ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +}ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln foo fn() { 2 + 3 } +ln Data struct { } +class Hash {} +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; + if foo[11] { + + } + while foo[23] { + let x = 2 + 3; + for i in x.range() { + foo(); + } + } +} +ln doodle fn() { 2 + 3 } +ln Data struct { } +ln xyz(a: abc): u32 { + let x = match { + Abc => FYI, + Efg(XYZ) => (), + }; +} + diff --git a/src/experimental/mod.rs b/src/experimental/mod.rs new file mode 100644 index 0000000..aa571b1 --- /dev/null +++ b/src/experimental/mod.rs @@ -0,0 +1,98 @@ +use logos::Logos; + +use crate::lexer::common::TokenKind; + +#[derive(Logos, Debug, PartialEq)] +#[logos()] +pub enum Token { + #[token("class")] + Class, + #[token("for")] + For, + #[token("fn")] + Fn, + #[token("let")] + Let, + #[token("match")] + Match, + #[token("struct")] + Struct, + #[token("ln")] + Ln, + #[token("while")] + While, + #[regex("[A-Za-z]+[a-zA-Z0-9_]*")] + Ident, + #[regex("[0-9]+")] + Number, + #[regex(r"[ \t\n\f]+")] + Whitespace, + #[token("=")] + Eq, + #[token(">")] + Gt, + #[token("+")] + Plus, + #[token("-")] + Minus, + #[token("*")] + Star, + #[token(":")] + Colon, + #[token(",")] + Comma, + #[token(".")] + Dot, + #[token(";")] + Semicolon, + // () + #[token("(")] + ParensOpen, + #[token(")")] + ParensClose, + /// [ + #[token("[")] + BracketOpen, + /// ] + #[token("]")] + BracketClose, + /// { + #[token("{")] + BraceOpen, + /// } + #[token("}")] + BraceClose, +} + +impl From for Token { + fn from(value: TokenKind) -> Self { + match value { + TokenKind::Class => Token::Class, + TokenKind::For => Token::For, + TokenKind::Fn => Token::Fn, + TokenKind::Let => Token::Let, + TokenKind::Match => Token::Match, + TokenKind::Struct => Token::Struct, + TokenKind::Ln => Token::Ln, + TokenKind::While => Token::While, + TokenKind::Ident => Token::Ident, + TokenKind::Number => Token::Number, + TokenKind::Whitespace => Token::Whitespace, + TokenKind::Eq => Token::Eq, + TokenKind::Gt => Token::Gt, + TokenKind::Plus => Token::Plus, + TokenKind::Minus => Token::Minus, + TokenKind::Star => Token::Star, + TokenKind::Colon => Token::Colon, + TokenKind::Comma => Token::Comma, + TokenKind::Dot => Token::Dot, + TokenKind::Semicolon => Token::Semicolon, + TokenKind::ParensOpen => Token::ParensOpen, + TokenKind::ParensClose => Token::ParensClose, + TokenKind::BracketOpen => Token::BracketOpen, + TokenKind::BracketClose => Token::BracketClose, + TokenKind::BraceOpen => Token::BraceOpen, + TokenKind::BraceClose => Token::BraceClose, + } + } +} \ No newline at end of file diff --git a/src/lexer/aarch64.rs b/src/lexer/aarch64.rs new file mode 100644 index 0000000..4e2dfb2 --- /dev/null +++ b/src/lexer/aarch64.rs @@ -0,0 +1,227 @@ +/* + * Copyright (c) Adrian Alic + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. + */ + +//! This module contains the aarch64 implementation of the lexer. +use std::arch::aarch64::*; +use std::str::from_utf8; +use std::{iter::Peekable, str::Chars}; + +use super::common::{keyword_hash, Token, TokenKind, KEYWORD_MAP}; + +/* SIMD mapping for multi-sequence characters */ +const SIMD_MAP_ALPHABETIC: u8 = TokenKind::Ident as u8; +const SIMD_MAP_NUMBER: u8/*.*/= TokenKind::Number as u8; +const SIMD_MAP_WHITESPACE: u8 = TokenKind::Whitespace as u8; + +/// Size of the SIMD buffer in bytes. We process a large chunk of bytes of the +/// input string at a time, which is then read by the [next_token] function. +/// After reaching the end of such a chunk, we process the next chunk. +pub const SIMD_BUFFER_SIZE: u8 = 128; +#[repr(align(128))] +pub struct SimdBuffer([u8; SIMD_BUFFER_SIZE as usize]); + +/// Lexer implementation (aarch64). Optimized with NEON SIMD instructions. +pub struct Lexer<'a> { + pub chars: Peekable>, + text: &'a [u8], + pos: usize, + simd_idx: u8, + simd_buffer: SimdBuffer, + peeked: Option, + current: Option, + current_len: u32, +} + +impl<'a> Lexer<'a> { + pub fn new(s: &'a str) -> Self { + let mut lexer = Lexer { + chars: s.chars().peekable(), + text: s.as_bytes(), + pos: 0, + simd_idx: 0, + simd_buffer: SimdBuffer([0u8; SIMD_BUFFER_SIZE as usize]), + peeked: None, + current: None, + current_len: 0, + }; + if lexer.text.len() > SIMD_BUFFER_SIZE as usize { + unsafe { lexer.simd_fill() }; + } + lexer + } + #[inline] + pub fn peek_token(&mut self) -> Option<&Token> { + if self.peeked.is_some() { + return self.peeked.as_ref(); + } + self.peeked = self.next_token().clone(); + self.peeked.as_ref() + } + #[inline] + pub fn current_token(&mut self) -> Option { + self.current.clone() + } + /// Returns a byte slice of the token. + #[inline] + pub fn slice(&mut self) -> &'a [u8] { + let current_idx = + self.pos - SIMD_BUFFER_SIZE as usize + self.simd_idx as usize; + &self.text[(current_idx - self.current_len as usize)..current_idx] + } + + // Transposed lookup table for indexing 4 128-bit SIMD registers + const fn lookup_table_uint8x16x4(from: u8) -> [u8; 64] { + let register_count = 4; + let mut x = [0u8; 64]; + // transpose + let mut i = 0usize; + while i < 64 { + let offset = i / register_count; + let idx = (i % register_count) * 16 + offset; + x[i] = from + idx as u8; + i += 1; + } + // transform + let mut i = 0usize; + while i < 64 { + if x[i].is_ascii_alphabetic() { + x[i] = SIMD_MAP_ALPHABETIC; + } else if x[i].is_ascii_whitespace() { + x[i] = SIMD_MAP_WHITESPACE; + } else if x[i].is_ascii_digit() { + x[i] = SIMD_MAP_NUMBER; + } + + i += 1; + } + x + } + + const CONV_TABLE1: &[u8; 64] = &Self::lookup_table_uint8x16x4(0); + const CONV_TABLE2: &[u8; 64] = &Self::lookup_table_uint8x16x4(64); + + unsafe fn printb(t: T) { + let x: [u8; 16] = unsafe { *std::mem::transmute::<&T, &[u8; 16]>(&t) }; + for i in x.iter().rev() { + print!("{:0>8b} ", i); + } + println!(""); + } + + /// Fill SIMD buffer, starting from `Lexer::pos` until the `pos + B` where + /// `B` is the buffer size. + #[inline] + unsafe fn simd_fill(&mut self) { + // compile-time invariant + const _: () = { + assert!(SIMD_BUFFER_SIZE % 16 == 0, "should be multiple of 16"); + }; + + // We invalidate the entire SIMD buffer, so the index can be reset. + self.simd_idx = 0; + + let conv1: uint8x16x4_t = unsafe { vld4q_u8(&Self::CONV_TABLE1[0]) }; + let conv2: uint8x16x4_t = unsafe { vld4q_u8(&Self::CONV_TABLE2[0]) }; + + // constant vector registers + let v192 = vld1q_dup_u8(&0xc0); + + for i in 0..(SIMD_BUFFER_SIZE as usize / 16) { + let offset = 16 * i; + let vinput = vld1q_u8(&self.text[self.pos + offset]); + let v1_upper = vaddq_u8(vinput, v192); // v1[i] = v[i] - 64; + let index_1 = vqtbl4q_u8(conv1, vinput); + let index_2 = vqtbl4q_u8(conv2, v1_upper); + let masked = vorrq_u8(index_1, index_2); + vst1q_u8(self.simd_buffer.0.as_mut_ptr().add(offset), masked); + } + + self.pos += SIMD_BUFFER_SIZE as usize; + } + #[inline] + pub fn next_token(&mut self) -> Option { + // always check out-of-bounds + if self.pos + SIMD_BUFFER_SIZE as usize >= self.text.len() { + return None; + } + + // Read next token. This one is the actual enum value we will return + let ret = self.simd_buffer.0[self.simd_idx as usize]; + let start = + self.pos - SIMD_BUFFER_SIZE as usize + self.simd_idx as usize; + + self.incr_simd_idx(1)?; + + // This section is for skipping multi-character sequences. + // These include: identifiers, whitespace and digits. + self.current_len = 1; + + let mut next = self.simd_buffer.0[self.simd_idx as usize]; + // only skip for characters which have the MSB set. + if ret >= 0x80 { + // skip multi-character sequences + loop { + let skip_cond = ret == next + || (ret == SIMD_MAP_ALPHABETIC + && (next == 0x5f || next == SIMD_MAP_NUMBER)); + + if !skip_cond { + break; + } + self.current_len += 1; + self.incr_simd_idx(1)?; + next = self.simd_buffer.0[self.simd_idx as usize]; + } + // match identifiers + if ret == SIMD_MAP_ALPHABETIC && self.current_len < 8 { + // FIXME: This only works if `start + 8 < self.text.len()` + // Add dispatch code for this + if start + 8 >= self.text.len() { + panic!("nope!"); + } + unsafe { + let p = self.text.get_unchecked(start) as *const _ + as *const u64; + let candidate: u64 = p.read_unaligned(); + // apply mask based on identifier length + let mask = (1 << (self.current_len * 8)) - 1; + let candidate = candidate & mask; + + let candidate: [u8; 8] = std::mem::transmute(candidate); + + let (hash, keyword) = keyword_hash(&candidate); + if candidate == KEYWORD_MAP[hash] { + return Some(Token { + kind: keyword.unwrap(), + }); + } + } + } + } + + let result = Some(Token { + kind: unsafe { std::mem::transmute(ret) }, + }); + result + } + + /// Increment SIMD buffer index, and fill buffer on overflow. + /// Returns none if the simd_fill would spill over the input. + #[inline(always)] + #[must_use] + fn incr_simd_idx(&mut self, count: u8) -> Option<()> { + self.simd_idx = (self.simd_idx + count) & (SIMD_BUFFER_SIZE - 1); + if self.simd_idx == 0 { + if self.pos + SIMD_BUFFER_SIZE as usize >= self.text.len() { + return None; + } + unsafe { self.simd_fill() }; + } + Some(()) + } +} diff --git a/src/lexer/common.rs b/src/lexer/common.rs new file mode 100644 index 0000000..7f06dd3 --- /dev/null +++ b/src/lexer/common.rs @@ -0,0 +1,130 @@ +/* + * Copyright (c) Adrian Alic + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. + */ + +//! This module contains common lexer-related definitions. + +#[derive(Debug, Clone)] +pub struct Token { + pub kind: TokenKind, +} + +#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord)] +#[repr(u8)] +pub enum TokenKind { + // -- Keywords -- + Class, + For, + Fn, + Let, + Match, + Struct, + Ln, + While, + // -- Single Char -- + Eq = 61, + // > + Gt = 62, + Plus = 43, + Minus = 45, + Star = 42, + Colon = 58, + Comma = 44, + Dot = 46, + Semicolon = 59, + // () + ParensOpen = 40, + ParensClose = 41, + /// [ + BracketOpen = 91, + /// ] + BracketClose = 93, + /// { + BraceOpen = 123, + /// } + BraceClose = 125, + // ---------------- + Whitespace = 0b11000000, + Number = 0b10100000, + Ident = 0b10000000, +} + +impl TokenKind { + pub fn bp(&self) -> (u8, u8) { + match self { + TokenKind::Plus => (1, 2), + _ => panic!("this token is not an expression operator"), + } + } +} + +const fn conv(s: &'static str) -> [u8; 8] { + let mut res = [0; 8]; + let b = s.as_bytes(); + let mut i = 0; + while i < b.len() { + res[i] = b[i]; + i += 1; + } + res +} + +/// Maximum keyword length +pub const MAX_KW_LEN: usize = 8; + +/// A perfect hash table for keywords. Use [`keyword_hash`] to compute a hash +/// value from a given 8-byte slice. +#[rustfmt::skip] +pub const KEYWORD_MAP: [[u8; 8]; 16] = [ + [0, 0, 0, 0, 0, 0, 0, 0], + [0, 0, 0, 0, 0, 0, 0, 0], + conv("ln"), + conv("while"), + [0, 0, 0, 0, 0, 0, 0, 0], + conv("struct"), + [0, 0, 0, 0, 0, 0, 0, 0], + [0, 0, 0, 0, 0, 0, 0, 0], + conv("for"), + [0, 0, 0, 0, 0, 0, 0, 0], + conv("let"), + conv("match"), + conv("fn"), + [0, 0, 0, 0, 0, 0, 0, 0], + [0, 0, 0, 0, 0, 0, 0, 0], + conv("class"), +]; + +pub const KW_MAGIC_NUMBER: usize = 6; + +// TODO: Improve perfect hash function with something that doesn't multiple +// nested and dependent instructions +#[inline] +pub fn keyword_hash(b: &[u8; 8]) -> (usize, Option) { + let hash = + (b[0] as usize + KW_MAGIC_NUMBER + b[2] as usize * KW_MAGIC_NUMBER) + & 0b1111; + let keyword = match hash { + 2 => TokenKind::Ln, + 3 => TokenKind::While, + 5 => TokenKind::Struct, + 8 => TokenKind::For, + 10 => TokenKind::Let, + 11 => TokenKind::Match, + 12 => TokenKind::Fn, + 15 => TokenKind::Class, + _ => return (hash, None), + }; + (hash, Some(keyword)) +} + +#[derive(Debug, Clone, PartialEq, Eq)] +pub enum Base { + Decimal, + Binary, + Hex, +} + diff --git a/src/lexer/generic.rs b/src/lexer/generic.rs new file mode 100644 index 0000000..3cbb7af --- /dev/null +++ b/src/lexer/generic.rs @@ -0,0 +1,153 @@ +/* + * Copyright (c) Adrian Alic + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. + */ + +//! This module contains a generic lexer implementation for platforms without +//! special support. + +use std::{iter::Peekable, str::Chars}; + +use super::common::{keyword_hash, Token, TokenKind, KEYWORD_MAP, MAX_KW_LEN}; + +/// Generic lexer implementation. This is used as a fallback implementation +/// for platforms without a specialized SIMD implementation. +pub struct Lexer<'a> { + pub chars: Peekable>, + text: &'a [u8], + pos: usize, + peeked: Option, + current: Option, + current_len: u32, +} + +impl<'a> Lexer<'a> { + pub fn new(s: &str) -> Lexer<'_> { + Lexer { + chars: s.chars().peekable(), + text: s.as_bytes(), + pos: 0, + peeked: None, + current: None, + current_len: 0, + } + } + #[inline] + pub fn current_token(&mut self) -> Option { + self.current.clone() + } + #[inline] + pub fn slice(&mut self) -> &'a [u8] { + &self.text[(self.pos - self.current_len as usize)..(self.pos)] + } + #[inline] + pub fn next_token(&mut self) -> Option { + let old_pos = self.pos; + let kind = match self.advance()? { + c if is_ident_prefix(c) => self.read_name(c), + c if c.is_ascii_whitespace() => self.read_whitespace(), + '0'..='9' => self.read_numeral(), + ';' => TokenKind::Semicolon, + ',' => TokenKind::Comma, + '.' => TokenKind::Dot, + '(' => TokenKind::ParensOpen, + ')' => TokenKind::ParensClose, + '{' => TokenKind::BraceOpen, + '}' => TokenKind::BraceClose, + '[' => TokenKind::BracketOpen, + ']' => TokenKind::BracketClose, + '+' => TokenKind::Plus, + '-' => TokenKind::Minus, + '*' => TokenKind::Star, + '=' => TokenKind::Eq, + '>' => TokenKind::Gt, + ':' => TokenKind::Colon, + _ => TokenKind::Ident, + }; + self.current_len = self.pos as u32 - old_pos as u32; + self.current = Some(Token { kind }); + self.current.clone() + } + #[inline] + pub fn peek_token(&mut self) -> Option<&Token> { + if self.peeked.is_some() { + return self.peeked.as_ref(); + } + self.peeked = self.next_token().clone(); + self.peeked.as_ref() + } + // use advance() instead of self.text.next() + #[inline] + fn advance(&mut self) -> Option { + self.pos += 1; + self.chars.next() + } + #[inline] + fn peek(&mut self) -> Option<&char> { + self.chars.peek() + } + #[inline] + fn read_numeral(&mut self) -> TokenKind { + while let Some(c) = self.peek() { + if !c.is_ascii_digit() { + break; + } + self.advance(); + } + TokenKind::Number + } + /// Returns either Ident or Keyword + #[inline] + fn read_name(&mut self, first_char: char) -> TokenKind { + let mut cursor = 1; + let mut kw_buf = [0u8; MAX_KW_LEN]; + let mut keyword_candidate = true; + if first_char.is_ascii_lowercase() { + kw_buf[0] = first_char as u8; + } else { + keyword_candidate = false; + } + while let Some(c) = self.chars.peek() { + // requirement for keyword + if keyword_candidate + && cursor < MAX_KW_LEN + && c.is_ascii_lowercase() + { + kw_buf[cursor] = *c as u8; + cursor += 1; + } else if c.is_ascii_alphanumeric() { + keyword_candidate = false; + } else { + break; + } + self.advance(); + } + + if keyword_candidate { + let (hash, keyword) = keyword_hash(&kw_buf); + if kw_buf == KEYWORD_MAP[hash] { + return keyword.expect("hash fn and keyword map don't match"); + } + } + TokenKind::Ident + } + #[inline] + fn read_whitespace(&mut self) -> TokenKind { + while let Some(c) = self.chars.peek() { + if !c.is_ascii_whitespace() { + break; + } + self.advance(); + } + TokenKind::Whitespace + } +} + +// Returns true if the given character can be the start of an identifier. +#[inline] +pub fn is_ident_prefix(c: char) -> bool { + c.is_ascii_alphabetic() +} diff --git a/src/lexer/mod.rs b/src/lexer/mod.rs new file mode 100644 index 0000000..becea99 --- /dev/null +++ b/src/lexer/mod.rs @@ -0,0 +1,36 @@ +/* + * Copyright (c) Adrian Alic + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. + */ +mod aarch64; +pub mod generic; +pub mod common; + +#[cfg(not(target_arch = "aarch64"))] +pub use generic::Lexer; + +#[cfg(target_arch = "aarch64")] +pub use aarch64::Lexer; + +#[cfg(test)] +mod test { + use super::*; + use super::common::TokenKind; + + #[test] + pub fn peek() { + let mut t = Lexer::new("+ +"); + // peek, peek, next + assert_eq!(t.peek_token().unwrap().kind, TokenKind::Plus); + assert_eq!(t.peek_token().unwrap().kind, TokenKind::Plus); + assert_eq!(t.next_token().unwrap().kind, TokenKind::Plus); + + // peek, peek, next + assert_eq!(t.peek_token().unwrap().kind, TokenKind::Whitespace); + assert_eq!(t.peek_token().unwrap().kind, TokenKind::Whitespace); + assert_eq!(t.next_token().unwrap().kind, TokenKind::Whitespace); + } +} diff --git a/src/lib.rs b/src/lib.rs new file mode 100644 index 0000000..2284f46 --- /dev/null +++ b/src/lib.rs @@ -0,0 +1,451 @@ +/* + * Copyright (c) Adrian Alic + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. + */ +#![feature(core_intrinsics)] +#![feature(stdsimd)] + +pub mod ast; +pub mod lexer; +pub mod stackvec; +// For performance experiments and explorations of different implementations +pub mod experimental; + +use std::str::from_utf8; + +use ast::{ + Arguments, BinOp, Container, Expr, ExprKind, ExprRef, Operator, Stmt, + StmtKind, StmtSlice, MAX_FN_ARGS, MAX_STMTS_PER_BLOCK, +}; +use lexer::{ + common::{Base, Token, TokenKind}, + Lexer, +}; +use stackvec::StackVec; + +pub struct Parser<'a> { + lexer: Lexer<'a>, + exprs: Container>, + stmts: Container, +} + +impl<'a> Parser<'a> { + pub fn new(s: &'a str) -> Self { + let mut p = Self { + lexer: Lexer::new(s), + exprs: Default::default(), + stmts: Default::default(), + }; + p.lexer.next_token(); // lexer should point at first valid token + p + } + pub fn parse(&mut self) { + self.parse_expr(0); + } + /// Type declaration via expression. + fn parse_expr(&mut self, min_bp: u8) -> Option { + let first = self.lexer.current_token().expect("no tokens left"); + // ignore leading whitespace + let first = if first.kind == TokenKind::Whitespace { + self.next_non_whitespace().expect("no expression found") + } else { + first + }; + // Start of expression + let mut lhs_id = match &first.kind { + TokenKind::BraceOpen => self.parse_expr_block(), + TokenKind::ParensOpen => self.parse_expr_parens(), + TokenKind::Number => { + let number = parse_number(Base::Decimal, self.lexer.slice()) + .expect("parsing literal into number"); + self.push_expr(Expr { + kind: ExprKind::Number(number), + }) + } + TokenKind::Ident => { + let text = + from_utf8(self.lexer.slice()).expect("convert to utf-8"); + self.push_expr(Expr { + kind: ExprKind::Ident(text), + }) + } + t => panic!("expected expression, found `{t:?}`"), + }; + // Operator Position + // Pratt-Parsing loop. Peeks and consumes operators. + while let Some(op) = self.peek_operator() { + match op { + Operator::Infix(b) => { + let bp = b.binding_power(); + if bp.0 < min_bp { + // bind on a precedence cliff + break; + } + // this eats the operator we peeked + self.lexer.next_token(); + + self.next_non_whitespace() + .expect("operator can't terminate expression"); + let rhs_id = self.parse_expr(bp.1).unwrap(); + lhs_id = self.push_expr(Expr { + kind: ExprKind::Binary(b, lhs_id, rhs_id), + }); + } + Operator::StartEval => { + // eat the '(' + self.lexer.next_token(); + lhs_id = self.parse_eval(lhs_id).expect("parse eval"); + } + Operator::Statement => { + break; + } + other => panic!("expected operator, found `{other:?}`"), + }; + } + Some(lhs_id) + } + + /// Parse parenthesized expression. Examples: `(1)`, `(x + y)` + fn parse_expr_parens(&mut self) -> ExprRef { + let next = self.next_non_whitespace().expect("no close parens"); + // empty parentheses () + if next.kind == TokenKind::ParensClose { + return self.push_expr(Expr { + kind: ExprKind::Unit, + }); + } + let ret = self.parse_expr(0).expect("no close parens"); + let next = self + .lexer + .next_token() + .expect("matching closing parenthesis"); + match next.kind { + TokenKind::ParensClose => (), + TokenKind::Semicolon => { + panic!("parenthesized expressions cannot contain statements") + } + _ => panic!("expected closing parenthesis ')'"), + }; + ret + } + /// Parse block expression. A block expression is a '{}'-delimited block, + /// which contains one or more statements, and ends with an expression. + /// + /// Examples of block expressions: + /// + /// ``` + /// { min(x, y) + 2 } + /// + /// { + /// let x = 1; // <-- statement + /// let y = 2; // <-- statement + /// (x + y) // <-- expression + /// } + /// ``` + fn parse_expr_block(&mut self) -> ExprRef { + if self.lexer.current_token().expect("wrong input").kind + != TokenKind::BraceOpen + { + panic!("expected '{{' to start block expression"); + } + + let mut next = self.next_non_whitespace().expect("missing '}'"); + let mut block_members = 0; + let mut stmts: StackVec = + Default::default(); + + let mut expr = ExprRef::new(0); + // Iterates over statements and expressions inside the block expr. + // If we find a statement, we consume it, add it to the list of + // statements, and continue looping until we find an expression. + while next.kind != TokenKind::BraceClose { + block_members += 1; + expr = self.parse_expr(0).expect("missing '}'"); + next = self.next_non_whitespace().expect("missing '}'"); + + match next.kind { + TokenKind::Semicolon => (), + TokenKind::BraceClose => break, + _ => panic!("block expressions need to end with '}}'"), + } + // add statement to current expr block + stmts + .push(Stmt { + kind: StmtKind::Expr(expr), + }) + .unwrap(); + // eat the ';' + next = self.next_non_whitespace().expect("missing '}'"); + } + // special case: empty expression block + if block_members == 0 { + return self.push_expr(Expr { + kind: ExprKind::Unit, + }); + } + // block expr ends with statement + if stmts.len() == block_members { + expr = self.push_expr(Expr { + kind: ExprKind::Unit, + }); + } + let stmt_ref = match stmts.len() { + 0 => StmtSlice::new(0, 0), + _ => self.push_stmts(stmts.as_slice()), + }; + self.push_expr(Expr { + kind: ExprKind::Block(expr, stmt_ref), + }) + } + /// Parses the inside of an evaluation operation, starting from the first + /// token after the opening parenthesis. + /// ``` + /// foo(a, b, c) + /// ^ + /// start here + /// ``` + fn parse_eval(&mut self, caller: ExprRef) -> Option { + let cursor = self + .next_non_whitespace() + .expect("eval has closing parenthesis"); + // no arguments + if cursor.kind == TokenKind::ParensClose { + return Some(self.push_expr(Expr { + kind: ExprKind::Eval(caller, Default::default()), + })); + } + // parse arguments + let mut args: [Expr; MAX_FN_ARGS] = Default::default(); + let mut i = 0; + + loop { + // parse & pop argument, so they can be added later + self.parse_expr(0).expect("eval operator was not finished"); + // EX: we already asserted existence of at least 1 expression + args[i] = self.exprs.pop().unwrap(); + + if self + .lexer + .next_token() + .expect("matching closing parenthesis") + .kind + == TokenKind::Comma + { + // eat the ',' + self.lexer.next_token().unwrap(); + i += 1; + if i >= MAX_FN_ARGS { + panic!("too many fn arguments. Maximum: {MAX_FN_ARGS}"); + } + } else { + break; + } + } + + let args = self.push_expr_slice(&args[0..(i + 1)]); + + match &self.lexer.current_token().unwrap().kind { + TokenKind::ParensClose => Some(self.push_expr(Expr { + kind: ExprKind::Eval(caller, args), + })), + t => panic!("wrong eval expression termination token: {t:?}"), + } + } + /// Advances to the next non-whitespace token + fn next_non_whitespace(&mut self) -> Option { + while let Some(t) = self.lexer.next_token() { + match &t.kind { + TokenKind::Whitespace => continue, + _ => return Some(t), + }; + } + None + } + fn peek_operator(&mut self) -> Option { + while let Some(t) = self.lexer.peek_token() { + use TokenKind::*; + match t.kind { + Whitespace => { + self.lexer.next_token(); + continue; + } + Plus => return Some(Operator::Infix(BinOp::Add)), + Minus => return Some(Operator::Infix(BinOp::Sub)), + Star => return Some(Operator::Infix(BinOp::Mul)), + ParensOpen => return Some(Operator::StartEval), + Semicolon => return Some(Operator::Statement), + _ => return None, + }; + } + None + } + /// Pushes expression to the expr buffer and returns its id. + fn push_expr(&mut self, expr: Expr<'a>) -> ExprRef { + self.exprs.push(expr); + ExprRef::new(self.exprs.len() - 1) + } + /// Pushes argument to the args buffer and returns the argument id + fn push_expr_slice(&mut self, expr_ids: &[Expr<'a>]) -> Arguments { + let len = self.exprs.len(); + assert!((len + expr_ids.len()) <= ExprRef::MAX); + self.exprs.extend_from_slice(expr_ids); + Arguments::new(len, expr_ids.len()) + } + /// Pushes statements to the stmts buffer and returns the statement id + fn push_stmts(&mut self, stmts: &[Stmt]) -> StmtSlice { + let len = stmts.len(); + assert!(len > 0, "non-zero number of statements expected"); + self.stmts.extend_from_slice(stmts); + println!("making a slice: {} and {} ", (self.stmts.len() - len), len); + StmtSlice::new(self.stmts.len() - len, len) + } + /// Pretty-print the AST + pub fn pprint_ast(&mut self) { + let current = self.exprs.last().expect("AST is empty"); + let mut stack = vec![(current, 0, false)]; + while let Some((elem, depth, last_sub)) = stack.pop() { + let line_char = if last_sub { "└" } else { "├" }; + print!("{}{}─", "┆ ".repeat(depth / 3), line_char); + match elem.kind { + ExprKind::Number(n) => println!("({n})"), + ExprKind::Binary(ref op, l, r) => { + let op_str = match op { + BinOp::Add => " +", + BinOp::Sub => " -", + BinOp::Mul => " *", + BinOp::Div => " ÷", + }; + println!("{op_str}",); + stack.push((self.exprs.get(r), depth + 3, true)); + stack.push((self.exprs.get(l), depth + 3, false)); + } + ExprKind::Ident(ref n) => println!("({n})"), + ExprKind::Unit => println!("()"), + ExprKind::Eval(caller, args) => { + println!("(eval: {:?})", self.exprs.get(caller)); + self.exprs.get_slice(args).iter().rev().for_each(|expr| { + stack.push((expr, depth + 3, true)); + }); + } + ExprKind::Block(expr, stmt_ref) => { + println!("(blockexpr)"); + stack.push((self.exprs.get(expr), depth + 3, true)); + self.stmts.get_slice(stmt_ref).iter().rev().for_each( + |s| match s.kind { + StmtKind::Expr(expr_id) => stack.push(( + self.exprs.get(expr_id), + depth + 3, + false, + )), + _ => panic!(""), + }, + ); + } + }; + } + } +} + +fn parse_number(base: Base, s: &[u8]) -> Result { + let mut iter = s.iter().rev(); + let mut result = (iter.next().unwrap() - b'0') as usize; + let mut mult = 1; + for b in iter { + mult *= match base { + Base::Decimal => 10, + Base::Binary => 2, + Base::Hex => 16, + }; // base + result = result + .checked_add((*b - b'0') as usize * mult) + .ok_or("parsing literal overflowed")?; + } + Ok(result) +} + +#[cfg(test)] +mod test { + + use super::*; + macro_rules! extract_int { + ($t:ident) => { + match &$t.kind { + TokenKind::Literal(k) => match &k { + LiteralKind::Int { base } => base.clone(), + }, + _ => panic!(""), + } + }; + } + + #[test] + pub fn number_overflow() { + let mut lexer = Lexer::new("18073701615"); + let t = lexer.next_token().unwrap(); + // assert_eq!(Ok(18073701615), parse_number(extract_int!(t), t.text)); + + let mut lexer = Lexer::new("18446744073709551616"); + let t = lexer.next_token().unwrap(); + // assert!(parse_number(extract_int!(t), t.text).is_err()); + } + + #[test] + pub fn expr_numeric() { + let mut p = Parser::new("(1 + 2) * 3"); + p.parse(); + assert_eq!( + p.exprs.get(ExprRef::new(2)).kind, + ExprKind::Binary(BinOp::Add, ExprRef::new(0), ExprRef::new(1)) + ); + assert_eq!( + p.exprs.get(ExprRef::new(4)).kind, + ExprKind::Binary(BinOp::Mul, ExprRef::new(2), ExprRef::new(3)) + ); + } + + #[test] + pub fn expr_with_ident() { + let mut p = Parser::new("(((a)) + b)"); + p.parse(); + assert_eq!( + p.exprs.get(ExprRef::new(2)).kind, + ExprKind::Binary(BinOp::Add, ExprRef::new(0), ExprRef::new(1)) + ); + } + + #[test] + pub fn expr_fneval() { + let mut p = Parser::new("f(a, b, c, 4)"); + p.parse(); + match p.exprs.last().unwrap().kind { + ExprKind::Eval(_, args) => { + assert_eq!(args.count(), 4, "expected 4 arguments"); + } + _ => panic!("expected ExprKind::Eval"), + }; + } + + #[test] + pub fn expr_block() { + let mut p = Parser::new("{ 2 * 3 }"); + p.parse_expr_block(); + p.pprint_ast(); + assert_eq!( + p.exprs.get(ExprRef::new(2)).kind, + ExprKind::Binary(BinOp::Mul, ExprRef::new(0), ExprRef::new(1)) + ); + } + + #[test] + pub fn stmt_simple_expr() { + let mut p = Parser::new("2 + ( { f(2 + 1); 2; 2 + 3; } )"); + p.parse(); + assert_eq!( + p.exprs.get(ExprRef::new(11)).kind, + ExprKind::Block(ExprRef::new(10), StmtSlice::new(0, 3)) + ); + } +} diff --git a/src/stackvec.rs b/src/stackvec.rs new file mode 100644 index 0000000..a30b7f1 --- /dev/null +++ b/src/stackvec.rs @@ -0,0 +1,43 @@ +/* + * Copyright (c) Adrian Alic + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. + */ + +use std::mem::MaybeUninit; + +#[derive(Debug)] +pub enum Error { + CapacityReached, +} +pub struct StackVec { + data: [MaybeUninit; SIZE], + len: usize, +} + +impl StackVec { + pub fn push(&mut self, t: T) -> Result<(), Error> { + if self.len >= SIZE - 1 { + return Err(Error::CapacityReached); + } + self.data[self.len].write(t); + self.len += 1; + Ok(()) + } + pub fn len(&self) -> usize { + self.len + } + pub fn as_slice(&self) -> &[T] { + unsafe { core::mem::transmute(&self.data[0..self.len]) } + } +} +impl Default for StackVec { + fn default() -> Self { + Self { + data: unsafe { MaybeUninit::uninit().assume_init() }, + len: 0, + } + } +}