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

New multiline conditions and class/interfaces/enum declaration #11

Closed Peekmo closed 8 years ago

Peekmo commented 8 years ago

Major changes

Note before : I took decisions to write this code, you could like it, or not. If you don't, close it and that's all ^^

The "Conditions.rx" is the most complete example for all the changes added in this PR :

class self < String :: TestInterface

def self.main()
  def myvar : String = null
  def myarray = Array<String>.new()

  if myvar != null && myvar.charAt(10) == "p":
    for i in myarray.iterator():
      trace("Wouhou")
    end
  elsif myvar != null && myvar.charAt(20) == "c":
    trace("no")
  else
    trace("coco")
  end

  if myvar == null
     && myvar.charAt(0) == "x"
     && myvar.charAt(2) == "x":
    trace("ok")
  end
end

What's new ?

In the code :

Hope you'll like it.

deathbeam commented 8 years ago

Pushed my changes with semicolon insertion. If you will resolve conflicts, I will merge this :)

Peekmo commented 8 years ago

Done :)

deathbeam commented 8 years ago

Okay, merging :)