diff --git a/smop/main.py b/smop/main.py index ff5f9c4e..6f328d5e 100644 --- a/smop/main.py +++ b/smop/main.py @@ -36,7 +36,7 @@ def main(): fp = open(options.output, "w") print >> fp, "# Autogenerated with SMOP " + version.__version__ - print >> fp, "from __future__ import division" + #print >> fp, "from __future__ import division" print >> fp, "from smop.core import *" if options.link: print >> fp, "from %s import *" % options.link diff --git a/smop/parse.py b/smop/parse.py index a139553e..78e19380 100644 --- a/smop/parse.py +++ b/smop/parse.py @@ -124,34 +124,6 @@ def p_args(p): p[0] = p[1] p[0].append(p[2]) - -@exceptions -def p_args_opt(p): - """ - args_opt : - | LPAREN RPAREN - | LPAREN expr_list RPAREN - """ - flag = False - if len(p) == 1: - p[0] = node.expr_list() - elif len(p) == 3: - p[0] = node.expr_list() - elif len(p) == 4: - assert isinstance(p[2],node.expr_list) - p[0] = p[2] - flag = True - else: - assert 0 - - if flag: - t = p[2][-1] - if isinstance(t,node.ident) and t.name=="varargin": - t.name = "*varargin" - for t in p[2]: - if isinstance(t,node.ident) and t.name != '*varargin': - t.init = node.ident("None") - @exceptions def p_break_stmt(p): @@ -454,10 +426,14 @@ def p_expr_ident(p): @exceptions def p_ident_init_opt(p): """ - ident_init_opt : ident + ident_init_opt : NEG + | ident | ident EQ expr """ - p[0] = p[1] + if p[1] == '~': + p[0] = node.ident("__") + else: + p[0] = p[1] if len(p) == 2: p[0].init = node.ident(name="None") if p[0].name != "varargin" else "" else: diff --git a/smop/version.py b/smop/version.py index 4a753b0b..86244fa9 100644 --- a/smop/version.py +++ b/smop/version.py @@ -1 +1 @@ -__version__ = '0.28' +__version__ = '0.29'