Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions src/input-format.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,19 @@
r[input]
# Input format

r[input.syntax]
```grammar,lexer
@root CHAR -> <a Unicode scalar value>

NUL -> U+0000

TAB -> U+0009

LF -> U+000A

CR -> U+000D
```
Comment on lines +4 to +15
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This feels a bit odd to reference this as the input syntax (and put it here. I would have expected input.syntax to be something like

@root INPUT -> SHEBANG? (BLANK_LINES FRONTMATTER)? TOKEN*

BLANK_LINES might refer to part of this but not all of it.


r[input.intro]
This chapter describes how a source file is interpreted as a sequence of tokens.

Expand Down
21 changes: 1 addition & 20 deletions src/notation.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,27 +50,8 @@ r[notation.grammar.visualizations]

Below each grammar block is a button to toggle the display of a [syntax diagram]. A square element is a non-terminal rule, and a rounded rectangle is a terminal.

[syntax diagram]: https://en.wikipedia.org/wiki/Syntax_diagram

r[notation.grammar.common]
### Common productions

The following are common definitions used in the grammar.

r[input.syntax]
```grammar,lexer
@root CHAR -> <a Unicode scalar value>

NUL -> U+0000

TAB -> U+0009

LF -> U+000A

CR -> U+000D
```

[binary operators]: expressions/operator-expr.md#arithmetic-and-logical-binary-operators
[keywords]: keywords.md
[syntax diagram]: https://en.wikipedia.org/wiki/Syntax_diagram
[tokens]: tokens.md
[unary operators]: expressions/operator-expr.md#borrow-operators