}) # format texts for entry in attribs: if process_txt and 'text' in entry and len(entry['text'])>0: if format_: entry["text"] = self.formatText(entry["text"]) else: entry["text"] = self.cleanupText(entry["text"]) #from pprint import pprint #pprint( attribs) return attribs gr_at__default_ = ( py.Suppress('@') + py.Word(py.alphas)('category') + py.restOfLine("text") ) ## # "@<hint> text" def parse_at__default_(self, line): grammar = self.gr_at__default_ presult = grammar.parseString(line) res = { 'category' : presult.category, 'text' : presult.text.strip(), } return res # the next would be close to the spec (but huge!) #identi = py.Word(u''.join(lang.IDENTIFIER_CHARS_START), u''.join(lang.IDENTIFIER_CHARS_BODY)) # but using regex, to be consistent with the parser py_js_identifier = py.Regex(lang.IDENTIFIER_REGEXP)
}) # format texts for entry in attribs: if 'text' in entry and len(entry['text']) > 0: if format_: entry["text"] = self.formatText(entry["text"]) else: entry["text"] = self.cleanupText(entry["text"]) #from pprint import pprint #pprint( attribs) return attribs gr_at__default_ = (py.Suppress('@') + py.Word(py.alphas)('category') + py.restOfLine("text")) ## # "@<hint> text" def parse_at__default_(self, line): grammar = self.gr_at__default_ presult = grammar.parseString(line) res = { 'category': presult.category, 'text': presult.text.strip(), } return res # the next would be close to the spec (but huge!) #identi = py.Word(u''.join(lang.IDENTIFIER_CHARS_START), u''.join(lang.IDENTIFIER_CHARS_BODY)) # but using regex, to be consistent with the parser
# format texts for entry in attribs: if process_txt and 'text' in entry and len(entry['text'])>0: if format_: entry["text"] = self.formatText(entry["text"]) else: entry["text"] = self.cleanupText(entry["text"]) #from pprint import pprint #pprint( attribs) return attribs gr_at__default_ = ( py.Suppress('@') + py.Word(py.alphas)('category') + py.restOfLine("text") ) ## # "@<hint> text" def parse_at__default_(self, line): grammar = self.gr_at__default_ presult = grammar.parseString(line) res = { 'category' : presult.category, 'text' : presult.text.strip(), } return res # the next would be close to the spec (but huge!) #identi = py.Word(u''.join(lang.IDENTIFIER_CHARS_START), u''.join(lang.IDENTIFIER_CHARS_BODY)) # but using regex, to be consistent with the parser py_js_identifier = py.Regex(lang.IDENTIFIER_REGEXP)
}) # format texts for entry in attribs: if 'text' in entry and len(entry['text'])>0: if format_: entry["text"] = self.formatText(entry["text"]) else: entry["text"] = self.cleanupText(entry["text"]) #from pprint import pprint #pprint( attribs) return attribs gr_at__default_ = ( py.Suppress('@') + py.Word(py.alphas)('category') + py.restOfLine("text") ) ## # "@<hint> text" def parse_at__default_(self, line): grammar = self.gr_at__default_ presult = grammar.parseString(line) res = { 'category' : presult.category, 'text' : presult.text.strip(), } return res # the next would be close to the spec (but huge!) #identi = py.Word(u''.join(lang.IDENTIFIER_CHARS_START), u''.join(lang.IDENTIFIER_CHARS_BODY)) # but using regex, to be consistent with the parser py_js_identifier = py.Regex(lang.IDENTIFIER_REGEXP)
entry["line"] = line_no attribs.append(entry) # format texts for entry in attribs: if process_txt and "text" in entry and len(entry["text"]) > 0: if format_: entry["text"] = self.formatText(entry["text"]) else: entry["text"] = self.cleanupText(entry["text"]) # from pprint import pprint # pprint( attribs) return attribs gr_at__default_ = py.Suppress("@") + py.Word(py.alphas)("category") + py.restOfLine("text") ## # "@<hint> text" def parse_at__default_(self, line): grammar = self.gr_at__default_ presult = grammar.parseString(line) res = {"category": presult.category, "text": presult.text.strip()} return res # the next would be close to the spec (but huge!) # identi = py.Word(u''.join(lang.IDENTIFIER_CHARS_START), u''.join(lang.IDENTIFIER_CHARS_BODY)) # but using regex, to be consistent with the parser py_js_identifier = py.Regex(lang.IDENTIFIER_REGEXP) # next: Ugly hack to add '*' to identifier globs __idx = lang.IDENTIFIER_REGEXP.rfind("]") py_js_identifier_glob = py.Regex(lang.IDENTIFIER_REGEXP[:__idx] + "\\*" + lang.IDENTIFIER_REGEXP[__idx:])
else: attribs.append({"category": "description", "text": line.strip()}) # format texts for entry in attribs: if "text" in entry and len(entry["text"]) > 0: if format_: entry["text"] = self.formatText(entry["text"]) else: entry["text"] = self.cleanupText(entry["text"]) # from pprint import pprint # pprint( attribs) return attribs gr_at__default_ = py.Suppress("@") + py.Word(py.alphas)("category") + py.restOfLine("text") ## # "@<hint> text" def parse_at__default_(self, line): grammar = self.gr_at__default_ presult = grammar.parseString(line) res = {"category": presult.category, "text": presult.text.strip()} return res # the next would be close to the spec (but huge!) # identi = py.Word(u''.join(lang.IDENTIFIER_CHARS_START), u''.join(lang.IDENTIFIER_CHARS_BODY)) # but using regex, to be consistent with the parser py_js_identifier = py.Regex(lang.IDENTIFIER_REGEXP) py_simple_type = py.Suppress("{") + py_js_identifier.copy()("type_name") + py.Suppress("}")
attribs.append(entry) # format texts for entry in attribs: if process_txt and 'text' in entry and len(entry['text']) > 0: if format_: entry["text"] = self.formatText(entry["text"]) else: entry["text"] = self.cleanupText(entry["text"]) #from pprint import pprint #pprint( attribs) return attribs gr_at__default_ = (py.Suppress('@') + py.Word(py.alphas)('category') + py.restOfLine("text")) ## # "@<hint> text" def parse_at__default_(self, line): grammar = self.gr_at__default_ presult = grammar.parseString(line) res = { 'category': presult.category, 'text': presult.text.strip(), } return res # the next would be close to the spec (but huge!) #identi = py.Word(u''.join(lang.IDENTIFIER_CHARS_START), u''.join(lang.IDENTIFIER_CHARS_BODY)) # but using regex, to be consistent with the parser