1 |
commit: bdf60a3a655fd1cb0234e9b14f8faedbfc5e0b4c |
2 |
Author: Petteri Räty <petsku <AT> petteriraty <DOT> eu> |
3 |
AuthorDate: Sat Apr 16 17:09:25 2011 +0000 |
4 |
Commit: Petteri Räty <betelgeuse <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun Apr 17 10:57:04 2011 +0000 |
6 |
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/libbash.git;a=commit;h=bdf60a3a |
7 |
|
8 |
Parser: support numbers in function names |
9 |
|
10 |
--- |
11 |
bashast/bashast.g | 2 +- |
12 |
bashast/gunit/function.gunit | 2 +- |
13 |
2 files changed, 2 insertions(+), 2 deletions(-) |
14 |
|
15 |
diff --git a/bashast/bashast.g b/bashast/bashast.g |
16 |
index db04b03..98ef58f 100644 |
17 |
--- a/bashast/bashast.g |
18 |
+++ b/bashast/bashast.g |
19 |
@@ -525,7 +525,7 @@ function: FUNCTION BLANK+ function_name (BLANK* parens)? wspace compound_command |
20 |
//http://article.gmane.org/gmane.comp.shells.bash.bugs/16424 |
21 |
//the documented set is stricter but we need to have at least what's used in Gentoo |
22 |
function_name |
23 |
- : (MINUS|name)+; |
24 |
+ : (MINUS|DIGIT|name)+; |
25 |
parens : LPAREN BLANK* RPAREN; |
26 |
name : NAME |
27 |
| LETTER |
28 |
|
29 |
diff --git a/bashast/gunit/function.gunit b/bashast/gunit/function.gunit |
30 |
index b233b0a..c22821a 100644 |
31 |
--- a/bashast/gunit/function.gunit |
32 |
+++ b/bashast/gunit/function.gunit |
33 |
@@ -36,4 +36,4 @@ function: |
34 |
exit; } > /dev/null" -> (function (STRING quit) (CURRENT_SHELL (LIST (COMMAND (STRING exit)))) (REDIR > (STRING / dev / null))) |
35 |
"function help { echo hi; } 2> /dev/null" -> (function (STRING help) (CURRENT_SHELL (LIST (COMMAND (STRING echo) (STRING hi)))) (REDIR 2 > (STRING / dev / null))) |
36 |
"function help { echo 3; } 2> /dev/null > output" OK |
37 |
-"foo-bar() { :; }" -> (function (STRING foo - bar) (CURRENT_SHELL (LIST (COMMAND (STRING :))))) |
38 |
+"xorg-2_reconf_source() { :; }" -> (function (STRING xorg - 2 _reconf_source) (CURRENT_SHELL (LIST (COMMAND (STRING :))))) |