Skip to content

Delphi string literals with '#' prefixed character parts - erroneous parsing #62

Description

@polyaklaci

For example the Delphi statement (which is valid in Delphi):

const
  SAMPLE = 'apple#20'#13#10;

generates the RHS expression in AST as:

<LITERAL type="string" value="apple#20#13#10"/>

which is 'losts' the original (intended) string value.
Original meaning: "apple#20" + Char(13) + Char(10) is parsed as "apple#20#13#10"

I saw a remark //TODO support ptAsciiChar in TPasSyntaxTreeBuilder.StringConstSimple, maybe it can be handled here...

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions