aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/parse/rust-parse.h
diff options
context:
space:
mode:
authorPhilip Herron <philip.herron@embecosm.com>2021-02-10 11:03:29 +0000
committerPhilip Herron <herron.philip@googlemail.com>2021-02-10 18:10:57 +0000
commita3a343c8853cb0967b21e8da23a829665208b25d (patch)
treef7b1c76a4f7c2fd230b731c7cef8ecffd18beb0f /gcc/rust/parse/rust-parse.h
parent1a2c0911f0e818328a8909b1f5ba0685b6eca351 (diff)
downloadgcc-a3a343c8853cb0967b21e8da23a829665208b25d.zip
gcc-a3a343c8853cb0967b21e8da23a829665208b25d.tar.gz
gcc-a3a343c8853cb0967b21e8da23a829665208b25d.tar.bz2
Give ParseRestriction option to allow for null parse_expr.
The null_denotion function expects to find the beginning of an expression but breaks can be empty and the parser will fail with unexpected ';'. Fixes #225
Diffstat (limited to 'gcc/rust/parse/rust-parse.h')
-rw-r--r--gcc/rust/parse/rust-parse.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/gcc/rust/parse/rust-parse.h b/gcc/rust/parse/rust-parse.h
index 873b55e9..e691c9e 100644
--- a/gcc/rust/parse/rust-parse.h
+++ b/gcc/rust/parse/rust-parse.h
@@ -82,6 +82,7 @@ struct ParseRestrictions
/* Whether the expression was entered from a unary expression - prevents stuff
* like struct exprs being parsed from a dereference. */
bool entered_from_unary = false;
+ bool expr_can_be_null = false;
};
// Parser implementation for gccrs.