-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Improve diagnostics handling * Refactor test harness to support test pragmas * Friendly ambiguous pattern match diagnostic * Friendly ambiguous path resolution error * Adjust error message
- Loading branch information
Showing
42 changed files
with
1,137 additions
and
427 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,10 @@ | ||
fn iai_bench_parse() { | ||
static SOURCE: &str = include_str!("../../examples/c/Werkfile"); | ||
iai::black_box(werk_parser::parse_werk(SOURCE)).unwrap(); | ||
iai::black_box(werk_parser::parse_werk( | ||
std::path::Path::new("../../examples/c/Werkfile"), | ||
SOURCE, | ||
)) | ||
.unwrap(); | ||
} | ||
|
||
iai::main!(iai_bench_parse); |
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,11 @@ | ||
error[R0011]: ambiguous pattern match: /foofoo | ||
--> INPUT:3:7 | ||
| | ||
3 | build "%foo" { | ||
| ------ note: first pattern here | ||
| | ||
::: INPUT:7:7 | ||
| | ||
7 | build "foo%" { | ||
| ------ note: second pattern here | ||
| |
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,9 @@ | ||
config default = "foofoo" | ||
|
||
build "%foo" { | ||
info "<out>" | ||
} | ||
|
||
build "foo%" { | ||
info "<out>" | ||
} |
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,12 @@ | ||
error[E0032]: ambiguous path resolution: /bar exists in the workspace, but also matches a build recipe | ||
--> INPUT:6:10 | ||
| | ||
6 | info "<out>" | ||
| ^^^^^^^ ambiguous path resolution: /bar exists in the workspace, but also matches a build recipe | ||
| | ||
::: INPUT:5:7 | ||
| | ||
5 | build "bar" { | ||
| ----- note: matched this build recipe | ||
| | ||
= help: use `<...:out-dir>` or `<...:workspace>` to disambiguate between paths in the workspace and the output directory |
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,16 @@ | ||
config default = "build" | ||
|
||
# Directories should not participate in the lookup that happens as part | ||
# of build recipe matching. | ||
build "bar" { | ||
info "<out>" | ||
} | ||
build "foo" { | ||
info "<out>" | ||
} | ||
|
||
task build { | ||
build ["foo", "bar"] | ||
} | ||
|
||
#!dir bar |
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,7 @@ | ||
error[E0009]: capture group with index 2 is out of bounds in the current scope | ||
--> INPUT:2:21 | ||
| | ||
2 | "(a|b)(c|d)" => "{2}" | ||
| ^^^^^ capture group with index 2 is out of bounds in the current scope | ||
| | ||
= help: pattern capture groups are zero-indexed, starting from 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
let a = "ac" | match { | ||
"(a|b)(c|d)" => "{2}" | ||
"%" => error "no match" | ||
} |
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.