This is an archive of the discontinued LLVM Phabricator instance.

[emacs] fix parens, font-lock i* in llvm-mode
ClosedPublic

Authored by artagnon on Jan 17 2015, 12:36 PM.

Details

Summary

In llvm-mode, typing a literal '[' would print out '[[', and '(' would
print a '(('. This was a very annoying bug caused by overzealous
syntax-table entries: the parens are already part of the '(' and ')'
class by default. Fix this.

While at it, notice that i32, i64, i1 etc. are not font-locked despite a
clear intent to do so. The issue is that regexp-opt doesn't accept
regular expressions. So, spell out the common literal integers with
different widths.

Diff Detail

Repository
rL LLVM

Event Timeline

artagnon updated this revision to Diff 18347.Jan 17 2015, 12:36 PM
artagnon retitled this revision from to [emacs] fix parens, font-lock i* in llvm-mode.
artagnon updated this object.
artagnon edited the test plan for this revision. (Show Details)
artagnon added a reviewer: rafael.
artagnon added a subscriber: Unknown Object (MLST).
rafael edited edge metadata.Jan 23 2015, 6:27 AM

I can reproduce that i32 is not colored correctly.

I cannot reproduce the (( or [[ issue. What do I have to do for email to print out a (( instead of a (?

I cannot reproduce the (( or [[ issue. What do I have to do for email to print out a (( instead of a (?

Oh, I should have mentioned in the original commit message: you have to turn on electric-pair-mode. It's supposed to insert ) when you type (, but in llvm-mode, it inserts a duplicate ( due to the mangled syntax table.

rafael accepted this revision.Jan 23 2015, 11:05 AM
rafael edited edge metadata.

LGTM

This revision is now accepted and ready to land.Jan 23 2015, 11:05 AM
This revision was automatically updated to reflect the committed changes.