From 3a83d69ee744216bc72c1b67ad752a9640bb3605 Mon Sep 17 00:00:00 2001 From: Warwick Allison Date: Mon, 12 Oct 2009 17:13:09 +1000 Subject: Allow Unicode identifiers. --- src/declarative/qml/parser/qmljslexer.cpp | 11 ++++++++--- 1 file 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) -- cgit v0.12