-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* rewrite start and lexer * make ranges f64 only * "pushing what I have" Co-authored-by: Sasial <[email protected]> * fixed enum * ty grammar parsed Co-authored-by: Sasial <[email protected]> * syntax parser should be done * syntax tree and parser * major changes to parser, irgen, output Co-authored-by: Sasial <[email protected]> * Update TS output to use new config file * Update zap/src/config.rs Co-authored-by: Sasial <[email protected]> * Update cli/Cargo.toml Co-authored-by: Sasial <[email protected]> * remove logos and fix order * remove todo * move imports to top of file * remove shortened name * extract code out of macro * update lib returns * fix numlit regex * Add diagnostics support to WASM/Playground * chore: fmt * fix incorrect tydecl grammar * condense filter and map to filter_map * add debugging config * fix `struct` keyword being required in tagged enum structs * lots of changes Co-authored-by: Sasial <[email protected]> * move and update ebnf grammar * fix colorchoice to work in colorless terminals * refactor error code constants in reports.rs * add vscode to gitignore * change casing opt * big changes * rename EmptyTab to EmptyTable --------- Co-authored-by: Sasial <[email protected]>
- Loading branch information
1 parent
107bba2
commit be79647
Showing
30 changed files
with
2,661 additions
and
1,497 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
(* This file is exists only for the purpose of documentation *) | ||
(* and reference. It is not used anywhere within zap. *) | ||
(* Zap Rules *) | ||
(* this section has whitespace *) | ||
zap = {opt}, {evdecl | tydecl}; | ||
opt = "opt", ( | ||
"write_checks", ':', ("true" | "false") | ||
| "server_output", ':', string | ||
| "client_output", ':', string | ||
| "typescript", ':', ("true" | "false") | ||
), [';']; | ||
evdecl = "event", ident, '=', '{', | ||
"from", ':', ("Server" | "Client"), ',', | ||
"type", ':', ("Reliable" | "Unreliable"), ',', | ||
"call", ':', ("SingleSync" | "SingleAsync" | "ManySync" | "ManyAsync"), ',', | ||
"data", ':', ty, [','], | ||
'}', [';']; | ||
tydecl = "type", ident, '=', ty, [';']; | ||
ty = ty-num | ty-str | ty-arr | ty-map | ty-opt | ty-ref | ty-enum | ty-struct | ty-instance; | ||
ty-num = ("f32" | "f64"), ['(', range-num,')'] | ||
| ("u8" | "u16" | "u32" | "i8" | "i16" | "i32"), ['(', range-int,')']; | ||
ty-str = "string", ['(', range-int,')']; | ||
ty-arr = ty, '[', range-num, ']'; | ||
ty-map = "map", '[', ty, ']', ':', ty; | ||
ty-opt = ty, '?'; | ||
ty-ref = ident; | ||
ty-struct = "struct", struct; | ||
ty-enum = ty-enum-unit | ty-enum-tagged; | ||
ty-enum-unit = "enum", '{', ident, {',', ident}, [','], '}'; | ||
ty-enum-tagged = "enum", string, '{', ident, struct, {',', ident, ty-struct}, [','], '}'; | ||
ty-instance = "Instance", ['(', ident, ')']; | ||
struct-field = ident, ':', ty, [',', struct-field]; | ||
struct = '{', struct-field, [","], '}'; | ||
range-num = "" | ||
| num, "..", num | ||
| num, ".." | ||
| "..", num | ||
| ".." | ||
| num; | ||
range-int = "" | ||
| int, "..", int | ||
| int, ".." | ||
| "..", int | ||
| ".." | ||
| int; | ||
(* Base Rules *) | ||
(* this section has no whitespace *) | ||
ident = alpha, {alphanum | '_'}; | ||
string = '"', {alphanum}, '"'; | ||
num = int, ['.', int]; | ||
int = digit, {digit}; | ||
alphanum = alpha | digit; | ||
alpha = 'a'..'z' | 'A'..'Z'; | ||
digit = '0'..'9'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.