summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWarwick Allison <warwick.allison@nokia.com>2009-10-12 07:13:09 (GMT)
committerWarwick Allison <warwick.allison@nokia.com>2009-10-12 07:13:09 (GMT)
commit3a83d69ee744216bc72c1b67ad752a9640bb3605 (patch)
treea92c219213223add13d4955fd9de066e187323ef
parenta6b0e516f6206133647317c3c54d9bfc8c040162 (diff)
downloadQt-3a83d69ee744216bc72c1b67ad752a9640bb3605.zip
Qt-3a83d69ee744216bc72c1b67ad752a9640bb3605.tar.gz
Qt-3a83d69ee744216bc72c1b67ad752a9640bb3605.tar.bz2
Allow Unicode identifiers.
-rw-r--r--src/declarative/qml/parser/qmljslexer.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/declarative/qml/parser/qmljslexer.cpp b/src/declarative/qml/parser/qmljslexer.cpp
index f71b92f..54f8d78 100644
--- a/src/declarative/qml/parser/qmljslexer.cpp
+++ b/src/declarative/qml/parser/qmljslexer.cpp
@@ -867,11 +867,16 @@ bool Lexer::isLineTerminator() const
bool Lexer::isIdentLetter(ushort c)
{
- /* TODO: allow other legitimate unicode chars */
- return ((c >= 'a' && c <= 'z')
+ // ASCII-biased, since all reserved words are ASCII, aand hence the
+ // bulk of content to be parsed.
+ if ((c >= 'a' && c <= 'z')
|| (c >= 'A' && c <= 'Z')
|| c == '$'
- || c == '_');
+ || c == '_')
+ return true;
+ if (c < 128)
+ return false;
+ return QChar(c).isLetterOrNumber();
}
bool Lexer::isDecimalDigit(ushort c)