def _relational_delim_list(self, sep): quoted = quotedString.copy() quoted.setParseAction(lambda s, p, t: self._parse_rel(removeQuotes(s, p, t), sep)) value = quoted | Word(printables, excludeChars=('%' + sep)) value.setParseAction(self._inc_index) comment = self._comment() parser = comment | delimitedList(value, delim=sep) return parser
def _relational_delim_list(self, sep): quoted = quotedString.copy() quoted.setParseAction( lambda s, p, t: self._parse_rel(removeQuotes(s, p, t), sep)) value = quoted | Word(printables, excludeChars=('%' + sep)) value.setParseAction(self._inc_index) comment = self._comment() parser = comment | delimitedList(value, delim=sep) return parser
def string_literal(self): """ string_literal ::= "'" string "'" | "\"" string "\"" Any successful match is converted to a single quoted string to simplify post-parsed operations. """ return quotedString.setParseAction( lambda s, l, t: "'{string}'".format(string=removeQuotes(s, l, t)))
def action(s, loc, tokens): try: return self.parser.get_time_stamp(removeQuotes(s, loc, tokens)) except ValueError as e: raise DateValFormatError(e)