Commit 58d06f52 authored by Erik Verbruggen's avatar Erik Verbruggen
Browse files

Manually reverted parts of d61eb9c8.

parent 9de8f384
......@@ -32,88 +32,27 @@
using namespace CPlusPlus;
static inline int classify2(const char *s) {
if (s[0] == 'N') {
if (s[1] == 'O') {
return Token_NO;
}
}
else if (s[0] == 'i') {
if (s[1] == 'd') {
return Token_id;
}
else if (s[1] == 'n') {
return Token_in;
}
if (s[0] == 'i') {
if (s[1] == 'n') {
return Token_in;
}
return Token_identifier;
}
return Token_identifier;
}
static inline int classify3(const char *s) {
if (s[0] == 'I') {
if (s[1] == 'M') {
if (s[2] == 'P') {
return Token_IMP;
}
}
}
else if (s[0] == 'N') {
if (s[1] == 'i') {
if (s[2] == 'l') {
return Token_Nil;
}
}
}
else if (s[0] == 'S') {
if (s[1] == 'E') {
if (s[2] == 'L') {
return Token_SEL;
}
}
}
else if (s[0] == 'Y') {
if (s[1] == 'E') {
if (s[2] == 'S') {
return Token_YES;
}
}
}
else if (s[0] == 'n') {
if (s[1] == 'i') {
if (s[2] == 'l') {
return Token_nil;
}
}
}
else if (s[0] == 'o') {
if (s[1] == 'u') {
if (s[2] == 't') {
return Token_out;
}
}
if (s[0] == 'o') {
if (s[1] == 'u') {
if (s[2] == 't') {
return Token_out;
}
}
return Token_identifier;
}
return Token_identifier;
}
static inline int classify4(const char *s) {
if (s[0] == '_') {
if (s[1] == 'c') {
if (s[2] == 'm') {
if (s[3] == 'd') {
return Token__cmd;
}
}
}
}
else if (s[0] == 'B') {
if (s[1] == 'O') {
if (s[2] == 'O') {
if (s[3] == 'L') {
return Token_BOOL;
}
}
}
}
else if (s[0] == 'c') {
if (s[0] == 'c') {
if (s[1] == 'o') {
if (s[2] == 'p') {
if (s[3] == 'y') {
......@@ -122,15 +61,6 @@ static inline int classify4(const char *s) {
}
}
}
else if (s[0] == 's') {
if (s[1] == 'e') {
if (s[2] == 'l') {
if (s[3] == 'f') {
return Token_self;
}
}
}
}
return Token_identifier;
}
......@@ -157,17 +87,6 @@ static inline int classify5(const char *s) {
}
}
}
else if (s[0] == 's') {
if (s[1] == 'u') {
if (s[2] == 'p') {
if (s[3] == 'e') {
if (s[4] == 'r') {
return Token_super;
}
}
}
}
}
return Token_identifier;
}
......
......@@ -35,22 +35,11 @@
namespace CPlusPlus {
enum {
Token_NO,
Token_id,
Token_in,
Token_YES,
Token_IMP,
Token_Nil,
Token_SEL,
Token_nil,
Token_out,
Token__cmd,
Token_BOOL,
Token_copy,
Token_self,
Token_byref,
Token_inout,
Token_super,
Token_assign,
Token_bycopy,
Token_getter,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment