geronimo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jason Dillon (JIRA)" <>
Subject [jira] Commented: (GSHELL-20) `set foo="bar"` does not work as expected
Date Wed, 28 Nov 2007 09:37:43 GMT


Jason Dillon commented on GSHELL-20:

I basically just tossed together this grammar with my somewhat limited knowledge and experience
with JavaCC.  I'd really like to be able to lean on the parser to generate a more complex
AST tree which can handle more of these language subtitles , but that is pushing the limit
of hoops I can personally make JavaCC (or another like Antlr) jump through.

Would really be nice if the universe handed us a motivated folk (or two) who where uber-savvy
with JavaCC (or Antlr3) to build more complicated AST trees... 

Anyways, I know this part of the system is lacking, which is why I had hacked around it before,
like using Jexl to handle the ${...} bits and some more specific post processing (like what
is done in {{set}}) to handle (somewhat poorly) what the feeble parser isn't doing for us.

This is definitely one of the weak parts of the system right now.  I really would like to
get a parser which can take most any BASH-like syntax and make sense of it.  That is the ultimate
goal IMO... complete BASH syntax compatibility (or really, ZSH since I think its got some
extra nice bits).

I will test this patch in the next day or so... though you know its just a bandaid na?  What
really needs to be done is to make the parser aware of this stuff, then maybe create a visitor
to build a simple version of the tree elements suitable for handing to the executing visitor.
 The intermediate could handle things like:

echo "foo""bar"

and reduce that to simple this to pass to commands for execution:

echo "foobar"

Or something like that.

Maybe I can coax one of the Antlr gurus on the Groovy team to lean a hand with this.  But
if you, or anyone else who reads JIRA comments, knows of someone and they are interested,
I'd really love to haver some expert help with this part of GShell.

> `set foo="bar"` does not work as expected
> -----------------------------------------
>                 Key: GSHELL-20
>                 URL:
>             Project: GShell
>          Issue Type: Bug
>      Security Level: public(Regular issues) 
>          Components: Commands, Core
>    Affects Versions: 0.0.1
>            Reporter: Jason Dillon
>            Assignee: Jason Warner
>            Priority: Critical
>             Fix For: 1.0-alpha-2
>         Attachments: GShell-20.patch
> Due to the way parsing happens, this line:
> {noformat}
> set foo="bar"
> {noformat}
> Ends up calling the command with 2 arguments: "foo=" and "bar", which is not what the
command expects, which is one argument of: "foo=bar"

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message