Ignore:
Timestamp:
2021-04-06T15:58:57+02:00 (3 years ago)
Author:
Martin Sjölund <martin+github@…>
Branches:
maintenance/v1.17
Children:
4ee9f76, b36b0588, bcf875b0, dc4aaab
Parents:
2afcdfe1
git-author:
Martin Sjölund <martin@…> (03/16/21 08:57:25)
git-committer:
Martin Sjölund <martin+github@…> (04/06/21 15:58:57)
Message:

Handle UTF8 BOM in the diff API

File:
1 edited

Legend:

Unmodified
Added
Removed
  • OMCompiler/Compiler/Lexers/lexerModelicaDiff.l

    r2afcdfe1 rb8b118d3  
    340340        then (false,e::rest,tmp);
    341341      case (e as (_,TOKEN(id=TokenId.NEWLINE)))::rest then (true,rest,e::tmp);
    342       case (Diff.Add,TOKEN(id=TokenId.WHITESPACE))::(e as (Diff.Add,t))::rest guard lastIsNewline
     342      case (Diff.Add,TOKEN(id=TokenId.WHITESPACE))::(e as (Diff.Add,_))::rest guard lastIsNewline
    343343        then (false,rest,e::
    344344          (Diff.Add,TOKEN("WHITESPACE",TokenId.WHITESPACE,sum(" " for i in 1:depth),1,depth,0,0,0,0))
     
    487487protected
    488488  Integer i=0;
     489  String content;
    489490algorithm
    490491  for t in tokens loop
     
    493494      Error.addMessage(Error.SCANNER_ERROR_LIMIT, {});
    494495    end if;
    495     Error.addSourceMessage(Error.SCANNER_ERROR, {tokenContent(t)}, tokenSourceInfo(t));
     496    content := tokenContent(t);
     497    Error.addSourceMessage(Error.SCANNER_ERROR, {StringUtil.convertCharNonAsciiToHex(content)}, tokenSourceInfo(t));
    496498  end for;
    497499  if not listEmpty(tokens) then
Note: See TracChangeset for help on using the changeset viewer.