diff --git a/ChangeLog b/ChangeLog index 4c8f2b2f8..572fade35 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2010-05-01 BVK Chaitanya + + Fix comment handling. + + * tests/grub_script_comments.in: New testcase. + * conf/tests.rmk: Rules for new testcase. + * script/yylex.l: Updated flex rules. + 2010-04-28 Samuel Thibault * docs/grub.texi (play): Document that zero pitches produce rests. diff --git a/conf/tests.rmk b/conf/tests.rmk index d48bc3dd9..9af2f8f86 100644 --- a/conf/tests.rmk +++ b/conf/tests.rmk @@ -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 diff --git a/script/yylex.l b/script/yylex.l index 29aa5c2e3..7d4ea9e4e 100644 --- a/script/yylex.l +++ b/script/yylex.l @@ -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 index 000000000..f212cc1e1 --- /dev/null +++ b/tests/grub_script_comments.in @@ -0,0 +1,28 @@ +#! @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 . + +echo a###b +echo a# #b + +echo # +echo \# + +echo '#' +echo "#" + +echo '\#' +echo "\#"