-
-
Notifications
You must be signed in to change notification settings - Fork 130
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
Incorrect SyntaxError report? #536
Comments
Its probably treating “triggered:” as an object since the rule is not case
sensitive. We only uppercase by convention.
…On Mon, Nov 20, 2023 at 18:09 Brad Buran ***@***.***> wrote:
The following code:
from enaml.widgets.api import Action, MainWindow, Menu, MenuBar
enamldef Main(MainWindow):
MenuBar:
Menu:
title = 'Demo'
Action:
text = 'Demo Action'
triggered:
try:
pass
except Exception as e:
pass
Gives the following:
File "...\Lib\site-packages\enaml\core\parser\base_python_parser.py", line 451, in raise_raw_syntax_error
raise self._build_syntax_error(message, start, end)
File "test.enaml", line 12
try:
^^^
SyntaxError: invalid syntax
I can't decide if this is correct or if it should point to line 11 (
triggered:) instead? I guess it depends on whether the parser is trying
to treat triggered as an object rather than an notification binding?
—
Reply to this email directly, view it on GitHub
<#536>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABBQSPK3Q2UNB2T63TLKCLYFPWNDAVCNFSM6AAAAAA7TWNV3GVHI2DSMVQWIX3LMV43ASLTON2WKOZSGAYDGMRSGMYTGNQ>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Python blocks inside operator are parsed as regular Python code and no special effort is made to link it back to enaml operators. It may be possible but it would require to deviate further from pegen version. |
Closing since it is likely not worth the effort. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The following code:
Gives the following:
I can't decide if this is correct or if it should point to line 11 (
triggered:
) instead? I guess it depends on whether the parser is trying to treattriggered
as an object rather than an notification binding?This is on 0.17.0.
The text was updated successfully, but these errors were encountered: