Skip to content

Commit 4ab365f

Browse files
committed
Fix flake8 warnings in OMTypedParser.py
1 parent 6311507 commit 4ab365f

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

OMPython/OMTypedParser.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@
5959

6060
import sys
6161

62+
6263
def convertNumbers(s, l, toks):
6364
n = toks[0]
6465
try:
@@ -75,7 +76,8 @@ def convertString2(s, s2):
7576
tmp = tmp.replace("\n", "\\n")
7677
tmp = tmp.replace("\r", "\\r")
7778
tmp = tmp.replace("\t", "\\t")
78-
return "'"+tmp+"'";
79+
return "'"+tmp+"'"
80+
7981

8082
def convertString(s, s2):
8183
return s2[0].replace("\\\"", '"')
@@ -89,7 +91,6 @@ def convertTuple(t):
8991
return tuple(t[0])
9092

9193

92-
9394
def evaluateExpression(s, loc, toks):
9495
# Convert the tokens (ParseResults) into a string expression
9596
flat_list = [item for sublist in toks[0] for item in sublist]
@@ -100,6 +101,7 @@ def evaluateExpression(s, loc, toks):
100101
except Exception:
101102
return expr
102103

104+
103105
# Number parsing (supports arithmetic expressions in dimensions) (e.g., {1 + 1, 1})
104106
arrayDimension = infixNotation(
105107
Word(alphas + "_", alphanums + "_") | Word(nums),
@@ -123,7 +125,7 @@ def evaluateExpression(s, loc, toks):
123125
Optional('.' + Word(nums)) +
124126
Optional(Word('eE', exact=1) + Word(nums + '+-', nums)))
125127

126-
#ident = Word(alphas + "_", alphanums + "_") | Combine("'" + Word(alphanums + "!#$%&()*+,-./:;<>=?@[]^{}|~ ") + "'")
128+
# ident = Word(alphas + "_", alphanums + "_") | Combine("'" + Word(alphanums + "!#$%&()*+,-./:;<>=?@[]^{}|~ ") + "'")
127129
ident = Word(alphas + "_", alphanums + "_") | QuotedString(quoteChar='\'', escChar='\\').setParseAction(convertString2)
128130
fqident = Forward()
129131
fqident << ((ident + "." + fqident) | ident)
@@ -143,7 +145,7 @@ def evaluateExpression(s, loc, toks):
143145
def parseString(string):
144146
res = omcGrammar.parseString(string)
145147
if len(res) == 0:
146-
return
148+
return
147149
return res[0]
148150

149151

0 commit comments

Comments
 (0)