public inbox for ~johnnyrichard/olang-devel@lists.sr.ht
 help / color / mirror / code / Atom feed
From: Carlos Maniero <carlos@maniero.me>
To: ~johnnyrichard/olang-devel@lists.sr.ht
Cc: Carlos Maniero <carlos@maniero.me>
Subject: [PATCH olang] spec: allow comments inside blocks
Date: Tue, 15 Oct 2024 22:59:03 +0000 (UTC)	[thread overview]
Message-ID: <20241015225750.211129-2-carlos@maniero.me> (raw)

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


             reply	other threads:[~2024-10-15 22:59 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-15 22:59 Carlos Maniero [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20241015225750.211129-2-carlos@maniero.me \
    --to=carlos@maniero.me \
    --cc=~johnnyrichard/olang-devel@lists.sr.ht \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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