Skip to content

Commit abde190

Browse files
committed
simplecpp.h: made Token::flags() private
1 parent 37fa4f4 commit abde190

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

simplecpp.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -135,14 +135,6 @@ namespace simplecpp {
135135
Token(const Token &tok) :
136136
macro(tok.macro), op(tok.op), comment(tok.comment), name(tok.name), number(tok.number), whitespaceahead(tok.whitespaceahead), location(tok.location), previous(nullptr), next(nullptr), nextcond(nullptr), string(tok.string), mExpandedFrom(tok.mExpandedFrom) {}
137137

138-
void flags() {
139-
name = (std::isalpha(static_cast<unsigned char>(string[0])) || string[0] == '_' || string[0] == '$')
140-
&& (std::memchr(string.c_str(), '\'', string.size()) == nullptr);
141-
comment = string.size() > 1U && string[0] == '/' && (string[1] == '/' || string[1] == '*');
142-
number = isNumberLike(string);
143-
op = (string.size() == 1U && !name && !comment && !number) ? string[0] : '\0';
144-
}
145-
146138
const TokenString& str() const {
147139
return string;
148140
}
@@ -197,6 +189,14 @@ namespace simplecpp {
197189
void printAll() const;
198190
void printOut() const;
199191
private:
192+
void flags() {
193+
name = (std::isalpha(static_cast<unsigned char>(string[0])) || string[0] == '_' || string[0] == '$')
194+
&& (std::memchr(string.c_str(), '\'', string.size()) == nullptr);
195+
comment = string.size() > 1U && string[0] == '/' && (string[1] == '/' || string[1] == '*');
196+
number = isNumberLike(string);
197+
op = (string.size() == 1U && !name && !comment && !number) ? string[0] : '\0';
198+
}
199+
200200
TokenString string;
201201

202202
std::set<const Macro*> mExpandedFrom;

0 commit comments

Comments
 (0)