mirror of
https://github.com/kemko/liquid.git
synced 2026-01-01 15:55:40 +03:00
fixed but with single char identifiers
This commit is contained in:
@@ -561,7 +561,7 @@ YY_RULE(int) yy_rangelet(yycontext *ctx)
|
||||
}
|
||||
YY_RULE(int) yy_identifier(yycontext *ctx)
|
||||
{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos;
|
||||
yyprintf((stderr, "%s\n", "identifier")); if (!yymatchClass(ctx, (unsigned char *)"\000\000\000\000\000\000\000\000\376\377\377\007\376\377\377\007\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000")) goto l15; if (!yymatchClass(ctx, (unsigned char *)"\000\000\000\000\000\040\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 l15;
|
||||
yyprintf((stderr, "%s\n", "identifier")); if (!yymatchClass(ctx, (unsigned char *)"\000\000\000\000\000\000\000\000\376\377\377\007\376\377\377\007\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000")) goto l15;
|
||||
l16:;
|
||||
{ int yypos17= ctx->pos, yythunkpos17= ctx->thunkpos; if (!yymatchClass(ctx, (unsigned char *)"\000\000\000\000\000\040\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 l17; goto l16;
|
||||
l17:; ctx->pos= yypos17; ctx->thunkpos= yythunkpos17;
|
||||
|
||||
@@ -78,7 +78,7 @@ const = "true" { $$ = Qtrue; }
|
||||
;
|
||||
|
||||
digit = [0-9];
|
||||
identifier = [a-zA-Z][a-zA-Z0-9_\-]+[?!]?;
|
||||
identifier = [a-zA-Z][a-zA-Z0-9_\-]*[?!]?;
|
||||
|
||||
%%
|
||||
|
||||
|
||||
@@ -42,6 +42,7 @@ class ParserTest < Test::Unit::TestCase
|
||||
def test_lookups
|
||||
assert_equal [[:id, "variable"], [:lookup, nil]], Parser.parse('variable')
|
||||
assert_equal [[:id, "underscored_variable"], [:lookup, nil]], Parser.parse('underscored_variable')
|
||||
assert_equal [[:id, "c"], [:lookup, nil]], Parser.parse('c')
|
||||
end
|
||||
|
||||
def test_global_hash
|
||||
|
||||
Reference in New Issue
Block a user