diff --git a/parser/go.g b/parser/go.g --- a/parser/go.g +++ b/parser/go.g @@ -212,8 +212,7 @@ ("\\u"[0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F]) | ("\\U"[0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F] [0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F]) | - -- ("\\a")|("\\b")|("\\f")|("\\n")|("\\r")|("\\t")|("\\v")|("\\\\")|("\\\'")|("\\\"") | ({alphabetic} | {num} | [.^\'] ) -> unicode_value; - ("\\a")|("\\b")|("\\f")|("\\n")|("\\r")|("\\t")|("\\v")|("\\\\")|("\\\'")|("\\\"") | ({alphabetic} | {num} | . ) -> unicode_value; + ("\\a")|("\\b")|("\\f")|("\\n")|("\\r")|("\\t")|("\\v")|("\\\\")|("\\\'")|("\\\"") | ({alphabetic} | {num} | [.^\'] ) -> unicode_value; --because of problems with utf-8 add this rule for now --disregard that, utf8 works fine diff --git a/parser/test/parsertest.cpp b/parser/test/parsertest.cpp --- a/parser/test/parsertest.cpp +++ b/parser/test/parsertest.cpp @@ -122,8 +122,7 @@ void ParserTest::testRunes() { - //@TODO stuff like ''' shouldn't actually be accepted, try fixing rune lexer rule in go.g - QByteArray code = "'\\' '\"' '~' '_' '0' 'a' '\'' 'щ' ''' "; + QByteArray code = "'\\' '\"' '~' '_' '0' 'a' '\\'' 'щ' ''' "; KDevPG::QByteArrayIterator iter(code); Lexer lexer(iter); QVERIFY( lexer.read().kind == TokenTypeWrapper::Token_RUNE); @@ -134,7 +133,7 @@ QVERIFY( lexer.read().kind == TokenTypeWrapper::Token_RUNE); QVERIFY( lexer.read().kind == TokenTypeWrapper::Token_RUNE); QVERIFY( lexer.read().kind == TokenTypeWrapper::Token_RUNE); - QVERIFY( lexer.read().kind == TokenTypeWrapper::Token_RUNE); + QVERIFY( lexer.read().kind == TokenTypeWrapper::Token_TEST); }