about summary refs log tree commit diff
path: root/grammar.ebnf
diff options
context:
space:
mode:
Diffstat (limited to 'grammar.ebnf')
-rw-r--r--grammar.ebnf12
1 files changed, 5 insertions, 7 deletions
diff --git a/grammar.ebnf b/grammar.ebnf
index 425c64a..d99f268 100644
--- a/grammar.ebnf
+++ b/grammar.ebnf
@@ -25,7 +25,7 @@ UnaryExpression = ( "-" | "!" ) UnaryExpression | UnitExpression ;
                 
 (* Unaffected Expressions *)
 
-UnitExpression = FLOAT | INT | STR | GroupExpression | BlockExpression | FnExpression | | TypeExpression | FormExpression | IfExpression;
+UnitExpression = FLOAT | INT | STR | GroupExpression | BlockExpression | FnExpression | TypeExpression | FormExpression | IfExpression;
 
 GroupExpression = "(" Expression ")";
 BlockExpression = Block;
@@ -37,16 +37,14 @@ IfExpression = "if" Expression Block { "elif" Expression Block } [ "else" Block
 
 (* Parts *)
 
-FnHeader = (FnSingleParameter | FnMultipleParameters) ["->" Type];
-FnSingleParameter = "self" | FnParameter;
-FnMultipleParameters = "(" FnSingleParameter { "," FnParameter} ")";
-FnParameter = IdentiferType;
+FnHeader = (FnParameters) ["->" Type];
+FnParameters = ("self" | FnParameter) { "," FnParameter};
 
 (* Utils *)
 
 Block = "{" { Statement } [Expression] "}";
-TypeBlock = "{" [ IdentiferType ] { "," IdentiferType } "}";
+TypeBlock = "{" [ TypedIdentifier ] { "," TypedIdentifier } "}";
 
-IdentiferType = IDENTIFIER ":" Type;
+TypedIdentifier = IDENTIFIER [":" Type];
 (* NOTE: Type doesn't include anything other than simple named types for now. *)
 Type = IDENTIFIER;