diff options
author | Sergey Bugaev <bugaevc@gmail.com> | 2023-04-03 18:51:58 +0300 |
---|---|---|
committer | CohenArthur <arthur.cohen@embecosm.com> | 2023-04-17 08:46:19 +0000 |
commit | 3bd09533b321ec7f47c95356e146619e9d861836 (patch) | |
tree | e5ccaca3ca2c6ad8dd982d96bb8ac1f6b7e8b082 /gcc | |
parent | bfd8e24c2ad0034d2ad0ca59d680d0f9c1250691 (diff) | |
download | gcc-3bd09533b321ec7f47c95356e146619e9d861836.zip gcc-3bd09533b321ec7f47c95356e146619e9d861836.tar.gz gcc-3bd09533b321ec7f47c95356e146619e9d861836.tar.bz2 |
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>
Diffstat (limited to 'gcc')
-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 6486fde..82ec248 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 3c73a89..2011903 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 |