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 04d1e39dd3
commit 44bb908485
3 changed files with 30 additions and 5 deletions

View File

@@ -600,9 +600,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])