TW-28, TW-271, TW-277, TW-752, TW-1265

- TW-1265 cannot add UDA with underscore (thanks to Jakub Wilk).
- Added unit tests for TW-1265.
- Added ChangeLog and AUTHOR entries for other fixed issues.
This commit is contained in:
Paul Beckingham 2014-05-31 11:11:53 -04:00
parent 4694cfe0fe
commit 6514bdfc4d
4 changed files with 28 additions and 18 deletions

View file

@ -1036,7 +1036,7 @@ bool Nibbler::getName (std::string& result)
{
++i;
while (i < _length &&
! ispunct (_input[i]) &&
(_input[i] == '_' || ! ispunct (_input[i])) &&
! Lexer::is_ws (_input[i]))
{
++i;
@ -1255,7 +1255,7 @@ bool Nibbler::depleted ()
}
////////////////////////////////////////////////////////////////////////////////
// Override of ispunct, that considers #, $ and @ not to be punctuation.
// Override of ispunct, that considers #, $, _ and @ not to be punctuation.
//
// ispunct: ! " # $ % & ' ( ) * + , - . / : ; < = > ? @ [ \ ] ^ _ ` { | } ~
// Punctuation: ! " % & ' ( ) * + , - . / : ; < = > ? [ \ ] ^ _ ` { | } ~
@ -1263,7 +1263,7 @@ bool Nibbler::depleted ()
//
bool Nibbler::isPunctuation (char c)
{
if (c == '@' || c == '#' || c == '$')
if (c == '@' || c == '#' || c == '$' || c == '_')
return false;
return ispunct (c);