Skip to content

Commit

Permalink
Updated _TokenizeConditional to better deal with != in dsc files
Browse files Browse the repository at this point in the history
  • Loading branch information
apop5 committed Oct 15, 2024
1 parent 954f914 commit b07aa86
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion edk2toollib/uefi/edk2/parsers/base_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -546,12 +546,14 @@ def _TokenizeConditional(cls: "BaseParser", text: str) -> str:
mode = 0
tokens = []
for character in text:
if character == '"' and len(token) == 0:
if character == '"' and len(token) == 0 and mode != QUOTE_MODE:
mode = QUOTE_MODE
elif character == '"' and mode == QUOTE_MODE:
if len(token) > 0:
tokens.append(f'"{token}"')
token = ""
else:
tokens.append("\"\"")
mode = TEXT_MODE
elif character == "$" and len(token) == 0:
token += character
Expand Down

0 comments on commit b07aa86

Please sign in to comment.