Fix runes parsing.
ClosedPublic

Authored by ematirov on Jun 13 2017, 4:59 PM.

Details

Summary

Do not parse ''' as valid rune.
Fix duplicates in runes test: '\'' is same as '''. Add '\\'' instead.

Test Plan

Tests pass.

Diff Detail

Repository
R59 KDevelop Go
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
ematirov created this revision.Jun 13 2017, 4:59 PM
Restricted Application added a subscriber: kdevelop-devel. · View Herald TranscriptJun 13 2017, 4:59 PM
brauch accepted this revision.Jun 13 2017, 5:53 PM

looks good

parser/test/parsertest.cpp
136

intentional?

This revision is now accepted and ready to land.Jun 13 2017, 5:53 PM
ematirov added inline comments.Jun 13 2017, 6:13 PM
parser/test/parsertest.cpp
136

Yep, if token could not be parsed it ends up with "Token_TEST" as far as I understood. So, there is verification that ''' is not parsed (because it's not valid go code)

apol added inline comments.Jun 13 2017, 11:01 PM
parser/test/parsertest.cpp
124–125

Shouldn't the TODO be fixed then?

128

Maybe as part of another iteration, but this should better be: QCOMPARE( lexer.read().kind, TokenTypeWrapper::Token_RUNE);

ematirov updated this revision to Diff 15447.Jun 14 2017, 12:18 PM

Remove unneeded comment.

ematirov added inline comments.Jun 14 2017, 12:20 PM
parser/test/parsertest.cpp
128

Good idea. I will fix that in another RR since there are a lot of such QVERIFY misuses in that file (not related to this test\change)

This revision was automatically updated to reflect the committed changes.