docs: Update docs for whitespace and inverted types#31
Merged
juliaogris merged 1 commit intomasterfrom Oct 27, 2022
Merged
Conversation
|
firebase-deployment: https://evy-lang--31-ktgfx6tx.web.app (97fa08b) |
78b5e9b to
29d621b
Compare
fa5dbb4 to
77d30cb
Compare
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 with
expression. Introduce `<- ->` and `<+ +>` tokens to annotated
whitespace 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:
m:[]{}string
m[0].name = "Joe"
Also add note on pass by reference for maps and arrays and pass by value
for string, num and bool.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
WSsignificant 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
termfrom 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