From 5284de349db31bd9399010da0b54c000b4e2a3cc Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Sun, 5 Apr 2020 15:56:13 +0100 Subject: [PATCH] case and default do not need implicit colon --- src/soc/decoder/pseudo/lexer.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/soc/decoder/pseudo/lexer.py b/src/soc/decoder/pseudo/lexer.py index 7c1d6420..1bd5d79e 100644 --- a/src/soc/decoder/pseudo/lexer.py +++ b/src/soc/decoder/pseudo/lexer.py @@ -37,7 +37,7 @@ MUST_INDENT = 2 # complex grammar rules def python_colonify(lexer, tokens): - fake_colon_needed = False + implied_colon_needed = False for token in tokens: #print ("track colon token", token, token.type) @@ -50,15 +50,15 @@ def python_colonify(lexer, tokens): token = copy(token) token.type = "COLON" yield token - elif token.type in ['DO', 'WHILE', 'FOR', 'SWITCH', 'CASE', 'DEFAULT']: - fake_colon_needed = True + elif token.type in ['DO', 'WHILE', 'FOR', 'SWITCH']: + implied_colon_needed = True yield token elif token.type == 'NEWLINE': - if fake_colon_needed: + if implied_colon_needed: ctok = copy(token) ctok.type = "COLON" yield ctok - fake_colon_needed = False + implied_colon_needed = False yield token else: yield token -- 2.30.2