From 52d872b36d7fda733273d70100d21b16506f1647 Mon Sep 17 00:00:00 2001 From: John Hodge Date: Sun, 11 Jun 2017 11:34:16 +0800 Subject: Parse - Support chaining of spans (for macro expansions) --- src/macro_rules/parse.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/macro_rules/parse.cpp') 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) ); } -- cgit v1.2.3