1 |
commit: e435f385e1c71e172b46f2860d37339fbac06506 |
2 |
Author: Mu Qiao <qiaomuf <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sun Apr 10 03:15:02 2011 +0000 |
4 |
Commit: Petteri Räty <betelgeuse <AT> gentoo <DOT> org> |
5 |
CommitDate: Mon Apr 11 01:39:01 2011 +0000 |
6 |
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/libbash.git;a=commit;h=e435f385 |
7 |
|
8 |
Fix EOL handling in functions wrt bug #362715 |
9 |
|
10 |
--- |
11 |
bashast/bashast.g | 2 +- |
12 |
bashast/gunit/function.gunit | 3 +++ |
13 |
2 files changed, 4 insertions(+), 1 deletions(-) |
14 |
|
15 |
diff --git a/bashast/bashast.g b/bashast/bashast.g |
16 |
index 8aebc93..2418a81 100644 |
17 |
--- a/bashast/bashast.g |
18 |
+++ b/bashast/bashast.g |
19 |
@@ -327,7 +327,7 @@ cond_part: brace_expansion |
20 |
| fname |
21 |
| arithmetic; |
22 |
//Rules for whitespace/line endings |
23 |
-wspace : BLANK+|EOL; |
24 |
+wspace : BLANK+|EOL+; |
25 |
semiel : (SEMIC|EOL) BLANK*; |
26 |
|
27 |
//definition of word. this is just going to grow... |
28 |
|
29 |
diff --git a/bashast/gunit/function.gunit b/bashast/gunit/function.gunit |
30 |
index a861eab..157c0a6 100644 |
31 |
--- a/bashast/gunit/function.gunit |
32 |
+++ b/bashast/gunit/function.gunit |
33 |
@@ -31,5 +31,8 @@ function: |
34 |
"foo() { :; }" -> (function foo (CURRSHELL (LIST (COMMAND (STRING :))))) |
35 |
|
36 |
"function quit { exit; } > /dev/null" -> (function quit (CURRSHELL (LIST (COMMAND (STRING exit)))) (REDIR > (STRING / dev / null))) |
37 |
+"function quit { |
38 |
+ # comment |
39 |
+ exit; } > /dev/null" -> (function quit (CURRSHELL (LIST (COMMAND (STRING exit)))) (REDIR > (STRING / dev / null))) |
40 |
"function help { echo hi; } 2> /dev/null" -> (function help (CURRSHELL (LIST (COMMAND (STRING echo) (STRING hi)))) (REDIR 2 > (STRING / dev / null))) |
41 |
"function help { echo 3; } 2> /dev/null > output" OK |