-
Notifications
You must be signed in to change notification settings - Fork 0
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
Overloads #11
Open
jchitel
wants to merge
15
commits into
master
Choose a base branch
from
overloads
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Commits on Jan 25, 2018
-
Configuration menu - View commit details
-
Copy full SHA for daf91b0 - Browse repository at this point
Copy the full SHA daf91b0View commit details
Commits on Feb 24, 2018
-
Configuration menu - View commit details
-
Copy full SHA for c475736 - Browse repository at this point
Copy the full SHA c475736View commit details
Commits on Mar 1, 2018
-
Refactored parser and syntax to be more idiomatic
This involves quite a few changes: Parser: The parser has been completely redone from the ground up. To facilitate the new compiler restriction of pure functional programming, the parser logic makes use of function composition. The result is a dead-simple API. There are 5 types of parse expressions: tok (tokens), seq (sequences), select (selections), optional, and repeat. Each one has a corresponding function that can be used to build a parse function capable of parsing any type of node. The whole thing is now strongly typed. Sequences are strongly typed by way of overloads, and they are parsed as arrays instead of objects, with a transform function for converting the arrays to objects. The concept of 'soft' and 'definite' are now gone, because that was overkill. The parser will now greedily consume as much input as possible, and only throw an error when all options are exhausted. This means that order needs to be heavily enforced even more than before. The parser also makes use of the new pure lexer as well, so the entire process is purely functional. Additionally, much of the complex logic around the various types of repetitions and left recursions have been replaced with desugaring to simpler constructs, making the full set of logic simpler as a whole. "Abstract" node types are explained in the Syntax Environment section. Syntax: The syntax has now scrapped the use of classes, and now uses interfaces with discriminated unions. The base type of all syntax node types is now NodeBase, which defines only a 'location' property. All sub-interfaces are required to specify a 'syntaxType' property specifying a single specific SyntaxType enum value. This property is the discriminant, which we will make use of in the future. This whole structure is made possible by the extreme flexibility of the parser, which can now return any kind of value, not just class instances. The high-level node types (declarations, types, expressions, and statments) are now just unions of their corresponding node types, and there is one high-level Node type that is the union of all of them. The Program type is now called ModuleRoot, and ModuleRoot and all import and export types are now separated from other declarations, because they are part of their own domain. Syntax Environment: The new parser API is specified in-place, not using functions. This means that node types that reference each other circularly will not work out of the box. We need to make use of mechanisms such as scope hoisting and referencing undeclared variables within functions to make it work properly. The only problem with that is that these mechanisms do not work cross-module. To make this work, we have introduced the concept of a "syntax environment", which is a function that loads any circularly-referencing syntax types on-demand. All of the high-level node types have their parser specification declared within the syntax environment inside functions. All types that are dependent on these do not declare their syntax at the module root, instead declaring them in "register()" functions that declare their dependencies as parameters. The syntax environment's module imports all of these register functions and calls them within the environment function, where it has access to the high-level parse functions. This means that to have access to the parse functions of all syntax types, you need to call the SyntaxEnvironment function, which will return a fresh environment complete with circular references resolved.
Configuration menu - View commit details
-
Copy full SHA for adc2f91 - Browse repository at this point
Copy the full SHA adc2f91View commit details
Commits on Apr 29, 2018
-
Configuration menu - View commit details
-
Copy full SHA for b68bd97 - Browse repository at this point
Copy the full SHA b68bd97View commit details -
Configuration menu - View commit details
-
Copy full SHA for 3601fdf - Browse repository at this point
Copy the full SHA 3601fdfView commit details -
Configuration menu - View commit details
-
Copy full SHA for 2894497 - Browse repository at this point
Copy the full SHA 2894497View commit details
Commits on May 1, 2018
-
Configuration menu - View commit details
-
Copy full SHA for 88fe6fa - Browse repository at this point
Copy the full SHA 88fe6faView commit details -
Configuration menu - View commit details
-
Copy full SHA for 9ef3b64 - Browse repository at this point
Copy the full SHA 9ef3b64View commit details -
Configuration menu - View commit details
-
Copy full SHA for 4afbc6f - Browse repository at this point
Copy the full SHA 4afbc6fView commit details
Commits on May 10, 2018
-
Configuration menu - View commit details
-
Copy full SHA for d5b84e2 - Browse repository at this point
Copy the full SHA d5b84e2View commit details
Commits on May 15, 2018
-
Configuration menu - View commit details
-
Copy full SHA for 50e70fc - Browse repository at this point
Copy the full SHA 50e70fcView commit details -
Configuration menu - View commit details
-
Copy full SHA for a862bba - Browse repository at this point
Copy the full SHA a862bbaView commit details
Commits on May 16, 2018
-
Configuration menu - View commit details
-
Copy full SHA for 0bc3aa9 - Browse repository at this point
Copy the full SHA 0bc3aa9View commit details -
Configuration menu - View commit details
-
Copy full SHA for a1bafa8 - Browse repository at this point
Copy the full SHA a1bafa8View commit details
Commits on Mar 15, 2019
-
Configuration menu - View commit details
-
Copy full SHA for e348d82 - Browse repository at this point
Copy the full SHA e348d82View commit details
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.