Modify

Opened 12 years ago

Closed 12 years ago

#2796 closed Bug (No Bug)

Syntax error not detected

Reported by: anonymous Owned by:
Milestone: Component: AutoIt
Version: 3.3.12.4 Severity: None
Keywords: syntax error Cc:

Description

Local $this = true, $should
($this ? $should : $not.be (valid autoit, see [(])) - no syntax error)

Discovered after examining these new tables.

(Please don't treat $tbl += $val and $tbl = $tbl + $val differently!)

Attachments (0)

Change History (6)

comment:1 by J-Paul Mesnage, 12 years ago

something not correct in the potes repro script.
Can you update it
Thanks

in reply to:  1 ; comment:2 by anonymous, 12 years ago

Replying to Jpm:

something not correct in the potes repro script.

(True ? 1 : unchecked context)

Au3Check.exe complains ("unbalanced paranthesis"), but AutoIt3.exe can execute it. Isn't that is the reference implementation?

Right now I'm asking myself how it is possible to write something that can ignore syntax errors. Does it simply skip tokens that don't modify the state of the interpreter, without parsing the whole expression?

comment:3 by Matt Diesel, 12 years ago

This is not a bug. The code that's executed will either be valid, or exit with a syntax error and the code that is not executed doesn't matter to the interpreter. Why do you think it should parse the non-executed code?

That's why we have tools like Au3Check.

This also opens up some exciting opportunities to do some clever stuff.

in reply to:  2 ; comment:4 by J-Paul Mesnage, 12 years ago

Replying to anonymous:

Replying to Jpm:

something not correct in the potes repro script.

(True ? 1 : unchecked context)

Au3Check.exe complains ("unbalanced paranthesis"), but AutoIt3.exe can execute it. Isn't that is the reference implementation?

Right now I'm asking myself how it is possible to write something that can ignore syntax errors. Does it simply skip tokens that don't modify the state of the interpreter, without parsing the whole expression?

I agree the unbalanced is too much but the other error messages are true at least that what Au3check wants to do. Slight difference with AutoIt as just an expression is wrong.
a statement must have an assignment. Only direct call to functions are allowed as func().

Au3Check as a lot of limitation due to a one pass design, but it try to match as much as possible AutoIt syntax the best he can.

in reply to:  4 comment:5 by anonymous, 12 years ago

Replying to Mat:

This also opens up some exciting opportunities to do some clever stuff.

Which opportunities do you mean?

Local $value = 1 ? 0 :-(
(False And :-)

The syntax check of the interpreter is inconsistent: a simple point is always an error, even if the interpreter never could reach the line containing the point.

comment:6 by jchd18, 12 years ago

Resolution: No Bug
Status: newclosed

You clearly don't understand how an interpretor works.

Modify Ticket

Action
as closed The ticket will remain with no owner.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.