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.
This PR targets the creation of metadata for terms and optargs.
The idea:
terms/
directory contains a JSON file for each term type. Each JSON may be expanded with type information such as:types/
directory contains JSON files that describes extra term types.Syntax:
Files will share a lot of syntax. Some type/signature definitions will be defined in the following pattern:
A lot of types will be declared in this way, to mimic function calling (and also due to how easy it should be to parse).
The main difference between
terms/*.json
andtypes/*.json
will be thatterms/*.json
will declare actual term type information, whiletypes/*.json
will declare type aliases. By declaring type aliases, the overall size of files should be smaller and way more readable in general.terms/*.json
files should look like:While
types/*.json
files should look like:Extra documentation:
Explain the types and what should they mean.
Small documentation:
union
A
union
-based type accept only its' arguments as valid parameters.["union", ["soft", "hard"]]
may only accept"soft"
and"hard"
, nothing else.range
A
range
-based type accepts values in a numerical range.type typeName = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8
varargs
A
varargs
-based type should be the last type in a signature and will expand to a varargs/rest parameter.