-
Notifications
You must be signed in to change notification settings - Fork 166
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
Add comment section to specification #666
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
## Lexical Elements | ||
|
||
This section explains the lexical elements of the Verona language. | ||
It forms part of the [language specification](spec.md), | ||
which is intended to be a comprehensive guide to the Verona programming language. | ||
|
||
### Comments | ||
|
||
Verona supports two types of comments. | ||
The first type is a single line comment: | ||
``` | ||
// Single line comments | ||
``` | ||
These start with a `//` and continue to the end of the line. | ||
The termination of the comment is the end of the line or the end of file, which ever occurs sooner. | ||
|
||
The second type of comment is a block comment: | ||
``` | ||
/* Block comments */ | ||
``` | ||
These comments begin with a `/*` and end with a `*/`. | ||
They can span multiple lines. | ||
``` | ||
/* | ||
This is a multi- | ||
line block comment. | ||
*/ | ||
``` | ||
|
||
The block comment is nestable, meaning that you can have a block comment within a block comment. | ||
``` | ||
/* Block comments can contain commented code. | ||
/* This is a block comment */ | ||
f(x,y,z) | ||
/* with another block comment */ | ||
g(x,y,z) | ||
*/ | ||
``` | ||
There is no limit to the nesting depth of block comments. | ||
|
||
Block comments must be correctly terminated. | ||
That is every `/*` must have a corresponding `*/`. | ||
A non-terminated block comment is a syntax error. | ||
|
||
> [TODO:] Explain interaction with string literals. | ||
> Possibly, here or in string section. | ||
|
||
### Identifiers and Symbols | ||
|
||
- `_` as "don't care". | ||
|
||
### Primitive literals | ||
|
||
- Boolean | ||
- Various integers and floats | ||
|
||
> [TODO:] How to talk about integer literals not having a type yet? That is, 0 is zero, not a particular type of 0. https://www.haskell.org/tutorial/numbers.html | ||
|
||
### Array literals | ||
|
||
### String literals | ||
|
||
> [TODO:] String literals are not for a specific text encoding, like 0 is the zero it needs to be (float, signed, unsigned, 1/2/4/8/16/32/64bit, etc.). | ||
|
||
### Lambdas | ||
|
||
### Object Literals | ||
|
||
> [Open issues:] code reuse, possible conflict with "real" `new`. | ||
> Note that the parser current uses `new { ... }` as an object literal, which might conflict with object allocation. | ||
|
||
### Expression Termination | ||
|
||
- Blank lines | ||
- New lines | ||
- Indentation | ||
- Trailing lambdas |
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.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
xref https://ghc.gitlab.haskell.org/ghc/doc/users_guide/exts/overloaded_strings.html