Lexer: Migrated ispunct to Lexer::isPunctuation

This commit is contained in:
Paul Beckingham 2015-04-16 23:52:43 -04:00
parent 3cbb2bb20f
commit 39fb45447b
6 changed files with 11 additions and 40 deletions

View file

@ -27,7 +27,6 @@
#include <cmake.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <time.h>
#include <inttypes.h>
#include <Lexer.h>
@ -1036,9 +1035,9 @@ bool Nibbler::getWord (std::string& result)
if (i < _length)
{
while (!Lexer::isDigit (_input[i]) &&
!isPunctuation (_input[i]) &&
!Lexer::isWhitespace (_input[i]))
while (!Lexer::isDigit (_input[i]) &&
!Lexer::isPunctuation (_input[i]) &&
!Lexer::isWhitespace (_input[i]))
{
++i;
}
@ -1228,21 +1227,6 @@ bool Nibbler::depleted ()
return false;
}
////////////////////////////////////////////////////////////////////////////////
// Override of ispunct, that considers #, $, _ and @ not to be punctuation.
//
// ispunct: ! " # $ % & ' ( ) * + , - . / : ; < = > ? @ [ \ ] ^ _ ` { | } ~
// Punctuation: ! " % & ' ( ) * + , - . / : ; < = > ? [ \ ] ^ _ ` { | } ~
// delta: # $ @
//
bool Nibbler::isPunctuation (char c)
{
if (c == '@' || c == '#' || c == '$' || c == '_')
return false;
return ispunct (c);
}
////////////////////////////////////////////////////////////////////////////////
std::string Nibbler::dump ()
{