diff options
author | John Hodge <tpg@ucc.asn.au> | 2017-06-11 11:34:16 +0800 |
---|---|---|
committer | John Hodge <tpg@ucc.asn.au> | 2017-06-11 11:34:16 +0800 |
commit | 52d872b36d7fda733273d70100d21b16506f1647 (patch) | |
tree | 5f192e2650a0f15893546d484fcc6537786e6a46 /src/macro_rules/parse.cpp | |
parent | c211c01437ce248d654b0d6ba9b739d1633cce68 (diff) | |
download | mrust-52d872b36d7fda733273d70100d21b16506f1647.tar.gz |
Parse - Support chaining of spans (for macro expansions)
Diffstat (limited to 'src/macro_rules/parse.cpp')
-rw-r--r-- | src/macro_rules/parse.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/macro_rules/parse.cpp b/src/macro_rules/parse.cpp index 8264180f..1b7509fd 100644 --- a/src/macro_rules/parse.cpp +++ b/src/macro_rules/parse.cpp @@ -82,7 +82,7 @@ public: else if( type == "item" ) ret.push_back( MacroPatEnt(name, idx, MacroPatEnt::PAT_ITEM) ); else - ERROR(lex.getPosition(), E0000, "Unknown fragment type '" << type << "'"); + ERROR(lex.point_span(), E0000, "Unknown fragment type '" << type << "'"); break; } case TOK_PAREN_OPEN: { auto subpat = Parse_MacroRules_Pat(lex, TOK_PAREN_OPEN, TOK_PAREN_CLOSE, names); @@ -155,7 +155,7 @@ public: { DEBUG("depth--"); if(depth == 0) - ERROR(lex.getPosition(), E0000, "Unmatched " << Token(close) << " in macro content"); + ERROR(lex.point_span(), E0000, "Unmatched " << Token(close) << " in macro content"); depth --; } @@ -206,7 +206,7 @@ public: auto name = tok.type() == TOK_IDENT ? tok.str() : FMT(tok); unsigned int idx = ::std::find(var_names.begin(), var_names.end(), name) - var_names.begin(); if( idx == var_names.size() ) - ERROR(lex.getPosition(), E0000, "Macro variable $" << name << " not found"); + ERROR(lex.point_span(), E0000, "Macro variable $" << name << " not found"); if( var_set_ptr ) { var_set_ptr->insert( ::std::make_pair(idx,true) ); } |