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 v2] spec: remove comments from the spec
Date: Wed, 16 Oct 2024 19:41:04 +0000 (UTC)	[thread overview]
Message-ID: <20241016194054.231344-1-carlos@maniero.me> (raw)

The comments bellow were now allowed following our spec:

{
  # this is now allowed
  return 1 # so is this
}

To avoid spreading the comment all over our spec, the comment is no
longer part of the spec and we are get riding of anything that starts
with #.

Signed-off-by: Carlos Maniero <carlos@maniero.me>
---
 contrib/bin/run-ebnf | 2 +-
 docs/info/olang.ebnf | 3 +--
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/contrib/bin/run-ebnf b/contrib/bin/run-ebnf
index 4b2b559..85b7c35 100755
--- a/contrib/bin/run-ebnf
+++ b/contrib/bin/run-ebnf
@@ -19,4 +19,4 @@ BASEDIR="$(dirname "$0")"
 
 DEPS='{:deps {instaparse/instaparse {:mvn/version "1.5.0"}}}'
 
-cat $BASEDIR/../../docs/info/olang.ebnf | sed 's/<\([a-z-]*\)>/\1/g' | FILE="$1" clj -Sdeps "$DEPS" -M $BASEDIR/ebnf.clj
+cat $BASEDIR/../../docs/info/olang.ebnf | sed 's/<\([a-z-]*\)>/\1/g' | FILE=<(cat $1 | sed 's/#.*$//') clj -Sdeps "$DEPS" -M $BASEDIR/ebnf.clj
diff --git a/docs/info/olang.ebnf b/docs/info/olang.ebnf
index 791c6f0..0bc7eb5 100644
--- a/docs/info/olang.ebnf
+++ b/docs/info/olang.ebnf
@@ -1,5 +1,5 @@
 (* Entry Point *)
-<translation-unit> ::= (<ows> (<external-declaration> | <comment>) <ows> (<end-of-statement> | <end-of-file>))*
+<translation-unit> ::= (<ows> (<external-declaration>) <ows> (<end-of-statement> | <end-of-file>))*
 
 (* Translation Unit *)
 <external-declaration> ::= <common-statement> | <function-definition>
@@ -76,7 +76,6 @@
 <integer-base16>  ::= #'0[Xx]' <hex-digit> (<hex-digit> | '_')*
 
 (* Utilities *)
-<comment>      ::= '#' #'[^\n]*'
 <ws>           ::= <white-space>+
 <ows>          ::= <white-space>*
 <white-space>  ::= <linear-space> | <line-break>
-- 
2.46.1


             reply	other threads:[~2024-10-16 19:41 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-16 19:41 Carlos Maniero [this message]
2024-10-16 19:41 ` [olang/patches/.build.yml] build success builds.sr.ht
2024-10-16 21:49 ` [PATCH olang v2] spec: remove comments from the spec Johnny Richard

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=20241016194054.231344-1-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