* Better compliance with XSD regexps (when transforming to Posix regexps)
* Added `\p{L}` and `\p{N}`
* Added escaping of `$`
* Added regexp [test/test_pattern.sh]
This commit is contained in:
parent
7e109d1d4b
commit
f7771d86c2
8 changed files with 724 additions and 32 deletions
|
|
@ -96,7 +96,7 @@ identifier [A-Za-z_][A-Za-z0-9_\-\.]*
|
|||
%s STRING
|
||||
%s STRINGDQ
|
||||
%s STRINGSQ
|
||||
%s ESCAPE
|
||||
%s DQESC
|
||||
%s COMMENT1
|
||||
%s COMMENT2
|
||||
%s UNKNOWN
|
||||
|
|
@ -228,7 +228,7 @@ identifier [A-Za-z_][A-Za-z0-9_\-\.]*
|
|||
<STRING>. { clixon_yang_parselval.string = strdup(yytext);
|
||||
return CHARS;}
|
||||
|
||||
<STRINGDQ>\\ { _YY->yy_lex_state = STRINGDQ; BEGIN(ESCAPE); }
|
||||
<STRINGDQ>\\ { _YY->yy_lex_state = STRINGDQ; BEGIN(DQESC); }
|
||||
<STRINGDQ>\" { BEGIN(_YY->yy_lex_string_state); return *yytext; }
|
||||
<STRINGDQ>\n { _YY->yy_linenum++;
|
||||
clixon_yang_parselval.string = strdup(yytext);
|
||||
|
|
@ -243,7 +243,7 @@ identifier [A-Za-z_][A-Za-z0-9_\-\.]*
|
|||
<STRINGSQ>[^'\n]+ { clixon_yang_parselval.string = strdup(yytext);
|
||||
return CHARS;}
|
||||
|
||||
<ESCAPE>. { BEGIN(_YY->yy_lex_state);
|
||||
<DQESC>[nt"\\] { BEGIN(_YY->yy_lex_state);
|
||||
clixon_yang_parselval.string = strdup(yytext);
|
||||
return CHARS; }
|
||||
<COMMENT1>[^*\n]* /* eat anything that's not a '*' */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue