Skip to content

Commit

Permalink
minor bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
victorlei committed Aug 14, 2016
1 parent d3762a9 commit f0ec4e4
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 6 deletions.
6 changes: 3 additions & 3 deletions smop/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -325,9 +325,9 @@ def _backend(self,level=0):
def _backend(self,level=0):
return "global %s" % self.global_list._backend()

@extend(node.ravel)
def _backend(self,level=0):
return "%s.ravel()" % self.args[0]._backend()
#@extend(node.ravel)
#def _backend(self,level=0):
# return "%s.ravel()" % self.args[0]._backend()

@extend(node.return_stmt)
def _backend(self,level=0):
Expand Down
2 changes: 1 addition & 1 deletion smop/lexer.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ def t_ERROR_STMT(t):

# keep multiline comments
def t_COMMENT(t):
r"(^[ \t]*[%#][^!].*\n)+"
r"(^[ \t]*[%#][^!\n].*\n)+"
t.lexer.lineno += t.value.count("\n")
if not options.no_comments:
t.type = "COMMENT"
Expand Down
8 changes: 6 additions & 2 deletions smop/parse.py
Original file line number Diff line number Diff line change
Expand Up @@ -565,7 +565,7 @@ def p_funcall_expr(p):
"""expr : expr LPAREN expr_list RPAREN
| expr LPAREN RPAREN
"""
if (0 and len(p)==5 and
if (len(p)==5 and
len(p[3])==1 and
p[3][0].__class__ is node.expr and
p[3][0].op == ":" and not p[3][0].args):
Expand Down Expand Up @@ -845,7 +845,11 @@ def parse(buf):

if "1" in options.debug:
for i,pi in enumerate(p):
print i,pi.__class__.__name__,str(pi)[:50]
print i,pi.__class__.__name__,pi._backend()

if "p" in options.debug:
import pdb
pdb.set_trace()

for i in range(len(p)):
if isinstance(p[i], node.func_stmt):
Expand Down
1 change: 1 addition & 0 deletions smop/version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__version__ = '0.28'

0 comments on commit f0ec4e4

Please sign in to comment.