Extend devblock mode to dev mode
This commit is contained in:
committed by
Xenxo Espasandín
parent
b3f47d640d
commit
7de550c18b
@ -59,7 +59,7 @@ RGX_DEFAULT (.|\n)
|
||||
<COMMENT_BLOCK_STATE>\n { loc.lines(yyleng); loc.step(); }
|
||||
<COMMENT_BLOCK_STATE>"*/" { BEGIN(INITIAL); }
|
||||
|
||||
"/#" { BEGIN(devblock_mode == xsk::gsc::dev_blocks::on ? DEVBLOCK_ON_STATE : DEVBLOCK_OFF_STATE); }
|
||||
"/#" { BEGIN(comp_mode == xsk::gsc::compilation_mode::dev ? DEVBLOCK_ON_STATE : DEVBLOCK_OFF_STATE); }
|
||||
/* ignore everything if we're in devblock-off state */
|
||||
<DEVBLOCK_OFF_STATE>.
|
||||
<DEVBLOCK_OFF_STATE>\n { loc.lines(yyleng); loc.step(); }
|
||||
|
@ -24,18 +24,18 @@
|
||||
|
||||
%lex-param { yyscan_t yyscanner }
|
||||
%lex-param { xsk::gsc::location& loc }
|
||||
%lex-param { xsk::gsc::dev_blocks devblock_mode }
|
||||
%lex-param { xsk::gsc::compilation_mode comp_mode }
|
||||
|
||||
%parse-param { yyscan_t yyscanner }
|
||||
%parse-param { xsk::gsc::location& loc }
|
||||
%parse-param { xsk::gsc::program_ptr& ast }
|
||||
%parse-param { xsk::gsc::dev_blocks devblock_mode }
|
||||
%parse-param { xsk::gsc::compilation_mode comp_mode }
|
||||
|
||||
%code requires
|
||||
{
|
||||
#include "iw5.hpp"
|
||||
typedef void *yyscan_t;
|
||||
#define YY_DECL xsk::gsc::iw5::parser::symbol_type IW5lex(yyscan_t yyscanner, xsk::gsc::location& loc, xsk::gsc::dev_blocks devblock_mode)
|
||||
#define YY_DECL xsk::gsc::iw5::parser::symbol_type IW5lex(yyscan_t yyscanner, xsk::gsc::location& loc, xsk::gsc::compilation_mode comp_mode)
|
||||
}
|
||||
|
||||
%code top
|
||||
@ -44,7 +44,7 @@ typedef void *yyscan_t;
|
||||
#include "parser.hpp"
|
||||
#include "lexer.hpp"
|
||||
using namespace xsk::gsc;
|
||||
xsk::gsc::iw5::parser::symbol_type IW5lex(yyscan_t yyscanner, xsk::gsc::location& loc, xsk::gsc::dev_blocks devblock_mode);
|
||||
xsk::gsc::iw5::parser::symbol_type IW5lex(yyscan_t yyscanner, xsk::gsc::location& loc, xsk::gsc::compilation_mode comp_mode);
|
||||
}
|
||||
|
||||
%token BREAKPOINT "breakpoint"
|
||||
|
Reference in New Issue
Block a user