felix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Derek Baum (JIRA)" <j...@apache.org>
Subject [jira] Resolved: (FELIX-1487) Support for commands on multiple lines
Date Thu, 06 May 2010 00:02:02 GMT

     [ https://issues.apache.org/jira/browse/FELIX-1487?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel

Derek Baum resolved FELIX-1487.

    Resolution: Fixed

I have refactored the Parser to split-out a separate Tokenizer to help fix this and other

The Parser now allows NEWLINE as a statement separator instead of semi-colon, which makes
it much easier to create scripts.

The Parser also tracks the exact location (line and column) when an error occurs, which is
useful when an error occurs in a script file.

The new Parser passes all the existing tests, except

assertEquals("a", c.execute("a = a; echo $(echo a)"));

because variable expansion does not allow command execution: $(echo a)

This can obviously be fixed if needed, but this expansion didn't seem to be the purpose of
the test anyway.

Also indirect variable expansion, now needs to be enclosed in ${} - so ${$a} and not $$a.

It also passes some new tests that I've created in TestParser2.

> Support for commands on multiple lines
> --------------------------------------
>                 Key: FELIX-1487
>                 URL: https://issues.apache.org/jira/browse/FELIX-1487
>             Project: Felix
>          Issue Type: Improvement
>          Components: Gogo
>            Reporter: Guillaume Nodet
>            Assignee: Derek Baum
>             Fix For: gogo-0.4.0
> I think this is important, especially when writing closures, to be able to split commands
on multiple lines.
> From the shell, it can't be easily leveraged, unless the command line edition also supports
multiline edition, but for script files, it would be really handy.
> My original thinking would be to consider new lines as ';', but this may required changing
the precedence order of | and ;
> The other solution would be add a pseudo grouping operator () on each line in addition
to considering newlines as ';'

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

View raw message