xml: beware of user strings used to give a %prec to rules.

* tests/conflicts.at (%prec with user strings): New.
	* src/gram.c (grammar_rules_print_xml): Escape the precedence for
	XML output.
This commit is contained in:
Akim Demaille
2009-06-11 14:45:10 +02:00
parent 75c7a52a31
commit 517cb0ad9c
3 changed files with 30 additions and 5 deletions

View File

@@ -544,9 +544,26 @@ input.y: expected 0 reduce/reduce conflicts
AT_CLEANUP
## ------------------------------- ##
## %no-default-prec without %prec ##
## ------------------------------- ##
## ------------------------- ##
## %prec with user strings. ##
## ------------------------- ##
AT_SETUP([%prec with user string])
AT_DATA([[input.y]],
[[%%
exp:
"foo" %prec "foo"
;
]])
AT_BISON_CHECK([-o input.c input.y])
AT_CLEANUP
## -------------------------------- ##
## %no-default-prec without %prec. ##
## -------------------------------- ##
AT_SETUP([%no-default-prec without %prec])