Skip to content
Snippets Groups Projects
Commit f5492008 authored by Dennis Gläser's avatar Dennis Gläser
Browse files

[docgen][code_to_md] rename taggedContent()

parent 4a8b6ceb
No related branches found
No related tags found
Loading
...@@ -10,7 +10,7 @@ from pyparsing import * ...@@ -10,7 +10,7 @@ from pyparsing import *
# tell pyparsing to never ignore white space characters # tell pyparsing to never ignore white space characters
ParserElement.setDefaultWhitespaceChars('') ParserElement.setDefaultWhitespaceChars('')
def taggedContent(keyname, action, open="[[", close="]]", endTag="/"): def parseTaggedContent(keyname, action, open="[[", close="]]", endTag="/"):
""" """
Match content between [[keyname]] and [[/keyname]] and apply the action on it Match content between [[keyname]] and [[/keyname]] and apply the action on it
""" """
...@@ -39,11 +39,11 @@ def cppRules(): ...@@ -39,11 +39,11 @@ def cppRules():
endHeaderGuard = Suppress(Literal("#endif") + Optional(restOfLine)) endHeaderGuard = Suppress(Literal("#endif") + Optional(restOfLine))
# exclude stuff between [[exclude]] and [[/exclude]] # exclude stuff between [[exclude]] and [[/exclude]]
exclude = taggedContent("exclude", action=replaceWith("")) exclude = parseTaggedContent("exclude", action=replaceWith(""))
# make a code block (possibly containing comments) between [[codeblock]] and [[/codeblock]] # make a code block (possibly containing comments) between [[codeblock]] and [[/codeblock]]
action = createMarkdownCode("cpp") action = createMarkdownCode("cpp")
codeblock = taggedContent("codeblock", action=action) codeblock = parseTaggedContent("codeblock", action=action)
# treat doc and code line # treat doc and code line
doc = LineStart() + Suppress(ZeroOrMore(" ") + Literal("//") + ZeroOrMore(" ")) + Optional(restOfLine) doc = LineStart() + Suppress(ZeroOrMore(" ") + Literal("//") + ZeroOrMore(" ")) + Optional(restOfLine)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment