Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Zirconium Parser v2.0 #17

Draft
wants to merge 45 commits into
base: master
Choose a base branch
from
Draft
Changes from 1 commit
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
b702bf4
Begin work on parser rewrite
Vorlias Jan 28, 2022
cbc6ce1
Working on the new improved parser
Vorlias Jan 28, 2022
47c8c19
Add function call
Vorlias Jan 28, 2022
1a98ca3
Add inline expression for simple calls, better handling
Vorlias Jan 28, 2022
d9d71fd
Object literals
Vorlias Jan 28, 2022
3706e72
ObjectLiteral -> ObjectLiteralExpression
Vorlias Jan 28, 2022
3c7cf24
bang! call + array index call support
Vorlias Jan 28, 2022
d73f634
Fixes + EBNF file
Vorlias Jan 28, 2022
9e96609
Update syntax.ebnf
Vorlias Jan 28, 2022
98941dd
Parser updates
Vorlias Feb 16, 2022
b9753a5
More refactoring
Vorlias Feb 16, 2022
115cc34
Bump to 2.0
Vorlias Feb 16, 2022
4cf5cba
Work
Vorlias Feb 16, 2022
1f4a905
Fixes to parser positionings
Vorlias Feb 16, 2022
78f01e2
Updated Identifier parsing, bang call endPos fixed
Vorlias Feb 16, 2022
b09f529
Huge changes
Vorlias Mar 18, 2022
5aaa2e8
Fix up element access expressions
Vorlias Mar 18, 2022
b60a1f1
Fix call expressions
Vorlias Mar 18, 2022
53db8b7
Fix inline call variables
Vorlias Mar 18, 2022
a7bf232
More fixes
Vorlias Mar 18, 2022
bbc57be
More changes
Vorlias Mar 18, 2022
d04a36a
Fixes + other changes
Vorlias Aug 14, 2022
b914508
More work
Vorlias Aug 14, 2022
2db4fb5
Bump to roblox-ts 2.0
Vorlias Oct 12, 2022
d4e4c02
Runtime changes
Vorlias Oct 12, 2022
07dfc52
More changes
Vorlias Oct 12, 2022
1c66bb1
Changes
Vorlias Jan 16, 2023
70a94e2
more language changes
Vorlias May 29, 2023
f7b52c3
Rename setting
Vorlias May 29, 2023
f2afcde
A few other adjustments
Vorlias May 29, 2023
ebd654a
parseAst changes
Vorlias May 29, 2023
cf38998
Correctly parse fn
Vorlias Jun 8, 2023
fdf7c0b
Fix bug with command calls
Vorlias Jun 8, 2023
7d5d6c2
Force consumption of ElementEnd token
Vorlias Jun 8, 2023
1b0aa8f
More lib changes
Vorlias Jun 10, 2023
0a769b7
Support function expression
Vorlias Jun 10, 2023
b7aa63d
Experimental arrow funcs
Vorlias Jun 10, 2023
cd4a477
ok change look ahead thingy
Vorlias Jun 10, 2023
a22630b
single statement support for arrow func
Vorlias Jun 10, 2023
8943d44
Legacy command syntax is now an option
Vorlias Jun 10, 2023
5ad873f
Transform macros for debugging
Vorlias Jun 10, 2023
b88b197
transformer lol
Vorlias Jun 10, 2023
d509184
more
Vorlias Jun 16, 2023
a8b756e
Userdata changes
Vorlias Jun 19, 2023
1fc76df
code changes
Vorlias Jun 19, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update syntax.ebnf
  • Loading branch information
Vorlias committed Jan 28, 2022
commit 9e966095d8e469317e4109cd4e70b8264a47bb59
38 changes: 35 additions & 3 deletions syntax.ebnf
Original file line number Diff line number Diff line change
@@ -3,20 +3,52 @@ QuotedString ::= [^"]*

/* Literals */
StringLiteral ::= '"' QuotedString '"' | "'" [^']* "'"
NumberLiteral ::= [0-9].?[0-9]?+
NumberLiteral ::= '-'? [0-9].?[0-9]?+
ArrayLiteral ::= '[' ( Expression | Expression (',' Expression)* ) ']'
ObjectLiteral ::= '{' ( ObjectProperty | ObjectProperty ( ',' ObjectProperty )* )? '}'

/* Objects */
ObjectProperty ::= (Identifier | StringLiteral) ':' Expression

/* Operators */
UnaryOperator ::= '-' | '+' | '!'
BinaryOperator ::= "*" | "+" | "/" | "-" | "!=" | "==" | "|" | '&' | "||" | "&&" | ">=" | "<="

/* Statements */
ExpressionStatement ::= Expression | '(' Expression ')'
Statement ::= ExpressionStatement | FunctionDeclaration | VariableDeclaration | EnumDeclaration
SourceBlock ::= (Statement ';'*)*
Block = '{' SourceBlock '}'

/* Expressions */
Expression ::= Identifier | StringLiteral | InterpolatedStringExpression | NumberLiteral | ArrayLiteral | ObjectLiteral
Expression ::= Identifier
| StringLiteral
| InterpolatedStringExpression
| NumberLiteral
| ArrayLiteral
| ObjectLiteral
| BinaryExpression
| UnaryExpression
| FunctionExpression
UnaryExpression ::= UnaryOperator Expression
BinaryExpression ::= Expression BinaryOperator Expression
InterpolatedStringExpression ::= '"' (QuotedString* ('$' Identifier)* QuotedString*)* '"'


/* Call Expressions */
SimpleCallArgument ::= '$(' Expression ')' | ( '$' Identifier ) | NumberLiteral | BooleanLiteral | StringExpression | ArrayLiteral | ObjectLiteral
SimpleCallExpression ::= Identifier '!' | Identifier SimpleCallArgument ( ' ' SimpleCallArgument )*

CallExpression ::= Identifier '(' (Expression | Expression (',' Expression)* ) ')'
CallExpression ::= Identifier '(' (Expression | Expression (',' Expression)* ) ')'

/* Enums */
EnumItems ::= Identifier | Identifier (',' Identifier )*
EnumDeclaration ::= 'enum' Identifier '{' EnumItems '}'

/* Functions */
FunctionParameters ::= Identifier | Identifier ( ',' Identifier )*
FunctionDeclaration ::= 'function' Identifier '(' FunctionParameters? ')' Block
FunctionExpression ::= 'function' '(' FunctionParameters ')' Block

/* Variables */
VariableDeclaration ::= ('export')? ('const' | 'let') Identifier '=' Expression