about summary refs log tree commit diff
path: root/grammar.ebnf
diff options
context:
space:
mode:
authorBaitinq <[email protected]>2025-05-10 13:25:41 +0200
committerBaitinq <[email protected]>2025-05-10 13:25:50 +0200
commit36f0b2f486fbec48972a96581576b5008062be6f (patch)
treea3a74d72aea5df49059e7f14a63f17c62154ea42 /grammar.ebnf
parentMisc: Add gitattributes (diff)
downloadpry-lang-36f0b2f486fbec48972a96581576b5008062be6f.tar.gz
pry-lang-36f0b2f486fbec48972a96581576b5008062be6f.tar.bz2
pry-lang-36f0b2f486fbec48972a96581576b5008062be6f.zip
Feature: Add support for imports
Diffstat (limited to 'grammar.ebnf')
-rw-r--r--grammar.ebnf4
1 files changed, 3 insertions, 1 deletions
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