diff options
author | Sergey Bugaev <bugaevc@gmail.com> | 2023-04-03 18:51:58 +0300 |
---|---|---|
committer | Arthur Cohen <arthur.cohen@embecosm.com> | 2024-01-16 18:34:09 +0100 |
commit | 5138ddc3d652b66d3292c1543c34752e9ed78fc6 (patch) | |
tree | cba3255bbefc097c787a09cc2abf7bb57cb164fa | |
parent | b503080cd219b8f05184f6322d943d1c03f56b08 (diff) | |
download | gcc-5138ddc3d652b66d3292c1543c34752e9ed78fc6.zip gcc-5138ddc3d652b66d3292c1543c34752e9ed78fc6.tar.gz gcc-5138ddc3d652b66d3292c1543c34752e9ed78fc6.tar.bz2 |
gccrs: resolve: Add ResolveExpr::funny_error
...and thread it through the constructors and the ResolveExpr::go ()
method.
This will be used for implementing the "break rust" Easter egg.
gcc/rust/ChangeLog:
* resolve/rust-ast-resolve-expr.h,
resolve/rust-ast-resolve-expr.cc: Add ResolveExpr::funny_error
Signed-off-by: Sergey Bugaev <bugaevc@gmail.com>
-rw-r--r-- | gcc/rust/resolve/rust-ast-resolve-expr.cc | 10 | ||||
-rw-r--r-- | gcc/rust/resolve/rust-ast-resolve-expr.h | 6 |
2 files changed, 10 insertions, 6 deletions
diff --git a/gcc/rust/resolve/rust-ast-resolve-expr.cc b/gcc/rust/resolve/rust-ast-resolve-expr.cc index 41ce9c9..e5ee976 100644 --- a/gcc/rust/resolve/rust-ast-resolve-expr.cc +++ b/gcc/rust/resolve/rust-ast-resolve-expr.cc @@ -29,9 +29,9 @@ namespace Resolver { void ResolveExpr::go (AST::Expr *expr, const CanonicalPath &prefix, - const CanonicalPath &canonical_prefix) + const CanonicalPath &canonical_prefix, bool funny_error) { - ResolveExpr resolver (prefix, canonical_prefix); + ResolveExpr resolver (prefix, canonical_prefix, funny_error); expr->accept_vis (resolver); } @@ -674,8 +674,10 @@ ResolveExpr::resolve_closure_param (AST::ClosureParam ¶m, } ResolveExpr::ResolveExpr (const CanonicalPath &prefix, - const CanonicalPath &canonical_prefix) - : ResolverBase (), prefix (prefix), canonical_prefix (canonical_prefix) + const CanonicalPath &canonical_prefix, + bool funny_error) + : ResolverBase (), prefix (prefix), canonical_prefix (canonical_prefix), + funny_error (funny_error) {} } // namespace Resolver diff --git a/gcc/rust/resolve/rust-ast-resolve-expr.h b/gcc/rust/resolve/rust-ast-resolve-expr.h index 896617cc..86ae70f 100644 --- a/gcc/rust/resolve/rust-ast-resolve-expr.h +++ b/gcc/rust/resolve/rust-ast-resolve-expr.h @@ -31,7 +31,8 @@ class ResolveExpr : public ResolverBase public: static void go (AST::Expr *expr, const CanonicalPath &prefix, - const CanonicalPath &canonical_prefix); + const CanonicalPath &canonical_prefix, + bool funny_error = false); void visit (AST::TupleIndexExpr &expr) override; void visit (AST::TupleExpr &expr) override; @@ -84,10 +85,11 @@ protected: private: ResolveExpr (const CanonicalPath &prefix, - const CanonicalPath &canonical_prefix); + const CanonicalPath &canonical_prefix, bool funny_error); const CanonicalPath &prefix; const CanonicalPath &canonical_prefix; + bool funny_error; }; } // namespace Resolver |