westes / flex

The Fast Lexical Analyzer - scanner generator for lexing in C and C++
Other
3.63k stars 536 forks source link

error #587

Open nIxedoahz opened 1 year ago

nIxedoahz commented 1 year ago

[\u4e00-\u9fa5]+ { yylval->sval = strdup(yytext); return string; }

error: warning that the character range [0-u] is ambiguous in a scanner where case is not required

Mightyjo commented 1 year ago

Flex regex doesn't support Unicode escape sequences. You can construct rules or patterns for code points a byte at a time using hex escape sequences.

The range character class constructor assumes the operands are bytes, so it's not going to work correctly with wide characters. That's what you're seeing.