18:dbcc3b784234 | 19:66993500719f |
---|---|
43 #include "string.h" | 43 #include "string.h" |
44 #include "str.h" | 44 #include "str.h" |
45 #include "common.h" | 45 #include "common.h" |
46 #include "scriptreader.h" | 46 #include "scriptreader.h" |
47 | 47 |
48 bool IsDelimeter (char c) { | 48 static bool IsWhitespace (char c) { |
49 // These characters are invisible, thus considered whitespace | 49 // These characters are invisible, thus considered whitespace |
50 if (c <= 32 || c == 127 || c == 255) | 50 if (c <= 32 || c == 127 || c == 255) |
51 return true; | 51 return true; |
52 | 52 |
53 return false; | 53 return false; |
109 else | 109 else |
110 tmp += c; | 110 tmp += c; |
111 break; | 111 break; |
112 } | 112 } |
113 | 113 |
114 if (IsDelimeter (c)) { | 114 if (IsWhitespace (c)) { |
115 // Don't break if we haven't gathered anything yet. | 115 // Don't break if we haven't gathered anything yet. |
116 if (tmp.len()) | 116 if (tmp.len()) |
117 break; | 117 break; |
118 } else { | 118 } else { |
119 tmp += c; | 119 tmp += c; |
120 } | 120 } |
121 } | 121 } |
122 | 122 |
123 // If we got nothing here, read failed. | 123 // If we got nothing here, read failed. This should |
124 // only hapen in the case of EOF. | |
124 if (!tmp.len()) { | 125 if (!tmp.len()) { |
125 token = ""; | 126 token = ""; |
126 return false; | 127 return false; |
127 } | 128 } |
128 | 129 |