This is an archive of the discontinued LLVM Phabricator instance.

Support ANSI escape sequences in the Lexer
AbandonedPublic

Authored by rsmith on Apr 1 2014, 5:00 PM.

Details

Reviewers
None
Summary

Add support for ANSI escape sequences in the Lexer. In most cases, this merely provides a superior error recovery experience (we diagnose and skip over them, as we do with Unicode whitespace), but for ANSI color codes, normalize them and include them in identifiers, as suggested on slides 52 and 53 of this presentation by Bjarne Stroustrup:

https://parasol.tamu.edu/people/bs/622-GP/C++11TAMU.pdf

Diff Detail

Event Timeline

Any chance of test cases?

Does this produce any ambiguities in the grammar? Or is it strictly turning invalid cases into valid ones?

rsmith abandoned this revision.May 30 2014, 12:56 PM

This needs more thought and I don't have time right now. Maybe in 10 months or so...