comicbox.readinglists.syntax ¶
Describe a document that does not parse: what is wrong, and where.
describe_syntax_error(exc) ¶
Describe a parse error in one line, with its position.
Source code in comicbox/readinglists/syntax.py
15 16 17 18 19 20 21 22 23 24 | |
refuse_yaml_aliases(text) ¶
Refuse a YAML document that uses an alias.
A few hundred bytes of aliases, each doubling the last, stand for gigabytes once anything walks them. A reading list never needs one, and comicbox never writes one. Only the parser’s events are read, so the check itself costs one pass over the text.
Source code in comicbox/readinglists/syntax.py
58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 | |
syntax_error(text) ¶
Describe what keeps a document from parsing, or None when it parses.
XML and JSON by their first character, anything else as YAML. Text that opens like JSON is held to JSON, even where it is valid YAML.
Source code in comicbox/readinglists/syntax.py
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 | |