Skip to content

Commit

Permalink
Nits.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ken Kundert authored and Ken Kundert committed Aug 18, 2020
1 parent f78c5ff commit 30c6e4e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@
.*.swp
doc/.build
tests/.coverage
.ecrc
compute-zo
lg.ec
lg0.ec
tests/.ecrc
tests/compute-zo
tests/lg.ec
tests/lg0.ec

# Packages
*.egg
Expand Down
8 changes: 4 additions & 4 deletions engineering_calculator/calculator.py
Original file line number Diff line number Diff line change
Expand Up @@ -1279,9 +1279,9 @@ class Calculator:
'''
# before splitting the input, the following regex will be replaced by a
# space. This allows certain operators to be given abutted to numbers
operatorSplitRegex = re.compile('''
(?<=[a-zA-Z0-9°ÅΩƱΩ℧]) # alphanum before the split
(?=([-+*/%!]|\*\*|\|\||//)(\s|\Z)) # selected operators followed by white space or EOL: - + * / % ! ** || //
operatorSplitRegex = re.compile(r'''
(?<=[a-zA-Z0-9°ÅΩƱΩ℧]) # alphanum before the split
(?=([-+*/%!]|\*\*|\|\||//)(\s|\Z)) # selected operators followed by white space or EOL: - + * / % ! ** || //
''', re.X)
# strings are delimited by "" and `` (' is reserved for use with verilog
# integer literals)
Expand Down Expand Up @@ -1414,7 +1414,7 @@ def showLoc(given, index):
raise CalculatorError('nested function definitions.')
elif cmd[0] == ')':
name = cmd[1:]
nameRegex='[a-zA-Z_]\w*'
nameRegex = r'[a-zA-Z_]\w*'
if not re.match(nameRegex, name):
raise CalculatorError('%s: invalid function name.' % name)
if name in self.heap:
Expand Down

0 comments on commit 30c6e4e

Please sign in to comment.