From c1c1b6ae1b89d4ebbc79c234af8a5d31770516ae Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Thu, 15 May 2025 23:20:23 -0700 Subject: parser: distinguish lambda dot token. * parser.y (yybadtoken): Map the LAMBDOT token code to the name "lambda dot" to distinguish it from CONSDOT in error situations. * txr.1: Change the Consing Dot section to Lambda Dot. * y.tab.c.shipped: Regenerated. --- parser.y | 4 ++-- txr.1 | 10 +++++++--- y.tab.c.shipped | 4 ++-- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/parser.y b/parser.y index f9f6ec70..0b774574 100644 --- a/parser.y +++ b/parser.y @@ -2157,8 +2157,8 @@ void yybadtoken(parser_t *parser, int tok, val context) case LITCHAR: problem = lit("string literal character"); break; case SPLICE: problem = lit("*"); break; case JSPLICE: problem = lit("~*"); break; - case CONSDOT: - case LAMBDOT: problem = lit("consing dot"); break; + case CONSDOT: problem = lit("consing dot"); break; + case LAMBDOT: problem = lit("lambda dot"); break; case DOTDOT: problem = lit(".."); break; case OLD_DOTDOT: problem = lit(".."); break; case UREFDOT: problem = lit("referencing dot"); break; diff --git a/txr.1 b/txr.1 index bef9c514..b7eb8f01 100644 --- a/txr.1 +++ b/txr.1 @@ -12253,11 +12253,12 @@ even though the unprefixed character sequence .code 1.E3 is otherwise a floating-point constant. -.NP* Consing Dot +.NP* Lambda Dot Unlike other major Lisp dialects, \*(TL allows a consing dot with no forms -preceding it. This construct simply denotes the form which follows the dot. -That is to say, the parser implements the following transformation: +preceding it. This construct simply denotes the form which follows the dot, +and is called the Lambda Dot. That is to say, the parser implements the +following transformation: .verb (. expr) -> expr @@ -12295,6 +12296,9 @@ or an atom as .codn "(. sym)" . +Note: it is due to its use in parameter lists that it is given the name +Lambda Dot. + This notation is implemented for the square brackets, according to this transformation: diff --git a/y.tab.c.shipped b/y.tab.c.shipped index b4185de4..61904671 100644 --- a/y.tab.c.shipped +++ b/y.tab.c.shipped @@ -7877,8 +7877,8 @@ void yybadtoken(parser_t *parser, int tok, val context) case LITCHAR: problem = lit("string literal character"); break; case SPLICE: problem = lit("*"); break; case JSPLICE: problem = lit("~*"); break; - case CONSDOT: - case LAMBDOT: problem = lit("consing dot"); break; + case CONSDOT: problem = lit("consing dot"); break; + case LAMBDOT: problem = lit("lambda dot"); break; case DOTDOT: problem = lit(".."); break; case OLD_DOTDOT: problem = lit(".."); break; case UREFDOT: problem = lit("referencing dot"); break; -- cgit v1.2.3