mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-07-07 20:06:36 +02:00
Lexer: Migrated ispunct to Lexer::isPunctuation
This commit is contained in:
parent
3cbb2bb20f
commit
39fb45447b
6 changed files with 11 additions and 40 deletions
|
@ -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 ()
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue