aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/KeyWords.h
diff options
context:
space:
mode:
authornyamatongwe <unknown>2001-01-23 00:08:29 +0000
committernyamatongwe <unknown>2001-01-23 00:08:29 +0000
commit82944ecd7b8558dc6b2c3b22f6a9bc21a0de483b (patch)
tree22700ecfd1ea77a9c3939f72ef0e9c4fed7914ab /include/KeyWords.h
parent347e47646b37986d18b0fbb6787fec71bb394483 (diff)
downloadscintilla-mirror-82944ecd7b8558dc6b2c3b22f6a9bc21a0de483b.tar.gz
New function isspacechar to avoid bugs when character >= 0x80.
Diffstat (limited to 'include/KeyWords.h')
-rw-r--r--include/KeyWords.h11
1 files changed, 8 insertions, 3 deletions
diff --git a/include/KeyWords.h b/include/KeyWords.h
index 3159dcc1b..95337c107 100644
--- a/include/KeyWords.h
+++ b/include/KeyWords.h
@@ -17,16 +17,21 @@ public:
int language, WordList *keywordlists[], Accessor &styler);
};
+// This is ASCII specific but is safe with chars >= 0x80
+inline bool isspacechar(unsigned char ch) {
+ return (ch == ' ') || ((ch >= 0x09) && (ch <= 0x0d));
+}
+
inline bool iswordchar(char ch) {
- return isalnum(ch) || ch == '.' || ch == '_';
+ return isascii(ch) && (isalnum(ch) || ch == '.' || ch == '_');
}
inline bool iswordstart(char ch) {
- return isalnum(ch) || ch == '_';
+ return isascii(ch) && (isalnum(ch) || ch == '_');
}
inline bool isoperator(char ch) {
- if (isalnum(ch))
+ if (isascii(ch) && isalnum(ch))
return false;
// '.' left out as it is used to make up numbers
if (ch == '%' || ch == '^' || ch == '&' || ch == '*' ||