Example #1
0
 def symbol(self):
     sym = self._nextTag(SYMBOL).text
     if sym.startswith("`"):
         sym = tryDecodeString(sym)
         if sym is None:
             raise ParseException(self.location, "invalid symbol")
     return sym
Example #2
0
 def symbol(self):
     sym = self._nextTag(SYMBOL).text
     if sym.startswith("`"):
         sym = tryDecodeString(sym)
         if sym is None:
             raise ParseException(self.location, "invalid symbol")
     return sym
Example #3
0
 def stringLiteral(self):
     tok = self._nextTag(STRING)
     value = tryDecodeString(tok.text)
     if value is None:
         raise ParseException(tok.location,
                              "could not understand string: %s" % tok.text)
     return ast.StringLiteral(value, tok.location)
Example #4
0
 def stringLiteral(self):
     tok = self._nextTag(STRING)
     value = tryDecodeString(tok.text)
     if value is None:
         raise ParseException(tok.location, "could not understand string: %s" % tok.text)
     return ast.StringLiteral(value, tok.location)
Example #5
0
 def process(text, loc):
     value = tryDecodeString(text)
     if value is None:
         return ct.FailValue("invalid string")
     return ast.AstStringLiteral(value, loc)
Example #6
0
def processSymbol(sym, loc):
    if sym.startswith("`"):
        sym = tryDecodeString(sym)
        if sym is None:
            return ct.FailValue("invalid symbol")
    return sym