alexschneider / teascript

5 stars 2 forks source link

Parser needs to handle errors in block ends better #80

Open rachelriv opened 9 years ago

rachelriv commented 9 years ago

@alexschneider

At the moment, we are assuming that if we are not at EOF, end, or else, then we have an invalid start for the following statement. That is not necessarily the case. For example, consider the following block of code.

f := () ->
  return 1+2

If someone forgets the end key word, it just assumes that start of the next statement is invalid (but there is no next statement!).

There is a comment about it in the parser. Since you implemented it and I'm not entirely sure what you were getting at, would you mind taking a look at it?