Changeset ed211ef2 in OpenModelica


Ignore:
Timestamp:
2021-03-09T23:56:21+01:00 (3 years ago)
Author:
Henning Kiel <hkiel@…>
Parents:
e3b7e2d
Message:

fix UTF-8 detection in parser

File:
1 edited

Legend:

Unmodified
Added
Removed
  • OMCompiler/Parser/BaseModelica_Lexer.g

    r37ce5aa4 red211ef2  
    394394    const char *str = chars;
    395395    int len = strlen((char*)$text->chars);
    396     if ((chars[0] & 0xE0) == 0xD0) {
     396    if (((chars[0] & 0xE0) == 0xC0) || ((chars[0] & 0xF0) == 0xE0) || ((chars[0] & 0xF8) == 0xF0) ) {
    397397      c_add_source_message(NULL,2, ErrorType_syntax, ErrorLevel_warning, "Lexer treating \\ as \\\\, since the next byte is the start of a UTF-8 character and thus not a valid Modelica escape sequence.",
    398398          &str, 0, $line, $pos+1, $line, $pos+len+1,
Note: See TracChangeset for help on using the changeset viewer.