class Lexer:
    def tokenize(self, characters):
        token = lambda: None
        if characters[0] in ["'", '"']:
          token.is_a = lambda ttype: ttype == TokenType.string
        else:
          token.is_a = lambda ttype: ttype == TokenType.integer
        return [token]

class TokenType:
    def integer(): pass
    def string(): pass

@@ -71,24 +71,141 @@
 a: None%0A    
+    token = decorate_with_type(token, characters)%0A        return %5Btoken%5D%0A%0Adef decorate_with_type(token, characters):%0A
     if chara
@@ -228,34 +228,32 @@
 , '%22'%5D:%0A        
-  
 token.is_a = lam
@@ -289,20 +289,16 @@
 .string%0A
-    
     else
@@ -299,18 +299,16 @@
   else:%0A
-  
         
@@ -361,20 +361,17 @@
 integer%0A
-    
+%0A
     retu
@@ -373,23 +373,22 @@
  return 
-%5B
 token
-%5D
+%0A
 %0A%0Aclass 

Separated out type logic