added one_display
This commit is contained in:
parent
63f5989ece
commit
dde18df5cf
|
|
@ -86,6 +86,10 @@ class HeaderToken(SemanticType):
|
||||||
label = "header"
|
label = "header"
|
||||||
|
|
||||||
|
|
||||||
|
class DisplayToken(SemanticType):
|
||||||
|
label = "display"
|
||||||
|
|
||||||
|
|
||||||
class StructuralElementStartToken(SemanticType):
|
class StructuralElementStartToken(SemanticType):
|
||||||
label = "se:start"
|
label = "se:start"
|
||||||
|
|
||||||
|
|
@ -178,6 +182,7 @@ structural_elements = (
|
||||||
pp.CaselessLiteral('section')
|
pp.CaselessLiteral('section')
|
||||||
)('structural_element')
|
)('structural_element')
|
||||||
header_element = pp.OneOrMore(pp.Literal('#'))
|
header_element = pp.OneOrMore(pp.Literal('#'))
|
||||||
|
display_element = pp.OneOrMore(pp.Literal('!'))
|
||||||
|
|
||||||
|
|
||||||
# Optional elements
|
# Optional elements
|
||||||
|
|
@ -209,6 +214,9 @@ il_link = pp.Literal('[') + ... + pp.Literal('](') + quotes + http_characters +
|
||||||
one_header = (
|
one_header = (
|
||||||
header_element + ... + pp.match_previous_literal(header_element)
|
header_element + ... + pp.match_previous_literal(header_element)
|
||||||
).add_parse_action(of_type(HeaderToken))
|
).add_parse_action(of_type(HeaderToken))
|
||||||
|
one_display = (
|
||||||
|
display_element + ... + pp.match_previous_literal(display_element)
|
||||||
|
).add_parse_action(of_type(DisplayToken))
|
||||||
one_olist = pp.line_start + (
|
one_olist = pp.line_start + (
|
||||||
pp.Literal('#') + pps('.') + ...('olist_text') + pp.line_end
|
pp.Literal('#') + pps('.') + ...('olist_text') + pp.line_end
|
||||||
).add_parse_action(of_type(EtOlistToken))
|
).add_parse_action(of_type(EtOlistToken))
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue