mirror of
https://github.com/stedolan/jq.git
synced 2024-05-11 05:55:39 +00:00
Allow underscores in IDENT tokens. Fixes #3.
IDENT syntax now includes ASCII letters and underscores, so '.foo_bar' now works. Non-ASCII letters won't work in IDENT tokens (it's impossible to tell which non-ascii characters are "letters" without full unicode tables), so '.données' is still a syntax error (the workaround is '.["données"]', since you can put anything you like in a string).
This commit is contained in:
2
lexer.l
2
lexer.l
@@ -107,7 +107,7 @@
|
||||
}
|
||||
|
||||
|
||||
[[:alnum:]]+ { yylval->literal = jv_string(yytext); return IDENT;}
|
||||
[a-zA-Z_][a-zA-Z_0-9]* { yylval->literal = jv_string(yytext); return IDENT;}
|
||||
|
||||
[ \n\t]+ {}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user