From 36f0b2f486fbec48972a96581576b5008062be6f Mon Sep 17 00:00:00 2001 From: Baitinq Date: Sat, 10 May 2025 13:25:41 +0200 Subject: Feature: Add support for imports --- grammar.ebnf | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'grammar.ebnf') diff --git a/grammar.ebnf b/grammar.ebnf index 18d71da..70a1bfd 100644 --- a/grammar.ebnf +++ b/grammar.ebnf @@ -1,9 +1,11 @@ Program ::= Statement+ -Statement ::= (AssignmentStatement | ExternDeclaration | FunctionCallStatement | IfStatement | WhileStatement | ReturnStatement) SEMICOLON +Statement ::= (AssignmentStatement | ImportDeclaration | ExternDeclaration | FunctionCallStatement | IfStatement | WhileStatement | ReturnStatement) SEMICOLON AssignmentStatement ::= ("let")? ("*")? Expression EQUALS Expression +ImportDeclaration ::= "import" STRING + ExternDeclaration ::= "extern" IDENTIFIER EQUALS Type FunctionCallStatement ::= (IDENTIFIER | FunctionDefinition) LPAREN FunctionArguments? RPAREN -- cgit 1.4.1