Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with AutoIT Parser #1663

Closed
trdean1 opened this issue Jan 5, 2021 · 1 comment · Fixed by #1667
Closed

Issue with AutoIT Parser #1663

trdean1 opened this issue Jan 5, 2021 · 1 comment · Fixed by #1667
Labels
A-lexing area: changes to individual lexers T-bug type: a bug

Comments

@trdean1
Copy link
Contributor

trdean1 commented Jan 5, 2021

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

@trdean1
Copy link
Contributor Author

trdean1 commented Jan 7, 2021

Suggested fix for this issue in pull request #1667

@Anteru Anteru added T-bug type: a bug A-lexing area: changes to individual lexers labels Jan 14, 2021
@Anteru Anteru linked a pull request Feb 6, 2021 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-lexing area: changes to individual lexers T-bug type: a bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants