Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[JsonGen] Support multiline description tags #59

Merged
merged 1 commit into from
Dec 4, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion ProxyStubGenerator/CppParser.py
Original file line number Diff line number Diff line change
Expand Up @@ -1503,9 +1503,25 @@ def __Tokenize(contents,log = None):
r"|([\r\n\t ])" # whitespace
)

tokens = [s.strip() for s in re.split(formula, contents, flags=(re.MULTILINE)) if s and s.strip()]
rtokens = [s.strip() for s in re.split(formula, contents, flags=(re.MULTILINE)) if s and s.strip()]

tokens = []

for i, token in enumerate(rtokens):
if (i > 1) and (i < len(rtokens) - 1):
if rtokens[i].startswith("//") and tokens[-1].startswith("//"):
if "@_line" in token and rtokens[i+1].startswith("//") and "@" not in rtokens[i+1]:
# get rid of line tags between comments
continue
elif "@" not in token:
# join comments without any @ markers
tokens[-1] += " "+ token[2:].strip()
continue

tokens.append(token)

tagtokens = []

# check for special metadata within comments
skipmode = False
omit_depth = 0
Expand Down