Skip to content

Issue with AutoIT Parser #1663

@trdean1

Description

@trdean1

I've noticed something the AutoIT parser gets wrong. The following line of AutoIT code

$foo = 'bar; baz'

will get tokenized as

[(Token.Name.Variable, '$foo'),
 (Token.Text, ' '),
 (Token.Operator, '='),
 (Token.Text, ' '),
 (Token.Text, "'"),
 (Token.Name, 'bar'),
 (Token.Comment.Single, "; baz'\n")]

The correct tokenization should be

[(Token.Name.Variable, '$foo'),
 (Token.Text, ' '),
 (Token.Operator, '='),
 (Token.Text, ' '),
 (Token.Literal.String, '"'),
 (Token.Literal.String, 'bar; baz'),
 (Token.Literal.String, '"'),
 (Token.Text, '\n')]

I noticed the tokenization is done correctly if the string is enclosed in double quotes rather than single quotes, but both should be valid autoit syntax

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-lexingarea: changes to individual lexersT-bugtype: a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions