]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
fix comment and brace handling
authorBVK Chaitanya <bvk.groups@gmail.com>
Fri, 30 Apr 2010 08:20:41 +0000 (13:50 +0530)
committerBVK Chaitanya <bvk.groups@gmail.com>
Fri, 30 Apr 2010 08:20:41 +0000 (13:50 +0530)
conf/tests.rmk
script/yylex.l
tests/grub_script_comments.in [new file with mode: 0644]

index d48bc3dd9fc3bffd5bd1e18eb187732cc48fa56a..9af2f8f866716539fb25f5bc76ec888a81a67db4 100644 (file)
@@ -68,6 +68,9 @@ grub_script_final_semicolon_SOURCES = tests/grub_script_final_semicolon.in
 check_SCRIPTS += grub_script_dollar
 grub_script_dollar_SOURCES = tests/grub_script_dollar.in
 
+check_SCRIPTS += grub_script_comments
+grub_script_comments_SOURCES = tests/grub_script_comments.in
+
 # List of tests to execute on "make check"
 # SCRIPTED_TESTS    = example_scripted_test
 # SCRIPTED_TESTS   += example_grub_script_test
@@ -83,6 +86,7 @@ SCRIPTED_TESTS += grub_script_if
 SCRIPTED_TESTS += grub_script_blanklines
 SCRIPTED_TESTS += grub_script_final_semicolon
 SCRIPTED_TESTS += grub_script_dollar
+SCRIPTED_TESTS += grub_script_comments
 
 # dependencies between tests and testing-tools
 $(SCRIPTED_TESTS): grub-shell grub-shell-tester
index 29aa5c2e3a73fd56486acb12d23ecbe9fb990a55..7d4ea9e4e3027683a716c003cff42393b841b1f4 100644 (file)
@@ -112,9 +112,9 @@ typedef size_t yy_size_t;
 %option extra-type="struct grub_parser_param*"
 
 BLANK           [ \t]
-COMMENT         ^[ \t]*#.*$
+COMMENT         #.*$
 
-CHAR            [^|&$;<> \t\n\'\"\\]
+CHAR            [^{}|&$;<> \t\n\'\"\\]
 DIGITS          [[:digit:]]+
 NAME            [[:alpha:]_][[:alnum:][:digit:]_]*
 
diff --git a/tests/grub_script_comments.in b/tests/grub_script_comments.in
new file mode 100644 (file)
index 0000000..7b34107
--- /dev/null
@@ -0,0 +1,19 @@
+#! @builddir@/grub-shell-tester
+#
+# Copyright (C) 2010  Free Software Foundation, Inc.
+#
+# GRUB is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# GRUB is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GRUB.  If not, see <http://www.gnu.org/licenses/>.
+
+echo a###b
+echo a# #b