summaryrefslogtreecommitdiffstats
path: root/vendor/pest_derive/examples
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-18 02:49:50 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-18 02:49:50 +0000
commit9835e2ae736235810b4ea1c162ca5e65c547e770 (patch)
tree3fcebf40ed70e581d776a8a4c65923e8ec20e026 /vendor/pest_derive/examples
parentReleasing progress-linux version 1.70.0+dfsg2-1~progress7.99u1. (diff)
downloadrustc-9835e2ae736235810b4ea1c162ca5e65c547e770.tar.xz
rustc-9835e2ae736235810b4ea1c162ca5e65c547e770.zip
Merging upstream version 1.71.1+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'vendor/pest_derive/examples')
-rw-r--r--vendor/pest_derive/examples/base.pest2
-rw-r--r--vendor/pest_derive/examples/calc.pest5
-rw-r--r--vendor/pest_derive/examples/calc.rs1
3 files changed, 4 insertions, 4 deletions
diff --git a/vendor/pest_derive/examples/base.pest b/vendor/pest_derive/examples/base.pest
new file mode 100644
index 000000000..c63d48af1
--- /dev/null
+++ b/vendor/pest_derive/examples/base.pest
@@ -0,0 +1,2 @@
+WHITESPACE = _{ " " | "\t" | NEWLINE }
+int = @{ (ASCII_NONZERO_DIGIT ~ ASCII_DIGIT+ | ASCII_DIGIT) } \ No newline at end of file
diff --git a/vendor/pest_derive/examples/calc.pest b/vendor/pest_derive/examples/calc.pest
index 9f2cc3b74..383497391 100644
--- a/vendor/pest_derive/examples/calc.pest
+++ b/vendor/pest_derive/examples/calc.pest
@@ -1,5 +1,3 @@
-WHITESPACE = _{ " " | "\t" | NEWLINE }
-
program = { SOI ~ expr ~ EOI }
expr = { prefix* ~ primary ~ postfix* ~ (infix ~ prefix* ~ primary ~ postfix* )* }
infix = _{ add | sub | mul | div | pow }
@@ -12,5 +10,4 @@ WHITESPACE = _{ " " | "\t" | NEWLINE }
neg = { "-" } // Negation
postfix = _{ fac }
fac = { "!" } // Factorial
- primary = _{ int | "(" ~ expr ~ ")" }
- int = @{ (ASCII_NONZERO_DIGIT ~ ASCII_DIGIT+ | ASCII_DIGIT) } \ No newline at end of file
+ primary = _{ int | "(" ~ expr ~ ")" } \ No newline at end of file
diff --git a/vendor/pest_derive/examples/calc.rs b/vendor/pest_derive/examples/calc.rs
index efc6b7b22..707162536 100644
--- a/vendor/pest_derive/examples/calc.rs
+++ b/vendor/pest_derive/examples/calc.rs
@@ -2,6 +2,7 @@ mod parser {
use pest_derive::Parser;
#[derive(Parser)]
+ #[grammar = "../examples/base.pest"]
#[grammar = "../examples/calc.pest"]
pub struct Parser;
}