Skip to content

Commit

Permalink
Add support for types on methods, change rule name w conflict
Browse files Browse the repository at this point in the history
Now, you can specify a return type on a method using syntax like Mirah's.

    def foo(): void { puts 1 }

This also changes the Token rule to AToken to get around a conflicting name from BaseParser that's currently causing compile errors.
  • Loading branch information
baroquebobcat committed Jan 19, 2016
1 parent 97e085f commit 9998737
Show file tree
Hide file tree
Showing 11 changed files with 308 additions and 282 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ this parser, or the first.
// this parser will turn into: `class Calculator < BaseParser; ...`
parser Calculator {
// defining a mirah method
def self.main(args:String) {
def self.main(args:String): void {
ast = Calculator.new.parse(args[0])
puts Interpreter.new.parse(ast)
}
Expand Down
Loading

0 comments on commit 9998737

Please sign in to comment.