Skip to content

Commit

Permalink
Fix #4339 Handle cwl package option in format `#keyvals:\geometry,\us…
Browse files Browse the repository at this point in the history
…epackage/geometry#c`
  • Loading branch information
James-Yu committed Aug 18, 2024
1 parent b696954 commit e69c9aa
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions dev/pyintel/pkgcommand.py
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,13 @@ def parse_cwl_file(self, file_path: Union[Path, str], remove_spaces: bool = Fals
pkg.envs[pkgenv].keyvalpos = len(re.findall(r'\[\]|\(\)|<>|{}', re.sub(r'\${.*?}', '', pkg.envs[pkgenv].snippet[:haskeyvals.start()])))
pkg.envs[pkgenv].keyvalindex = pkg.envs[pkgenv].keyvalindex or []
pkg.envs[pkgenv].keyvalindex.append(match[1])
elif envcmd.startswith('\\usepackage/'):
for i in range(len(re.findall(r'%<([^%]*?)%>', line))):
line = re.sub(r'%<([^%]*?)%>', '${' + str(i + 1) + r':\1}', line, 1)
match = re.match(r'^([^#%\n]*)', line)
if match is None:
continue
pkg.options.append(match[1])
else:
cmd = re.match(r'\\?([^{\[#]*)', envcmd)[1]
for pkgcmd in pkg.macros:
Expand Down

0 comments on commit e69c9aa

Please sign in to comment.