Skip to content

Commit 0d5fa04

Browse files
authored
[v2] add slang v2 lexer (#1462)
This final PR adds the actual lexer using the `logos` crate, and adds some unit tests for it. Note that (partial) integration with sourcify was added under `temp_sourcify.rs`, to be removed once the lexer is used (and tested) through the parser instead. There are some remaining work items to be done (grep for `TODO(v2)` comments), but it can follow in later PRs. > NOTE: this is a set of PRs to add the lexer v2, to make reviewing smaller chunks easier: > > 1. #1457 > 2. #1458 > 3. #1459 > 4. #1460 > 5. #1461 > 6. #1462
1 parent 4401976 commit 0d5fa04

File tree

29 files changed

+2279
-15
lines changed

29 files changed

+2279
-15
lines changed

Cargo.lock

Lines changed: 63 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ members = [
1313
"crates/codegen/spec",
1414
"crates/codegen/testing",
1515

16+
"crates/codegen-v2/parser",
17+
1618
"crates/infra/cli",
1719
"crates/infra/utils",
1820

@@ -47,6 +49,8 @@ members = [
4749
"crates/solidity/testing/utils",
4850

4951
"crates/solidity-v2/inputs/language",
52+
53+
"crates/solidity-v2/outputs/cargo/parser",
5054
]
5155

5256
[workspace.dependencies]
@@ -59,6 +63,8 @@ codegen_runner = { path = "crates/codegen/runner", version = "1.3.0" }
5963
codegen_spec = { path = "crates/codegen/spec", version = "1.3.0" }
6064
codegen_testing = { path = "crates/codegen/testing", version = "1.3.0" }
6165

66+
codegen_v2_parser = { path = "crates/codegen-v2/parser", version = "1.3.0" }
67+
6268
infra_cli = { path = "crates/infra/cli", version = "1.3.0" }
6369
infra_utils = { path = "crates/infra/utils", version = "1.3.0" }
6470

@@ -94,6 +100,8 @@ solidity_testing_utils = { path = "crates/solidity/testing/utils", version = "1.
94100

95101
solidity_v2_language = { path = "crates/solidity-v2/inputs/language", version = "1.3.0" }
96102

103+
slang_solidity_v2_parser = { path = "crates/solidity-v2/outputs/cargo/parser", version = "1.3.0" }
104+
97105
#
98106
# External
99107
#
@@ -125,6 +133,7 @@ Inflector = { version = "0.11.4" }
125133
itertools = { version = "0.13.0" }
126134
libc = { version = "0.2.0" }
127135
log = { version = "0.4.27" }
136+
logos = { version = "0.15.1" }
128137
lsp-positions = { version = "0.3.0" }
129138
markdown = { version = "0.3.0" }
130139
nom = { version = "7.1.3" }
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
[package]
2+
name = "codegen_v2_parser"
3+
description = "Utilities to generate a parser from a language definition."
4+
version.workspace = true
5+
rust-version.workspace = true
6+
edition.workspace = true
7+
publish = false
8+
9+
[dependencies]
10+
language_v2_definition = { workspace = true }
11+
serde = { workspace = true }
12+
13+
[lints]
14+
workspace = true

0 commit comments

Comments
 (0)