summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
6e14e14)
Putting an if-statement on one line should be possible:
if true; then echo "true"; else echo "false"; fi
To do this, we'll need to allow both EOLs and TOKEN_DELIM after then and
else.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
-conditional: statement TOKEN_EOL "then" TOKEN_EOL statements {
+sep: TOKEN_DELIM | TOKEN_EOL;
+
+conditional: statement TOKEN_EOL "then" sep statements {
$$ = create_statement_conditional(parser, $1, $5);
}
$$ = create_statement_conditional(parser, $1, $5);
}
}
| "if" TOKEN_DELIM conditional
elifs
}
| "if" TOKEN_DELIM conditional
elifs
statements
"fi" {
$$ = create_statement_if(parser, $3, $4, $7);
statements
"fi" {
$$ = create_statement_if(parser, $3, $4, $7);