docs: Update docs for whitespace and inverted types #31
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.
Update docs for whitespace. While at it, remove a bunch of duplicated
sections in grammar. We are now making horizontal whitespace
WS
significant in certain places which allows us to remove the somewhat
awkward array and map typing in favour of derived and inferred types
for literals.
Remove
term
from grammar as it is not used in code, we only work withexpression. Introduce
<- ->
and<+ +>
tokens to annotatedwhitespace inside grammar: expressions in expression lists, such as
function calls or array elements may not contain whitespace, as
whitespace is used as list separator.
Invert types so that types read as variables are being access:
Also add note on pass by reference for maps and arrays and pass by value
for string, num and bool.
For easier review:
https://github.com/foxygoat/evy/blob/docs-ws/docs/syntax_by_example.md
https://github.com/foxygoat/evy/blob/docs-ws/docs/syntax_grammar.md