This is an archive of the discontinued LLVM Phabricator instance.

clang-format: Change location of stashed token
ClosedPublic

Authored by jpienaar on Feb 24 2015, 2:57 PM.

Details

Reviewers
kcc
djasper
Summary

LessLess and GreaterGreater are turned into two tokens via the stashed token approach. The location of the stashed token (the second Less or Greater) was assumed to be one past the first Less or Greater. This does not hold in cases such as
printf "\\\\\x0a<<<" | clang-format
Where LessLess is considered a token of length 4 and the second Less (post splitting) starts at an offset of 3 and not 1 from the first one. This results in an error when attempting to insert a space between the first and second Less.

Diff Detail

Event Timeline

jpienaar updated this revision to Diff 20630.Feb 24 2015, 2:57 PM
jpienaar retitled this revision from to clang-format: Change location of stashed token.
jpienaar updated this object.
jpienaar edited the test plan for this revision. (Show Details)
jpienaar added reviewers: djasper, kcc.
jpienaar added a subscriber: Unknown Object (MLST).
djasper accepted this revision.Feb 24 2015, 3:20 PM
djasper edited edge metadata.

Looks good. Thanks.

This revision is now accepted and ready to land.Feb 24 2015, 3:20 PM
djasper closed this revision.Apr 12 2015, 1:19 AM