- added ruby-esque object literals
- added
def foo
for methods inside object literal
- added
def foo.bar
for methods outside object literal
- added
def foo >>> bar
methods for attaching prototype
object myWidget
key, "value"
def sayHi(name)
puts puts "Hello #{name}"
end,
def getKey
return @key
end
end
# define method outside of object literal
def myWidget.sayBye
puts "goodbye!"
end
# attaches baz to String's prototype
def String >>> baz(x)
# do stuff
end
- added anonymous function blocks. These currently still need parens preceding the block (ex below).
- dropping support for coffeescript style arrow functions in favor of block like syntax.
myBtn.on('click', do |x|
e.preventDefault()
@slideToggle "slow"
end)
- added bracketless if/else if/else statements.
- found bug were some keywords in string are getting transformed, working on a fix for this.
- added string interpolation. You can add anything inside of #{....} except for curly brackets.... that won't compile.
- Added
func
keyword. This now defines a function using a variable name.
func foo var foo = function() {
puts "hello world" console.log("hello world");
end }
func bar(p1, p2) var bar = function(p1, p2) {
puts p1 + p2 console.log(p1 + p2);
end }
- Added Ruby/CoffeeScript style case/switch statement. Switch is kept the same, as using Ruby's case would be confusing/awkward to most JS devs. A few caveats, currently you still must use break to prevent falling through, unless it's a one liner while/then. In that case the break gets appended automatically. Also the default keyword is still default. I can't use else without lexing the case statement first... perhaps this will change to else in the future. Vanilla Switch/Case still works as normal
- Added arrow functions. These work like CoffeeScript with one caveat. They need to be closed with a
}
or end. This means using them as a callback will require });
or end);
for the time being.
- Added error message when no files are passed into compiler
- Added alias for printf (node only, aliases
#process.stdout.write
)
- Added aliases
do
and end
, works with properly formatted do while loops
- Added alias
puts
(aliased to console.log)
- Fixed commenting out string interpolation " #{foo} "
- Fixed issue with @ not working in 0.0.3,
@
now aliases this
properly
- Tests made for cmdLine.js and compile.js
- File watch now works with individual files (dir watch coming soon)
- Single line hash comments working
- @ alias partially working, a floating @ for a context param will compile to @.
- Setup app structure and basic file IO