Trans output/parse error

Monkey Forums/Monkey Bug Reports/Trans output/parse error

DruggedBunny(Posted 2013) [#1]
If you run this from Ted (don't think target matters, but I'm using C++), the expected popup error states:

Error : Syntax error - unexpected token '"Hello

Function Main ()
	Print "Hello
End Function

Function Nothing ()

End Function


However, the console output shows this:


Parsing...
C:/Documents and Settings/James/Desktop/test.monkey<3> : Error : Syntax error - unexpected token '"Hello
End Function

Function Nothing ()

End Function

'
Done.



It's showing the remainder of the source code. Note that the initial popup message includes the starting ' and the console output ends with ' so I'm guessing there's some sort of parsing error going on related to that.


Jesse(Posted 2013) [#2]
yes when the end quote is missing, it takes the file from the start of the quote to the end of the file as part of a single quote. I guess since it's missing the end quote it produces that error.
I have done that many times.


DruggedBunny(Posted 2013) [#3]
I think it's also related to the fact that Monkey allows multiple statements per line, like this:

Function Main () Print "Hello" End Function


... so it can't tell where the Hello line ends.

Gotta say, I think a statement separator ought to be required here! I find the above far too ambiguous and can't see why it's permitted.


ziggy(Posted 2013) [#4]
The statement separator is ; Trans should produce compilation errors in the line you're writing, but the compiler is just ignoring them.


DruggedBunny(Posted 2013) [#5]
Agreed!


DruggedBunny(Posted 2013) [#6]
Seen this one, Mark? Just checked with 67c and notice it's still there. Know you've been busy though!