fix comment and brace handling

This commit is contained in:
BVK Chaitanya 2010-04-30 13:50:41 +05:30
parent c76a18386f
commit 6fdda85ae6
3 changed files with 25 additions and 2 deletions

View file

@ -68,6 +68,9 @@ grub_script_final_semicolon_SOURCES = tests/grub_script_final_semicolon.in
check_SCRIPTS += grub_script_dollar check_SCRIPTS += grub_script_dollar
grub_script_dollar_SOURCES = tests/grub_script_dollar.in 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" # List of tests to execute on "make check"
# SCRIPTED_TESTS = example_scripted_test # SCRIPTED_TESTS = example_scripted_test
# SCRIPTED_TESTS += example_grub_script_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_blanklines
SCRIPTED_TESTS += grub_script_final_semicolon SCRIPTED_TESTS += grub_script_final_semicolon
SCRIPTED_TESTS += grub_script_dollar SCRIPTED_TESTS += grub_script_dollar
SCRIPTED_TESTS += grub_script_comments
# dependencies between tests and testing-tools # dependencies between tests and testing-tools
$(SCRIPTED_TESTS): grub-shell grub-shell-tester $(SCRIPTED_TESTS): grub-shell grub-shell-tester

View file

@ -112,9 +112,9 @@ typedef size_t yy_size_t;
%option extra-type="struct grub_parser_param*" %option extra-type="struct grub_parser_param*"
BLANK [ \t] BLANK [ \t]
COMMENT ^[ \t]*#.*$ COMMENT #.*$
CHAR [^|&$;<> \t\n\'\"\\] CHAR [^{}|&$;<> \t\n\'\"\\]
DIGITS [[:digit:]]+ DIGITS [[:digit:]]+
NAME [[:alpha:]_][[:alnum:][:digit:]_]* NAME [[:alpha:]_][[:alnum:][:digit:]_]*

View file

@ -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