Comments at the end of certain blocks (e.g. "try") break compilation
Submitted by Felix Wolfsteller
Link to original bug (#611085)
Description
Created attachment 154693 Example code to test compilation of try..except block with problematic comment
In Genie, for try .. except blocks, indented comments at the end of the try block break compilation with valac.
Although the given example is specific to try .. except I believe that I had the problem with other blocks, too and the problem might thus not be related to try .. except statements. I however failed to reproduce now.
try print "called" // this comment breaks compilation, remove this line to test except e: GLib.Error print "unreachable"
The (afaiu bogus) error messages are:
block_ends_with_comment.gs:19.10-19.10: error: syntax error, expected :' but got identifier with previous
except'
except e: GLib.Error
^
block_ends_with_comment.gs:22.1-22.4: error: syntax error, expected finally' but got
init' with previous `dedent'
init
^^^^
Somewhat bloated example code is attached.
Attachment 154693, "Example code to test compilation of try..except block with problematic comment":
block_ends_with_comment.gs
Version: 0.30.x