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
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)
def process(text, loc): value = tryDecodeString(text) if value is None: return ct.FailValue("invalid string") return ast.AstStringLiteral(value, loc)
def processSymbol(sym, loc): if sym.startswith("`"): sym = tryDecodeString(sym) if sym is None: return ct.FailValue("invalid symbol") return sym