summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Hodge <tpg@mutabah.net>2016-08-18 13:18:48 +0800
committerJohn Hodge <tpg@mutabah.net>2016-08-18 13:18:48 +0800
commit65aba167033019994e35f43b819d8fbd3620e9ff (patch)
tree56f18859b7667b837c12a4b51404749fdccae12b
parentc48d39448d06c1ac97838f4cf7f2ed7526adb2fb (diff)
downloadmrust-65aba167033019994e35f43b819d8fbd3620e9ff.tar.gz
Parse - Fix lexing bug with unicode whitespace
-rw-r--r--src/parse/lex.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/parse/lex.cpp b/src/parse/lex.cpp
index 62e25942..42e36574 100644
--- a/src/parse/lex.cpp
+++ b/src/parse/lex.cpp
@@ -232,7 +232,7 @@ bool issym(Codepoint ch)
if( ch == '_' )
return true;
if( ch.v >= 128 )
- return true;
+ return !ch.isspace();
return false;
}
@@ -1170,6 +1170,11 @@ bool Codepoint::isspace() const {
case '\r':
case '\n':
case ' ':
+ case 0xC: // ^L
+ case 0x85:
+ case 0x200E ... 0x200F: // LTR / RTL markers
+ case 0x2028: // Line Separator
+ case 0x2029: // Paragrah Separator
return true;
default:
return false;