Browse Source

- bugfix, order of linetype is important, now "include()" should be detected successfully

tags/v0.5.3
Andreas Romeyke 6 months ago
parent
commit
2d524a4ca6
2 changed files with 24 additions and 24 deletions
  1. +23
    -23
      src/parser/config_dsl.grammar.c
  2. +1
    -1
      src/parser/config_dsl.grammar.peg

+ 23
- 23
src/parser/config_dsl.grammar.c View File

@@ -305,8 +305,8 @@ YY_RULE(int) yy_LogicalOr(yycontext *yy); /* 14 */
YY_RULE(int) yy_Mode(yycontext *yy); /* 13 */
YY_RULE(int) yy_ClosingBracket(yycontext *yy); /* 12 */
YY_RULE(int) yy_OpenBracket(yycontext *yy); /* 11 */
YY_RULE(int) yy_IncludeLine(yycontext *yy); /* 10 */
YY_RULE(int) yy_SpaceLine(yycontext *yy); /* 9 */
YY_RULE(int) yy_SpaceLine(yycontext *yy); /* 10 */
YY_RULE(int) yy_IncludeLine(yycontext *yy); /* 9 */
YY_RULE(int) yy_CommentLine(yycontext *yy); /* 8 */
YY_RULE(int) yy_ModeLine(yycontext *yy); /* 7 */
YY_RULE(int) yy_TagLine(yycontext *yy); /* 6 */
@@ -1415,41 +1415,41 @@ YY_RULE(int) yy_OpenBracket(yycontext *yy)
yyprintf((stderr, " fail %s @ %s\n", "OpenBracket", yy->__buf+yy->__pos));
return 0;
}
YY_RULE(int) yy_SpaceLine(yycontext *yy)
{
yyprintf((stderr, "%s\n", "SpaceLine"));
l93:;
{ int yypos94= yy->__pos, yythunkpos94= yy->__thunkpos; if (!yy_Space(yy)) goto l94; goto l93;
l94:; yy->__pos= yypos94; yy->__thunkpos= yythunkpos94;
}
yyprintf((stderr, " ok %s @ %s\n", "SpaceLine", yy->__buf+yy->__pos));
return 1;
}
YY_RULE(int) yy_IncludeLine(yycontext *yy)
{ int yypos0= yy->__pos, yythunkpos0= yy->__thunkpos;
yyprintf((stderr, "%s\n", "IncludeLine")); if (!yymatchString(yy, "include")) goto l92; if (!yy_OpenBracket(yy)) goto l92; yyText(yy, yy->__begin, yy->__end); {
yyprintf((stderr, "%s\n", "IncludeLine")); if (!yymatchString(yy, "include")) goto l95; if (!yy_OpenBracket(yy)) goto l95; yyText(yy, yy->__begin, yy->__end); {
#define yytext yy->__text
#define yyleng yy->__textlen
if (!(YY_BEGIN)) goto l92;
if (!(YY_BEGIN)) goto l95;
#undef yytext
#undef yyleng
} if (!yymatchClass(yy, (unsigned char *)"\000\000\000\000\000\340\377\003\376\377\377\207\376\377\377\007\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000")) goto l92;
l93:;
{ int yypos94= yy->__pos, yythunkpos94= yy->__thunkpos; if (!yymatchClass(yy, (unsigned char *)"\000\000\000\000\000\340\377\003\376\377\377\207\376\377\377\007\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000")) goto l94; goto l93;
l94:; yy->__pos= yypos94; yy->__thunkpos= yythunkpos94;
} if (!yymatchClass(yy, (unsigned char *)"\000\000\000\000\000\340\377\003\376\377\377\207\376\377\377\007\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000")) goto l95;
l96:;
{ int yypos97= yy->__pos, yythunkpos97= yy->__thunkpos; if (!yymatchClass(yy, (unsigned char *)"\000\000\000\000\000\340\377\003\376\377\377\207\376\377\377\007\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000")) goto l97; goto l96;
l97:; yy->__pos= yypos97; yy->__thunkpos= yythunkpos97;
} yyText(yy, yy->__begin, yy->__end); {
#define yytext yy->__text
#define yyleng yy->__textlen
if (!(YY_END)) goto l92;
if (!(YY_END)) goto l95;
#undef yytext
#undef yyleng
} if (!yy_ClosingBracket(yy)) goto l92; yyDo(yy, yy_1_IncludeLine, yy->__begin, yy->__end);
} if (!yy_ClosingBracket(yy)) goto l95; yyDo(yy, yy_1_IncludeLine, yy->__begin, yy->__end);
yyprintf((stderr, " ok %s @ %s\n", "IncludeLine", yy->__buf+yy->__pos));
return 1;
l92:; yy->__pos= yypos0; yy->__thunkpos= yythunkpos0;
l95:; yy->__pos= yypos0; yy->__thunkpos= yythunkpos0;
yyprintf((stderr, " fail %s @ %s\n", "IncludeLine", yy->__buf+yy->__pos));
return 0;
}
YY_RULE(int) yy_SpaceLine(yycontext *yy)
{
yyprintf((stderr, "%s\n", "SpaceLine"));
l96:;
{ int yypos97= yy->__pos, yythunkpos97= yy->__thunkpos; if (!yy_Space(yy)) goto l97; goto l96;
l97:; yy->__pos= yypos97; yy->__thunkpos= yythunkpos97;
}
yyprintf((stderr, " ok %s @ %s\n", "SpaceLine", yy->__buf+yy->__pos));
return 1;
}
YY_RULE(int) yy_CommentLine(yycontext *yy)
{ int yypos0= yy->__pos, yythunkpos0= yy->__thunkpos;
yyprintf((stderr, "%s\n", "CommentLine")); if (!yymatchChar(yy, '#')) goto l98;
@@ -1515,8 +1515,8 @@ YY_RULE(int) yy_LineType(yycontext *yy)
{ int yypos108= yy->__pos, yythunkpos108= yy->__thunkpos; if (!yy_TagLine(yy)) goto l109; goto l108;
l109:; yy->__pos= yypos108; yy->__thunkpos= yythunkpos108; if (!yy_ModeLine(yy)) goto l110; goto l108;
l110:; yy->__pos= yypos108; yy->__thunkpos= yythunkpos108; if (!yy_CommentLine(yy)) goto l111; goto l108;
l111:; yy->__pos= yypos108; yy->__thunkpos= yythunkpos108; if (!yy_SpaceLine(yy)) goto l112; goto l108;
l112:; yy->__pos= yypos108; yy->__thunkpos= yythunkpos108; if (!yy_IncludeLine(yy)) goto l107;
l111:; yy->__pos= yypos108; yy->__thunkpos= yythunkpos108; if (!yy_IncludeLine(yy)) goto l112; goto l108;
l112:; yy->__pos= yypos108; yy->__thunkpos= yythunkpos108; if (!yy_SpaceLine(yy)) goto l107;
}
l108:;
yyprintf((stderr, " ok %s @ %s\n", "LineType", yy->__buf+yy->__pos));

+ 1
- 1
src/parser/config_dsl.grammar.peg View File

@@ -12,8 +12,8 @@ Line <- LineType EndOfLine
LineType <- TagLine
/ ModeLine
/ CommentLine
/ SpaceLine
/ IncludeLine
/ SpaceLine
CommentLine <- '#' ( !EndOfLine .)* { commentline(); }
IncludeLine <- 'include' OpenBracket < ( [A-Za-z0-9_./\-]+ ) > ClosingBracket { set_include ( yytext ); }
ModeLine <- 'mode' OpenBracket < Mode > ClosingBracket { int i = i_pop(); set_mode( i ); }

Loading…
Cancel
Save