deathbeam / spoon

:ramen: Spoon is a programming language that runs blazingly fast, compiles to native code and works everywhere.
https://spoonlang.org
MIT License
56 stars 11 forks source link

Semicolons #2

Closed deathbeam closed 8 years ago

deathbeam commented 8 years ago

What needs to be done:

And some more things. This is last thing missing to atleast go to pre-alpha of Raxe. Semicolons..

Peekmo commented 8 years ago

Multiline calls fails

self class

def self.main()
  def arr = Array<String>.new()
  arr
    .array()
    .join("/")
end

transpile into

package examples;using Lambda; class HelloWorld {

static public function main(){
  var arr =new  Array<String>();
  arr
    .array();
    .join("/");
};
}
deathbeam commented 8 years ago

This type of syntax will not be supported soon. There is no easy way to check if you are in multiline statement, if you start previous statement with a dot. But I plan to support this syntax

self class

def self.main()
  def arr = Array<String>.new()
  arr.
    array().
    join("/")
end

So character specifying that it is multiline statement is last token on previous line.

Peekmo commented 8 years ago

So, when using autocomplete, you can't play with multilines. A bit sad :(

deathbeam commented 8 years ago

Hmm now I get an idea. I can safely also get next token and check if it is "semicolon ignoring" one. So I can also support syntax like yours :D

Peekmo commented 8 years ago

Yep, it will fix also multiline arrays :+1:

deathbeam commented 8 years ago

It will not probably :D Anyway, added support for multiline expressions but with my style for now, yours (and most used one :/ ) is not working yet.

deathbeam commented 8 years ago

Added also support for yours syntax :D

deathbeam commented 8 years ago

I think I can close this now.

Peekmo commented 8 years ago

Wouhou ! I'll try later thank you :+1: