Skip to content

Commit

Permalink
Merge pull request #627 from aiken-lang/rvcas/parser_refactor
Browse files Browse the repository at this point in the history
Parser Refactor
  • Loading branch information
KtorZ committed Jul 5, 2023
2 parents 699467a + e331b34 commit 82dc795
Show file tree
Hide file tree
Showing 103 changed files with 6,316 additions and 6,876 deletions.
54 changes: 54 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,12 @@ strip = true
[workspace.metadata.release]
shared-version = true
tag-name = "v{{version}}"

[workspace.dependencies]
insta = { version = "1.30.0", features = ["yaml"] }

[profile.dev.package.insta]
opt-level = 3

[profile.dev.package.similar]
opt-level = 3
12 changes: 8 additions & 4 deletions crates/aiken-lang/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ repository = "https://github.com/aiken-lang/aiken"
homepage = "https://github.com/aiken-lang/aiken"
license = "Apache-2.0"
authors = [
"Lucas Rosa <x@rvcas.dev>",
"Kasey White <kwhitemsg@gmail.com>",
"KtorZ <matthias.benkort@gmail.com>",
"Lucas Rosa <x@rvcas.dev>",
"Kasey White <kwhitemsg@gmail.com>",
"KtorZ <matthias.benkort@gmail.com>",
]
rust-version = "1.66.1"

Expand All @@ -30,8 +30,12 @@ num-bigint = "0.4.3"
[target.'cfg(not(target_family="wasm"))'.dependencies]
chumsky = "0.9.2"
[target.'cfg(target_family="wasm")'.dependencies]
chumsky = { version = "0.9.2", features = ["ahash", "std"], default-features = false }
chumsky = { version = "0.9.2", features = [
"ahash",
"std",
], default-features = false }

[dev-dependencies]
indoc = "2.0.1"
insta.workspace = true
pretty_assertions = "1.3.0"
6 changes: 6 additions & 0 deletions crates/aiken-lang/src/ast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1167,6 +1167,12 @@ impl Span {
Self::new((), 0..0)
}

pub fn create(i: usize, n: usize) -> Self {
use chumsky::Span;

Self::new((), i..i + n)
}

pub fn range(&self) -> Range<usize> {
use chumsky::Span;

Expand Down
Loading

0 comments on commit 82dc795

Please sign in to comment.