From 289dad48494f668006268b6cbea6fcecad6d5ab1 Mon Sep 17 00:00:00 2001 From: Thomas Walker Lynch Date: Wed, 14 May 2025 08:22:27 -0700 Subject: [PATCH] EBNF tweak in README for #macro --- README.md | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 3f9ed9a..ad30d42 100644 --- a/README.md +++ b/README.md @@ -46,6 +46,7 @@ Defines a macro in standard ISO form, using token literal parsing and optional p #### Syntax (EBNF): ``` + directive ::= "#macro" name params body ; name ::= identifier ; @@ -53,15 +54,12 @@ name ::= identifier ; params ::= "(" param_list? ")" ; param_list ::= identifier ("," identifier)* ; -body ::= clause ; - -clause ::= "(" literal? ")" - | "[" expr? "]" ; +body ::= "(" literal? ")" ; literal ::= ; sequence parsed into tokens without expansion -expr ::= ; sequence parsed into tokens with recursive expansion ; whitespace, including newlines, is ignored + ``` - A `literal` clause is delimited with `(` ... `)` and behaves like `#define F(x) (x + 1)`. -- 2.20.1