X-Git-Url: https://code.kerkeslager.com/?p=fur;a=blobdiff_plain;f=tokenization.py;fp=tokenization.py;h=e9f536b133536b05e286e44ab8847fbab604a8ef;hp=f316e5e9fd19c7c5b6526f89e2dd0a35fdc48fca;hb=ec54804ff2c217e4f6be0220049142e300681093;hpb=fb83d523f8eb241d5ccafe8d391a9edd62150b48 diff --git a/tokenization.py b/tokenization.py index f316e5e..e9f536b 100644 --- a/tokenization.py +++ b/tokenization.py @@ -36,6 +36,7 @@ _TOKEN_MATCHERS = [ ('open_parenthese', r'\('), ('close_parenthese', r'\)'), ('comma', r','), + ('assignment_operator', r'='), ('integer_literal', r'\d+'), ('symbol', r'[a-z]+'), ('single_quoted_string_literal', r"'.*?'"), @@ -185,6 +186,16 @@ if __name__ == '__main__': ),), ) + def test_tokenizes_assignment_operator(self): + self.assertEqual( + tokenize('='), + (Token( + type='assignment_operator', + match='=', + index=0, + line=1, + ),), + ) def test_handles_trailing_newline(self): self.assertEqual(