DEV Community

Discussion on: How Lua Avoids Semicolons

Collapse
 
arj profile image
arj

There is also the solution of just adding an additional syntax to allow expressions as statments, a sort of a lexical cast.

You could just define your language as (concrete syntax):

<exp>  := <exp> + <exp> | - <exp> | ...
<stmt> := <id> := <exp> | $ <exp>

or something along these lines.

Collapse
 
17cupsofcoffee profile image
Joe Clay

Something along those lines is what I'm considering implementing in Ein, if the lack of expression statements causes issues :) Seems a lot nicer than having to create a temporary variable!