From 5df49ec5e36f15bc5eb970316eeaa7b1cebda9a5 Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Sat, 31 May 2014 22:26:44 -0400 Subject: [PATCH] Parser - ::findAttributeModifier now tolerates missing values and generates the correct expression term. --- src/Parser.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/Parser.cpp b/src/Parser.cpp index 9eae2e256..2c0e99767 100644 --- a/src/Parser.cpp +++ b/src/Parser.cpp @@ -814,6 +814,9 @@ void Parser::findAttribute () n.getUntilEOS (value) || n.depleted ()) { + if (value == "") + value = "''"; + std::string canonical; if (canonicalize (canonical, "uda", name)) { @@ -858,10 +861,7 @@ void Parser::findAttribute () branch->attribute ("raw", "=="); branch = (*i)->addBranch (new Tree ("argAtt")); - if (value != "") - branch->attribute ("raw", value); - else - branch->attribute ("raw", "'" + value + "'"); + branch->attribute ("raw", value); } } } @@ -909,8 +909,12 @@ void Parser::findAttributeModifier () std::string value; if (n.getQuoted ('"', value) || n.getQuoted ('\'', value) || - n.getUntilEOS (value)) + n.getUntilEOS (value) || + n.depleted ()) { + if (value == "") + value = "''"; + (*i)->unTag ("?"); (*i)->tag ("ATTMOD"); (*i)->attribute ("name", canonical);