Skip to content

Commit

Permalink
apply more linter suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
sskeirik committed Dec 9, 2024
1 parent 5895fc5 commit e9e7186
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions pykwasm/src/pykwasm/run_wasm.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
from pykwasm import kwasm_ast as a
from pyk.kast.manip import split_config_from
from pyk.kast.inner import KSequence, KSort, KToken, Subst
from pyk.kore.syntax import App, Assoc, MLPattern, Pattern, SortApp
from pyk.kore.syntax import App, Assoc, MLPattern, SortApp
from pyk.ktool.krun import KRun

if TYPE_CHECKING:
Expand All @@ -46,6 +46,7 @@
StartFunction,
Table,
)
from pyk.kore.syntax import Pattern
from wasm.datatypes.element_segment import ElemMode
from wasm.instructions import BaseInstruction

Expand Down Expand Up @@ -73,7 +74,7 @@ def build_subst_key(key_name):
extra_args = args[2:]
for arg in extra_args:
if arg[0] != '-':
raise ValueError(f"substitution argument was ill-formed: '{arg}'")
raise ValueError(f"substitution argument was ill-formed: {arg!r}")
prekey_sort, val = arg[1:].split('=')
prekey, sort = prekey_sort.split(':')
key = build_subst_key(prekey)
Expand All @@ -83,7 +84,7 @@ def build_subst_key(key_name):
if key in config_subst:
raise ValueError(f'redundant key found in substitution map: {prekey}')

if sort == 'String': val = f'"{val}"'
if sort == 'String': val = '"' + f'{val}' + '"'
config_subst[key] = KToken(val, sort)

# parse module as binary (with fallback to textual parser)
Expand Down Expand Up @@ -187,7 +188,7 @@ def push(*items):
push(pat.name, '{', pat.sorts, '}')
elif isinstance(pat, DepthChange):
depth += pat.value
if pat == PRINT:
if pat == _print:
print_spacer = True
else:
pat.write(output)
Expand Down

0 comments on commit e9e7186

Please sign in to comment.