Repository: xonsh/xonsh

Issue:
Errors on quoted arguments
I noticed that this was failing:

```
tim@darkside /usr/local/Library master|REBASE-i 1/7 $ git commit --amend --author='Viktor Szakáts <vszakats@users.noreply.github.com>'
..................................................... 
Traceback (most recent call last):
  File "/usr/local/Cellar/xonsh/0.1.5/libexec/lib/python3.4/site-packages/xonsh/execer.py", line 148, in _parse_ctx_free
    debug_level=self.debug_level)
  File "/usr/local/Cellar/xonsh/0.1.5/libexec/lib/python3.4/site-packages/xonsh/parser.py", line 258, in parse
    tree = self.parser.parse(input=s, lexer=self.lexer, debug=debug_level)
  File "/usr/local/Cellar/xonsh/0.1.5/libexec/vendor/lib/python3.4/site-packages/ply/yacc.py", line 331, in parse
    return self.parseopt_notrack(input, lexer, debug, tracking, tokenfunc)
  File "/usr/local/Cellar/xonsh/0.1.5/libexec/vendor/lib/python3.4/site-packages/ply/yacc.py", line 1181, in parseopt_notrack
    tok = call_errorfunc(self.errorfunc, errtoken, self)
  File "/usr/local/Cellar/xonsh/0.1.5/libexec/vendor/lib/python3.4/site-packages/ply/yacc.py", line 193, in call_errorfunc
    r = errorfunc(token)
  File "/usr/local/Cellar/xonsh/0.1.5/libexec/lib/python3.4/site-packages/xonsh/parser.py", line 2357, in p_error
    column=p.lexpos))
  File "/usr/local/Cellar/xonsh/0.1.5/libexec/lib/python3.4/site-packages/xonsh/parser.py", line 329, in _parse_error
    raise err
  File "<string>", line None
SyntaxError: <xonsh-code>:1:32: ("code: 'Viktor Szakáts <vszakats@users.noreply.github.com>'",)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/Cellar/xonsh/0.1.5/libexec/lib/python3.4/site-packages/xonsh/shell.py", line 152, in push
    locs=self.ctx)
  File "/usr/local/Cellar/xonsh/0.1.5/libexec/lib/python3.4/site-packages/xonsh/execer.py", line 92, in compile
    tree = self.parse(input, ctx, mode=mode)
  File "/usr/local/Cellar/xonsh/0.1.5/libexec/lib/python3.4/site-packages/xonsh/execer.py", line 70, in parse
    tree = self._parse_ctx_free(input, mode=mode)
  File "/usr/local/Cellar/xonsh/0.1.5/libexec/lib/python3.4/site-packages/xonsh/execer.py", line 161, in _parse_ctx_free
    raise original_error
  File "/usr/local/Cellar/xonsh/0.1.5/libexec/lib/python3.4/site-packages/xonsh/execer.py", line 148, in _parse_ctx_free
    debug_level=self.debug_level)
  File "/usr/local/Cellar/xonsh/0.1.5/libexec/lib/python3.4/site-packages/xonsh/parser.py", line 258, in parse
    tree = self.parser.parse(input=s, lexer=self.lexer, debug=debug_level)
  File "/usr/local/Cellar/xonsh/0.1.5/libexec/vendor/lib/python3.4/site-packages/ply/yacc.py", line 331, in parse
    return self.parseopt_notrack(input, lexer, debug, tracking, tokenfunc)
  File "/usr/local/Cellar/xonsh/0.1.5/libexec/vendor/lib/python3.4/site-packages/ply/yacc.py", line 1181, in parseopt_notrack
    tok = call_errorfunc(self.errorfunc, errtoken, self)
  File "/usr/local/Cellar/xonsh/0.1.5/libexec/vendor/lib/python3.4/site-packages/ply/yacc.py", line 193, in call_errorfunc
    r = errorfunc(token)
  File "/usr/local/Cellar/xonsh/0.1.5/libexec/lib/python3.4/site-packages/xonsh/parser.py", line 2357, in p_error
    column=p.lexpos))
  File "/usr/local/Cellar/xonsh/0.1.5/libexec/lib/python3.4/site-packages/xonsh/parser.py", line 329, in _parse_error
    raise err
  File "<string>", line None
SyntaxError: <xonsh-code>:1:4: ('code: commit',)
```

Another failure, which crashes xonsh:

```
tim@darkside /usr/local/Library/Formula master $ command /bin/echo --author="<>"
Traceback (most recent call last):
  File "/usr/local/Cellar/xonsh/0.1.5/libexec/bin/xonsh", line 3, in <module>
    main()
  File "/usr/local/Cellar/xonsh/0.1.5/libexec/lib/python3.4/site-packages/xonsh/main.py", line 68, in main
    shell.cmdloop()
  File "/usr/local/Cellar/xonsh/0.1.5/libexec/lib/python3.4/site-packages/xonsh/shell.py", line 181, in cmdloop
    super(Shell, self).cmdloop(intro=intro)
  File "/usr/local/Cellar/python3/3.4.3/Frameworks/Python.framework/Versions/3.4/lib/python3.4/cmd.py", line 138, in cmdloop
    stop = self.onecmd(line)
  File "/usr/local/Cellar/python3/3.4.3/Frameworks/Python.framework/Versions/3.4/lib/python3.4/cmd.py", line 211, in onecmd
    return self.default(line)
  File "/usr/local/Cellar/xonsh/0.1.5/libexec/lib/python3.4/site-packages/xonsh/shell.py", line 127, in default
    code = self.push(line)
  File "/usr/local/Cellar/xonsh/0.1.5/libexec/lib/python3.4/site-packages/xonsh/shell.py", line 152, in push
    locs=self.ctx)
  File "/usr/local/Cellar/xonsh/0.1.5/libexec/lib/python3.4/site-packages/xonsh/execer.py", line 95, in compile
    code = compile(tree, self.filename, mode)
ValueError: expression which can't be assigned to in Store context
```

And another failure, which does not crash xonsh:

```
tim@darkside /usr/local/Library/Formula master $ $[/bin/echo --author=""]
................................................ 
Traceback (most recent call last):
  File "/usr/local/Cellar/xonsh/0.1.5/libexec/lib/python3.4/site-packages/xonsh/execer.py", line 148, in _parse_ctx_free
    debug_level=self.debug_level)
  File "/usr/local/Cellar/xonsh/0.1.5/libexec/lib/python3.4/site-packages/xonsh/parser.py", line 258, in parse
    tree = self.parser.parse(input=s, lexer=self.lexer, debug=debug_level)
  File "/usr/local/Cellar/xonsh/0.1.5/libexec/vendor/lib/python3.4/site-packages/ply/yacc.py", line 331, in parse
    return self.parseopt_notrack(input, lexer, debug, tracking, tokenfunc)
  File "/usr/local/Cellar/xonsh/0.1.5/libexec/vendor/lib/python3.4/site-packages/ply/yacc.py", line 1181, in parseopt_notrack
    tok = call_errorfunc(self.errorfunc, errtoken, self)
  File "/usr/local/Cellar/xonsh/0.1.5/libexec/vendor/lib/python3.4/site-packages/ply/yacc.py", line 193, in call_errorfunc
    r = errorfunc(token)
  File "/usr/local/Cellar/xonsh/0.1.5/libexec/lib/python3.4/site-packages/xonsh/parser.py", line 2357, in p_error
    column=p.lexpos))
  File "/usr/local/Cellar/xonsh/0.1.5/libexec/lib/python3.4/site-packages/xonsh/parser.py", line 329, in _parse_error
    raise err
  File "<string>", line None
SyntaxError: <xonsh-code>:1:23: ('code: ""',)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/Cellar/xonsh/0.1.5/libexec/lib/python3.4/site-packages/xonsh/shell.py", line 152, in push
    locs=self.ctx)
  File "/usr/local/Cellar/xonsh/0.1.5/libexec/lib/python3.4/site-packages/xonsh/execer.py", line 92, in compile
    tree = self.parse(input, ctx, mode=mode)
  File "/usr/local/Cellar/xonsh/0.1.5/libexec/lib/python3.4/site-packages/xonsh/execer.py", line 70, in parse
    tree = self._parse_ctx_free(input, mode=mode)
  File "/usr/local/Cellar/xonsh/0.1.5/libexec/lib/python3.4/site-packages/xonsh/execer.py", line 161, in _parse_ctx_free
    raise original_error
  File "/usr/local/Cellar/xonsh/0.1.5/libexec/lib/python3.4/site-packages/xonsh/execer.py", line 148, in _parse_ctx_free
    debug_level=self.debug_level)
  File "/usr/local/Cellar/xonsh/0.1.5/libexec/lib/python3.4/site-packages/xonsh/parser.py", line 258, in parse
    tree = self.parser.parse(input=s, lexer=self.lexer, debug=debug_level)
  File "/usr/local/Cellar/xonsh/0.1.5/libexec/vendor/lib/python3.4/site-packages/ply/yacc.py", line 331, in parse
    return self.parseopt_notrack(input, lexer, debug, tracking, tokenfunc)
  File "/usr/local/Cellar/xonsh/0.1.5/libexec/vendor/lib/python3.4/site-packages/ply/yacc.py", line 1181, in parseopt_notrack
    tok = call_errorfunc(self.errorfunc, errtoken, self)
  File "/usr/local/Cellar/xonsh/0.1.5/libexec/vendor/lib/python3.4/site-packages/ply/yacc.py", line 193, in call_errorfunc
    r = errorfunc(token)
  File "/usr/local/Cellar/xonsh/0.1.5/libexec/lib/python3.4/site-packages/xonsh/parser.py", line 2357, in p_error
    column=p.lexpos))
  File "/usr/local/Cellar/xonsh/0.1.5/libexec/lib/python3.4/site-packages/xonsh/parser.py", line 329, in _parse_error
    raise err
  File "<string>", line None
SyntaxError: <xonsh-code>:1:21: ('code: ""',)
```

I'm not sure how many separate issues these are.



Discussion:
Thanks for reporting!  I think this is all one issue, and I think I know how to fix it.

In the meantime, it should work to do the following:

```
 git commit --amend --author "New Author Name <email@address.com>" 
```

(without the "equals" sign)

Gotcha, thanks!


Resolving patch:
diff --git a/xonsh/parser.py b/xonsh/parser.py
--- a/xonsh/parser.py
+++ b/xonsh/parser.py
@@ -2331,6 +2331,7 @@ def p_subproc_arg_part(self, p):
                             | TRUE
                             | FALSE
                             | NUMBER
+                            | STRING
         """
         # Many tokens cannot be part of this list, such as $, ', ", ()
         # Use a string atom instead.


Test patch: