示例#1
0
 def visitTerminal(self, ctx):
     """Converts case insensitive keywords and identifiers to lowercase"""
     text = str(super().visitTerminal(ctx))
     quotes = ["'", '"']
     if not (text[0] in quotes and text[-1] in quotes):
         text = text.lower()
     return Terminal.from_text(text, ctx)
示例#2
0
 def visitTerminal(self, ctx):
     """Converts case insensitive keywords and identifiers to lowercase
        Identifiers in quotes are not lowercased even though there is case sensitivity in quotes for identifiers,
         to prevent lowercasing quoted values.
     """
     text = str(super().visitTerminal(ctx))
     quotes = ["'", '"']
     if not (text[0] in quotes and text[-1] in quotes):
         text = text.lower()
     return Terminal.from_text(text, ctx)
示例#3
0
 def visit_Relational_operator(node):
     return Terminal.from_text(node.get_text(), node._ctx)  # node.children[0]?
示例#4
0
 def visit_Comparison_operator(node):
     return Terminal.from_text(node.get_text(), node._ctx)
示例#5
0
 def visit_Sign(node):
     # TODO strip + sign from int?
     return Terminal.from_text(node.get_text(), node._ctx)