adapap / OWScript

Python-like scripting language which transpiles into Overwatch Workshop script rulesets.
MIT License
37 stars 2 forks source link

Comments in-between method headers and OWID calls eat up the indent #37

Closed netux closed 4 years ago

netux commented 4 years ago

This seems to have to do with indents and dedents, but I don't really have a clue what's causing it. I tested this inside rules, but it only happens on methods

Example after method header

%method_header()
    // comment with some indent behind it
    Big Message(Everyone, "Hello")

errors with

Error: Line 3
    Big Message(Everyone, "Hello")
    ^
Expected token of type INDENT, but received OWID

Example with dedent(?

%method_header()
    for i in range(1):
        Big Message(Everyone, "Goodbye")
    // comment
    Big Message(Everyone, "Hello")

errors with

Error: Line 5
    Big Message(Everyone, "Hello")
    ^
Expected token of type INDENT, but received OWID