forked from NomicFoundation/slang
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
embed binding rules into the output crate (NomicFoundation#1010)
- Loading branch information
1 parent
21c0bcf
commit 3845dc7
Showing
57 changed files
with
178 additions
and
96 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
crates/codegen/language/tests/src/fail/definitions/duplicate_expression_name/test.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
error: An expression with the name 'Expression1' already exists. | ||
--> src/fail/definitions/duplicate_expression_name/test.rs:33:36 | ||
--> src/fail/definitions/duplicate_expression_name/test.rs:34:36 | ||
| | ||
33 | ... name = Expression1, | ||
34 | ... name = Expression1, | ||
| ^^^^^^^^^^^ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
crates/codegen/language/tests/src/fail/definitions/duplicate_item_name/test.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
error: An item with the name 'Bar1' already exists. | ||
--> src/fail/definitions/duplicate_item_name/test.rs:16:31 | ||
--> src/fail/definitions/duplicate_item_name/test.rs:17:31 | ||
| | ||
16 | Struct(name = Bar1, fields = (field = Required(Bar2))), | ||
17 | Struct(name = Bar1, fields = (field = Required(Bar2))), | ||
| ^^^^ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
crates/codegen/language/tests/src/fail/definitions/duplicate_variant_name/test.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
error: A variant referencing 'Baz1' already exists. | ||
--> src/fail/definitions/duplicate_variant_name/test.rs:20:49 | ||
--> src/fail/definitions/duplicate_variant_name/test.rs:21:49 | ||
| | ||
20 | EnumVariant(reference = Baz1) | ||
21 | EnumVariant(reference = Baz1) | ||
| ^^^^ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
crates/codegen/language/tests/src/fail/definitions/operator_mismatch/test.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
error: All operators under the same expression must have the same model and type. | ||
--> src/fail/definitions/operator_mismatch/test.rs:18:32 | ||
--> src/fail/definitions/operator_mismatch/test.rs:19:32 | ||
| | ||
18 | name = Foo, | ||
19 | name = Foo, | ||
| ^^^ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
crates/codegen/language/tests/src/fail/parsing/duplicate_map_key/test.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
error: Duplicate map key. | ||
--> src/fail/parsing/duplicate_map_key/test.rs:19:25 | ||
--> src/fail/parsing/duplicate_map_key/test.rs:20:25 | ||
| | ||
19 | field_1 = Required(Baz), | ||
20 | field_1 = Required(Baz), | ||
| ^^^^^^^ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 4 additions & 4 deletions
8
crates/codegen/language/tests/src/fail/parsing/duplicate_set_entry/test.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
error: Set entries must be unique. | ||
--> src/fail/parsing/duplicate_set_entry/test.rs:9:26 | ||
| | ||
9 | versions = ["1.0.0", "1.0.0", "3.0.0"], | ||
| ^^^^^^^ | ||
--> src/fail/parsing/duplicate_set_entry/test.rs:10:26 | ||
| | ||
10 | versions = ["1.0.0", "1.0.0", "3.0.0"], | ||
| ^^^^^^^ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
crates/codegen/language/tests/src/fail/parsing/empty_string/test.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
error: Expected a non-empty string. | ||
--> src/fail/parsing/empty_string/test.rs:16:63 | ||
--> src/fail/parsing/empty_string/test.rs:17:63 | ||
| | ||
16 | definitions = [TokenDefinition(scanner = Atom(""))] | ||
17 | definitions = [TokenDefinition(scanner = Atom(""))] | ||
| ^^ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
crates/codegen/language/tests/src/fail/parsing/missing_field/test.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
error: Expected field: 'title'. | ||
--> src/fail/parsing/missing_field/test.rs:12:9 | ||
--> src/fail/parsing/missing_field/test.rs:13:9 | ||
| | ||
12 | topics = [] | ||
13 | topics = [] | ||
| ^^^^^^ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
crates/codegen/language/tests/src/fail/parsing/unrecognized_field/test.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
error: unexpected token | ||
--> src/fail/parsing/unrecognized_field/test.rs:18:13 | ||
--> src/fail/parsing/unrecognized_field/test.rs:19:13 | ||
| | ||
18 | unrecognized_field = true | ||
19 | unrecognized_field = true | ||
| ^^^^^^^^^^^^^^^^^^ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
crates/codegen/language/tests/src/fail/parsing/unrecognized_variant/test.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
error: Expected a variant: 'Struct' or 'Enum' or 'Repeated' or 'Separated' or 'Precedence' or 'Trivia' or 'Keyword' or 'Token' or 'Fragment' | ||
--> src/fail/parsing/unrecognized_variant/test.rs:20:49 | ||
--> src/fail/parsing/unrecognized_variant/test.rs:21:49 | ||
| | ||
20 | Topic(title = "Topic Two", items = [Unrecognized(true)]) | ||
21 | Topic(title = "Topic Two", items = [Unrecognized(true)]) | ||
| ^^^^^^^^^^^^ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 4 additions & 4 deletions
8
crates/codegen/language/tests/src/fail/reachability/unreachable/test.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
error: Item 'Baz1' is not reachable from grammar root. | ||
--> src/fail/reachability/unreachable/test.rs:19:31 | ||
--> src/fail/reachability/unreachable/test.rs:20:31 | ||
| | ||
19 | Struct(name = Baz1, fields = (field = Required(Baz2))), | ||
20 | Struct(name = Baz1, fields = (field = Required(Baz2))), | ||
| ^^^^ | ||
|
||
error: Item 'Baz2' is not reachable from grammar root. | ||
--> src/fail/reachability/unreachable/test.rs:20:31 | ||
--> src/fail/reachability/unreachable/test.rs:21:31 | ||
| | ||
20 | Struct(name = Baz2, fields = (field = Required(Baz1))) | ||
21 | Struct(name = Baz2, fields = (field = Required(Baz1))) | ||
| ^^^^ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
crates/codegen/language/tests/src/fail/reachability/unused_version/test.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
error: Item 'Baz' is not used in versions: 1.0.0..2.0.0 | ||
--> src/fail/reachability/unused_version/test.rs:20:28 | ||
--> src/fail/reachability/unused_version/test.rs:21:28 | ||
| | ||
20 | name = Baz, | ||
21 | name = Baz, | ||
| ^^^ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
crates/codegen/language/tests/src/fail/references/disabled_too_late/test.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
error: Parent scope is only enabled in '2.0.0..3.0.0'. | ||
--> src/fail/references/disabled_too_late/test.rs:28:79 | ||
--> src/fail/references/disabled_too_late/test.rs:29:79 | ||
| | ||
28 | fields = (field_1 = Optional(reference = Three, enabled = Till("4.0.0"))) | ||
29 | fields = (field_1 = Optional(reference = Three, enabled = Till("4.0.0"))) | ||
| ^^^^ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
crates/codegen/language/tests/src/fail/references/enabled_too_early/test.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
error: Parent scope is only enabled in '2.0.0..3.0.0'. | ||
--> src/fail/references/enabled_too_early/test.rs:28:79 | ||
--> src/fail/references/enabled_too_early/test.rs:29:79 | ||
| | ||
28 | fields = (field_1 = Optional(reference = Three, enabled = From("1.0.0"))) | ||
29 | fields = (field_1 = Optional(reference = Three, enabled = From("1.0.0"))) | ||
| ^^^^ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
crates/codegen/language/tests/src/fail/references/invalid_filter/test.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
error: Reference 'Baz' of kind 'Fragment' is not valid. Expected: [Struct, Enum, Repeated, Separated, Precedence, Keyword, Token] | ||
--> src/fail/references/invalid_filter/test.rs:15:63 | ||
--> src/fail/references/invalid_filter/test.rs:16:63 | ||
| | ||
15 | Struct(name = Bar, fields = (field = Required(Baz))), | ||
16 | Struct(name = Bar, fields = (field = Required(Baz))), | ||
| ^^^ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 6 additions & 6 deletions
12
crates/codegen/language/tests/src/fail/references/invalid_version/test.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,17 @@ | ||
error: Reference 'Baz' is only defined in '2.0.0..3.0.0', but not in '3.0.0..MAX'. | ||
--> src/fail/references/invalid_version/test.rs:20:41 | ||
--> src/fail/references/invalid_version/test.rs:21:41 | ||
| | ||
20 | ... reference = Baz, | ||
21 | ... reference = Baz, | ||
| ^^^ | ||
|
||
error: Reference 'Baz' is only defined in '2.0.0..3.0.0', but not in '1.0.0..2.0.0'. | ||
--> src/fail/references/invalid_version/test.rs:25:41 | ||
--> src/fail/references/invalid_version/test.rs:26:41 | ||
| | ||
25 | ... reference = Baz, | ||
26 | ... reference = Baz, | ||
| ^^^ | ||
|
||
error: Reference 'Baz' is only defined in '2.0.0..3.0.0', but not in '1.0.0..2.0.0 | 3.0.0..MAX'. | ||
--> src/fail/references/invalid_version/test.rs:30:41 | ||
--> src/fail/references/invalid_version/test.rs:31:41 | ||
| | ||
30 | ... reference = Baz | ||
31 | ... reference = Baz | ||
| ^^^ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
crates/codegen/language/tests/src/fail/references/unknown_reference/test.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
error: Reference to unknown item 'Unknown'. | ||
--> src/fail/references/unknown_reference/test.rs:17:75 | ||
--> src/fail/references/unknown_reference/test.rs:18:75 | ||
| | ||
17 | fields = (field_1 = Required(Baz), field_2 = Required(Unknown)) | ||
18 | fields = (field_1 = Required(Baz), field_2 = Required(Unknown)) | ||
| ^^^^^^^ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
crates/codegen/language/tests/src/fail/references/unordered_version_pair/test.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
error: Version '3.0.0' must be less than corresponding version '2.0.0'. | ||
--> src/fail/references/unordered_version_pair/test.rs:20:52 | ||
--> src/fail/references/unordered_version_pair/test.rs:21:52 | ||
| | ||
20 | ... enabled = Range(from = "3.0.0", till = "2.0.0") | ||
21 | ... enabled = Range(from = "3.0.0", till = "2.0.0") | ||
| ^^^^^^^ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
crates/codegen/language/tests/src/fail/references/version_not_found/test.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
error: Version '3.0.0' does not exist in the language definition. | ||
--> src/fail/references/version_not_found/test.rs:18:76 | ||
--> src/fail/references/version_not_found/test.rs:19:76 | ||
| | ||
18 | field_1 = Optional(reference = Two, enabled = From("3.0.0")), | ||
19 | field_1 = Optional(reference = Two, enabled = From("3.0.0")), | ||
| ^^^^^^^ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
crates/codegen/runtime/cargo/src/runtime/bindings/binding_rules.rs.jinja2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#[allow(clippy::needless_raw_string_hashes)] | ||
#[allow(dead_code)] // TODO(#982): use to create the graph | ||
pub const BINDING_RULES_SOURCE: &str = r#####" | ||
{{ model.bindings.binding_rules_source }} | ||
"#####; |
7 changes: 7 additions & 0 deletions
7
crates/codegen/runtime/cargo/src/runtime/bindings/generated/binding_rules.rs
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.