-
Notifications
You must be signed in to change notification settings - Fork 37
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
Added ebnf.md file #1987
base: main
Are you sure you want to change the base?
Added ebnf.md file #1987
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,38 @@ | ||||||
# EBNF | ||||||
|
||||||
```chatinput | ||||||
<fastn> ::= <comment>* <module_comment>? <item>* | ||||||
<item> ::= <comment> | <section> | ||||||
|
||||||
|
||||||
<module_comment> ::= (<single_module_comment> <new_line>)* <single_module_comment> (<new_line> | <eof>) | ||||||
<single_module_comment> ::= <doc_comment_marker> <opt_whitespace> <sentence>? <opt_whitespace> | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Should we have There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we include the |
||||||
|
||||||
<comment> ::= (<single_comment> <new_line>)* <single_comment> (<new_line> | <eof>) | ||||||
<single_comment> ::= <comment_marker> <opt_whitespace> <sentence>? <opt_whitespace> | ||||||
|
||||||
|
||||||
<section> ::= <start_marker> <opt_whitespace> <section_declaration>? <new_line>? | ||||||
<section_declaration> ::= (<section_kind> <whitespace>)? <section_name> <colon> <opt_whitespace> <section_value>? <opt_whitespace> | ||||||
<section_kind> ::= <word> | ||||||
<section_name> ::= <word> | ||||||
<section_value> ::= <word> | ||||||
|
||||||
|
||||||
|
||||||
<start_marker> ::= "--" | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's rename this to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also I think the grammar would be easier to read if we do not define names for things that are ever used once. |
||||||
<end_marker> ::= "--" <whitespace> "end:" <opt_whitespace> | ||||||
<new_line> ::= "\n" | ||||||
<eof> ::= "\n" | ||||||
<colon> ::= ":" | ||||||
<comment_marker> ::= ";;" | ||||||
<doc_comment_marker> ::= ";;;" | ||||||
|
||||||
<sentence> ::= <word> <opt_whitespace> | <word> | ||||||
<opt_whitespace> ::= " "* | ||||||
<whitespace> ::= " "+ | ||||||
<word> ::= <character>+ | ||||||
<character> ::= <letter> | <digit> | ||||||
<letter> ::= "A" | "B" | "C" | "D" | "E" | "F" | "G" | "H" | "I" | "J" | "K" | "L" | "M" | "N" | "O" | "P" | "Q" | "R" | "S" | "T" | "U" | "V" | "W" | "X" | "Y" | "Z" | "a" | "b" | "c" | "d" | "e" | "f" | "g" | "h" | "i" | "j" | "k" | "l" | "m" | "n" | "o" | "p" | "q" | "r" | "s" | "t" | "u" | "v" | "w" | "x" | "y" | "z" | ||||||
<digit> ::= "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | ||||||
``` |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
;; This is comment | ||
;; This is other line in comment |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
[ | ||
{ | ||
"type": "comment", | ||
"source": { | ||
"from": "1:0", | ||
"to": "2:33", | ||
"value": " This is comment\nThis is other line in comment" | ||
} | ||
} | ||
] |
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.
Would this be same / simpler?
Would this work?