* src/scan-gram.l (SC_PROLOGUE): Don't eat characters amongst

['"/] too eagerly.
* tests/input.at (Torturing the Scanner): New.
This commit is contained in:
Akim Demaille
2002-06-12 12:50:22 +00:00
parent 3420246357
commit 6c35d22c39
4 changed files with 287 additions and 258 deletions

View File

@@ -1,5 +1,5 @@
# Checking the output filenames. -*- Autotest -*-
# Copyright 2002 Free Software Foundation, Inc.
# Copyright (C) 2002 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -20,6 +20,31 @@ AT_BANNER([[Input Processing.]])
# Mostly test that we are robust to mistakes.
## ----------------------- ##
## Torturing the Scanner. ##
## ----------------------- ##
AT_SETUP([Torturing the Scanner])
AT_DATA([input.y],
[[%{
/* This is seen in GCC: a %{ and %} in middle of a comment. */
const char *foo = "So %{ and %} can be here.";
%}
/* %{ and %} can be here too. */
%%
exp: 'a';
]])
AT_CHECK([bison input.y])
AT_CLEANUP
## ------------ ##
## Invalid $n. ##
## ------------ ##