public inbox for ~johnnyrichard/olang-devel@lists.sr.ht
 help / color / mirror / code / Atom feed
* [PATCH olang v2] spec: remove comments from the spec
@ 2024-10-16 19:41 Carlos Maniero
  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
  0 siblings, 2 replies; 3+ messages in thread
From: Carlos Maniero @ 2024-10-16 19:41 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
}

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


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-10-16 19:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-10-16 19:41 [PATCH olang v2] spec: remove comments from the spec Carlos Maniero
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

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