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

Wrongly formatted source code in error info #167

Open
wixette opened this issue Apr 10, 2022 · 0 comments
Open

Wrongly formatted source code in error info #167

wixette opened this issue Apr 10, 2022 · 0 comments
Assignees
Labels
bug Something isn't working prio:low Low priority

Comments

@wixette
Copy link
Contributor

wixette commented Apr 10, 2022

SeedLang.Shell 0.2.0-preview20220410023855
Copyright 2021-2022 The SeedV Lab.
>>> a = [1, 2, 3] 
>>> if len(a) > 1:
...   print(****)
...
---------- Source ----------
1     if len(a) > 1:
2       print(****)
---------- Run ----------
1     if len(a) > 1:
2       print(****)
20220410103942998 Fatal (SeedLang.X) <> [Ln 1, Col 0 - Ln 2, Col 9] 37: SyntaxErrorNoViableAlternative 'iflen(a)>1:\n  print(**'
1     if len(a) > 1:
20220410103942998 Fatal (SeedLang.X) <> [Ln 1, Col 13 - Ln 1, Col 13] 38: SyntaxErrorUnwantedToken ':' {';', NEWLINE}
2       print(****)
20220410103942998 Fatal (SeedLang.X) <> [Ln 2, Col 0 - Ln 2, Col 1] 35: SyntaxErrorInputMismatch '  ' <EOF>

Notice that in the first error info, the source code is formatted as 'iflen(a)>1:\n print(**'. There should be at least one space between if and len.

And, should we just show the original source code as it is in the error message, without removing any of its space characters?

@wixette wixette added bug Something isn't working prio:low Low priority labels Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working prio:low Low priority
Projects
None yet
Development

No branches or pull requests

2 participants