From ad72a3204cb66766dcebb847b42512494199d15a Mon Sep 17 00:00:00 2001 From: David Kerkeslager Date: Mon, 14 Aug 2017 02:34:41 -0400 Subject: [PATCH] Make "do" a keyword --- parsing.py | 2 +- tokenization.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/parsing.py b/parsing.py index b2a14a8..e2bd9d0 100644 --- a/parsing.py +++ b/parsing.py @@ -399,7 +399,7 @@ def _function_definition_statement_parser(index, tokens): tokens[index].line, )) - if tokens[index].type == 'symbol' and tokens[index].match == 'do': + if tokens[index].match == 'do': index += 1 else: return failure diff --git a/tokenization.py b/tokenization.py index 3c4dc6f..914d05a 100644 --- a/tokenization.py +++ b/tokenization.py @@ -32,7 +32,7 @@ def _make_token_matcher(definition): return token_matcher _TOKEN_MATCHERS = [ - ('keyword', r'(def|end)(?![a-z_])'), + ('keyword', r'(def|do|end)(?![a-z_])'), ('open_parenthese', r'\('), ('close_parenthese', r'\)'), ('comma', r','), -- 2.20.1