Skip to content

Commit

Permalink
Resolved issue that with nested () that was introduced by last commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Gareth Aneurin Tribello committed Jun 25, 2024
1 parent 80c421e commit 2db83cc
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
2 changes: 0 additions & 2 deletions PlumedToHTML/PlumedLexer.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ class PlumedLexer(RegexLexer):
(r'(\w+)(=)(@\S+:)(\S+\b)', bygroups(Name.Attribute, Text, Name.Constant, Generic)),
# Find KEYWORD with {} brackets around value
(r'(\w+)(=)((?s)\{.*?\})', bygroups(Name.Attribute, Text, Generic)),
# Find KEYWORD with () brackets around value
(r'(\w+)(=)((?s)\(.*?\))', bygroups(Name.Attribute, Text, Generic)),
# Find KEYWORD=whatever
(r'(\w+)(=)(\S+\b)', bygroups(Name.Attribute, Text, Generic))
],
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

setuptools.setup(
name='PlumedToHTML',
version='0.72',
version='0.73',
author="Gareth Tribello",
author_email="[email protected]",
description="A package for creating pretified HTML for PLUMED files",
Expand Down
8 changes: 6 additions & 2 deletions tdata/lexertests.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,12 @@
"output": "<div class=\"highlight\"><pre><span></span><span class=\"c\"># This is a comment </span>\n <span class=\"s\">phi</span>: <span class=\"k\">TORSION</span> <span class=\"na\">ATOMS</span>=<span class=\"g\">1,2,3,4</span> <span class=\"c\"># This is also a comment with : a colon</span>\n</pre></div>\n"
},
{
"input": "st_saxs: STATS ARG=(SAXS\\.q-.*) PARARG=(SAXS\\.exp-.*)",
"output": "<div class=\"highlight\"><pre><span></span><span class=\"s\">st_saxs</span>: <span class=\"k\">STATS</span> <span class=\"na\">ARG</span>=<span class=\"g\">(SAXS\\.q-.*)</span> <span class=\"na\">PARARG</span>=<span class=\"g\">(SAXS\\.exp-.*)</span>\n</pre></div>\n"
"input": "a: CUSTOM ARG=x PERIODIC=NO FUNC=(step(x-1))",
"output": "<div class=\"highlight\"><pre><span></span><span class=\"s\">a</span>: <span class=\"k\">CUSTOM</span> <span class=\"na\">ARG</span>=<span class=\"g\">x</span> <span class=\"na\">PERIODIC</span>=<span class=\"g\">NO</span> <span class=\"na\">FUNC</span>=<span class=\"g\">(step(x-1</span><span class=\"err\">))</span>\n</pre></div>\n"
},
{
"input": "st_saxs: STATS ARG={SAXS\\.q-.*} PARARG={SAXS\\.exp-.*}",
"output": "<div class=\"highlight\"><pre><span></span><span class=\"s\">st_saxs</span>: <span class=\"k\">STATS</span> <span class=\"na\">ARG</span>=<span class=\"g\">{SAXS\\.q-.*}</span> <span class=\"na\">PARARG</span>=<span class=\"g\">{SAXS\\.exp-.*}</span>\n</pre></div>\n"
}
]
}

0 comments on commit 2db83cc

Please sign in to comment.