Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add a separate nonterminal for method definitions

  • Loading branch information...
commit 589b95ade5ebe999c04abef0fb8ed3103a9ca2be 1 parent 9dd8731
Tony Arcieri authored
Showing with 9 additions and 5 deletions.
  1. +9 −5 src/compiler/reia_parse.yrl
View
14 src/compiler/reia_parse.yrl
@@ -55,6 +55,7 @@ Nonterminals
module_decl
class_decl
methods
+ method
functions
function
body
@@ -352,14 +353,17 @@ class_decl -> class module_name '<' module_name methods 'end' :
exprs = begin validate_function_body('$5'), '$5' end
}.
-%% Functions
+%% Methods
methods -> eol : [].
-methods -> function : ['$1'].
-methods -> function eol : ['$1'].
+methods -> method : ['$1'].
+methods -> method eol : ['$1'].
methods -> eol methods : '$2'.
-methods -> function eol methods : ['$1'|'$3'].
+methods -> method eol methods : ['$1'|'$3'].
+
+%% Method declarations
+method -> function : '$1'.
-%% Valid method names
+%% Valid function names
function_name -> function_identifier : ?identifier_name('$1').
function_name -> '[' ']' : '[]'.
function_name -> '[' ']' '=' : '[]='.
Please sign in to comment.
Something went wrong with that request. Please try again.