From 3f498d4dd965429a98623137ce6ac7b0ce124da4 Mon Sep 17 00:00:00 2001 From: Ethan Herdrick Date: Mon, 16 Jun 2025 10:33:10 -1000 Subject: [PATCH] sly.rst documentation: Add LPAREN and RPAREN to CalcLexer from "A More Complete Example". However, GT/GREATERTHAN and others still not used in CalcParser. --- docs/sly.rst | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/sly.rst b/docs/sly.rst index 25bd382..5a7b25d 100644 --- a/docs/sly.rst +++ b/docs/sly.rst @@ -413,7 +413,7 @@ into practice:: # Set of token names. This is always required tokens = { NUMBER, ID, WHILE, IF, ELSE, PRINT, PLUS, MINUS, TIMES, DIVIDE, ASSIGN, - EQ, LT, LE, GT, GE, NE } + EQ, LT, LE, GT, GE, NE, LPAREN, RPAREN } literals = { '(', ')', '{', '}', ';' } @@ -433,6 +433,8 @@ into practice:: GE = r'>=' GT = r'>' NE = r'!=' + LPAREN = r'\(' + RPAREN = r'\)' @_(r'\d+') def NUMBER(self, t):