aboutsummaryrefslogtreecommitdiff
path: root/syntax.md
diff options
context:
space:
mode:
authorMelody Horn <melody@boringcactus.com>2020-11-02 13:37:32 -0700
committerMelody Horn <melody@boringcactus.com>2020-11-02 13:37:32 -0700
commit8868b5fa2e8b9f40a31035c51519cce40e73f079 (patch)
tree4a91e7d5437f91a7f95358753097a99e2c84cf2e /syntax.md
parent83e23b6b449112f4a85d09c57e5601faa87856ca (diff)
downloadspec-8868b5fa2e8b9f40a31035c51519cce40e73f079.tar.gz
spec-8868b5fa2e8b9f40a31035c51519cce40e73f079.zip
define compile-time vs runtime behavior
Diffstat (limited to 'syntax.md')
-rw-r--r--syntax.md20
1 files changed, 2 insertions, 18 deletions
diff --git a/syntax.md b/syntax.md
index e6ec9f1..b8e4554 100644
--- a/syntax.md
+++ b/syntax.md
@@ -3,31 +3,15 @@
### Statements
```PEG
-Block ← '{' Statement* '}'
-
-Statement ← VariableDefinition /
- VariableDeclaration /
- IfStatement /
- SwitchStatement /
- WhileStatement /
- DoWhileStatement /
- ForStatement /
- FlowControlStatement /
- AssignmentStatement /
- ExpressionStatement
-
-VariableDefinition ← Type identifier '=' Expression ';'
-VariableDeclaration ← Type identifier ';'
-
IfStatement ← 'if' Expression Block 'else' Block /
'if' Expression Block
-
+
SwitchStatement ← 'switch' Expression '{' SwitchCase+ '}'
SwitchCase ← CaseSpecifier Block /
'default' Block
CaseSpecifier ← 'case' Expression ',' CaseSpecifier /
'case' Expression ','?
-
+
WhileStatement ← 'while' Expression Block
DoWhileStatement ← 'do' Block 'while' Expression ';'
ForStatement ← 'for' VariableDefinition? ';' Expression ';' AssignmentStatementBody? Block