Skip to content

Commit

Permalink
Improve literal define counting (#428)
Browse files Browse the repository at this point in the history
  • Loading branch information
mkruselj authored Jan 9, 2024
1 parent f0d7319 commit a0470fe
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions compiler/preprocessor_plugins.py
Original file line number Diff line number Diff line change
Expand Up @@ -1651,10 +1651,10 @@ def handleDefineConstants(lines, define_cache = None):
newLines.append(l)
continue

# count number of string replacement token openers to figure out if we're defining literals
num_literals = m.group("val").count("{")
# count how many literals we have
num_literals = m.group("val").count(",") + 1

if num_literals > 0:
if num_literals > 1:
# add define for amount of entries in a literal define (.SIZE suffix)
defineSizeObj = DefineConstant(m.group("whole") + '.SIZE', str(num_literals), None, l)
defineConstants.append(defineSizeObj)
Expand Down

0 comments on commit a0470fe

Please sign in to comment.