diff options
author | jgrey4296 <johngrey4296@gmail.com> | 2020-08-17 04:13:18 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-16 22:13:18 -0500 |
commit | a49e56932a851f63859adf8735dcdd993e16657c (patch) | |
tree | 1976f3bc25c20fc149dcb038afcbb285025b7eb1 | |
parent | bcb8242230fc7e0e9c416856d2aa6d9aba7e7e87 (diff) | |
download | pyparsing-git-a49e56932a851f63859adf8735dcdd993e16657c.tar.gz |
Remove identChars override from Keyword.copy (#233)
-rw-r--r-- | pyparsing/core.py | 1 | ||||
-rw-r--r-- | tests/test_unit.py | 5 |
2 files changed, 5 insertions, 1 deletions
diff --git a/pyparsing/core.py b/pyparsing/core.py index d865283..608d607 100644 --- a/pyparsing/core.py +++ b/pyparsing/core.py @@ -1992,7 +1992,6 @@ class Keyword(Token): def copy(self): c = super().copy() - c.identChars = Keyword.DEFAULT_KEYWORD_CHARS return c @staticmethod diff --git a/tests/test_unit.py b/tests/test_unit.py index 42a6c73..32677f6 100644 --- a/tests/test_unit.py +++ b/tests/test_unit.py @@ -5983,6 +5983,11 @@ class Test2_WithoutPackrat(ppt.TestParseResultsAsserts, TestCase): False, "failed to match keyword using updated keyword chars" ) + def testKeywordCopyIdentChars(self): + a_keyword = pp.Keyword("start", identChars="_") + b_keyword = a_keyword.copy() + self.assertEqual(a_keyword.identChars, b_keyword.identChars) + def testLiteralVsKeyword(self): integer = ppc.integer |