* [PATCH olang] spec: allow comments inside blocks
@ 2024-10-15 22:59 Carlos Maniero
2024-10-15 22:59 ` [olang/patches/.build.yml] build success builds.sr.ht
2024-10-16 19:48 ` [PATCH olang] spec: allow comments inside blocks Carlos Maniero
0 siblings, 2 replies; 3+ messages in thread
From: Carlos Maniero @ 2024-10-15 22:59 UTC (permalink / raw)
To: ~johnnyrichard/olang-devel; +Cc: Carlos Maniero
The comments bellow were now allowed following our spec:
{
# this is now allowed
return 1 # so is this
}
Signed-off-by: Carlos Maniero <carlos@maniero.me>
---
docs/info/olang.ebnf | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/docs/info/olang.ebnf b/docs/info/olang.ebnf
index 791c6f0..475be6e 100644
--- a/docs/info/olang.ebnf
+++ b/docs/info/olang.ebnf
@@ -16,10 +16,10 @@
<function-params> ::= <identifier> <ows> ':' <ows> <type> ( <ows> ',' <ows> <function-params>)*
<return-type> ::= <type>
<function-body> ::= <block>
-<block> ::= '{' <ows> <statement> <ows> (<end-of-statement> <ows> <statement> <ows>)* <end-of-statement>? <ows> '}'
+<block> ::= '{' <ows> <statement> <ows> <comment>? (<end-of-statement> <ows> <statement> <ows>)* <end-of-statement>? <ows> '}'
<function-args> ::= <expression> (<ows> ',' <ows> <function-args>)*
<function-call> ::= <function-name> <ows> '(' ( <ows> | <ows> <function-args> <ows> ) ')'
-<statement> ::= <common-statement> | <if-statement> | <while-statement> | <return-statement> | <function-call>
+<statement> ::= <common-statement> | <if-statement> | <while-statement> | <return-statement> | <function-call> | <comment>
<if-statement> ::= 'if' <ws> <expression> <ows> <block> ( <ows> 'else' ( <ows> <block> | <ows> <if-statement> ) )?
<while-statement> ::= 'while' <ws> <expression> <ows> <block>
<return-statement> ::= 'return' <ws> <expression>
--
2.46.1
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-10-16 19:48 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-10-15 22:59 [PATCH olang] spec: allow comments inside blocks Carlos Maniero
2024-10-15 22:59 ` [olang/patches/.build.yml] build success builds.sr.ht
2024-10-16 19:48 ` [PATCH olang] spec: allow comments inside blocks Carlos Maniero
Code repositories for project(s) associated with this public inbox
https://git.johnnyrichard.com/olang.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox