Created
June 4, 2013 21:51
-
-
Save edgurgel/5709927 to your computer and use it in GitHub Desktop.
pygments for Elixir
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for lbrace, rbrace, name, in ('\\{', '\\}', 'cb'), \ | |
('\\[', '\\]', 'sb'), \ | |
('\\(', '\\)', 'pa'), \ | |
('\\<', '\\>', 'lt'): | |
states['strings'] += [ | |
(r'%[a-z]' + lbrace + r'(?<!\w)\?(\\(x\d{1,2}|\h{1,2}(?!\h)\b|0[0-7]{0,2}(?![0-7])\b|' | |
r'[^x0MC])|(\\[MC]-)+\w|[^\s\\])', | |
String.Double, name + 'intp'), | |
(r'%[A-Z]' + lbrace, String.Double, name + 'no-intp') | |
] | |
states[name +'intp'] = [ | |
(r'' + rbrace + '[a-z]*', String.Double, "#pop"), | |
include('enddoublestr') | |
] | |
states[name +'no-intp'] = [ | |
(r'.*' + rbrace + '[a-z]*', String.Double , "#pop") | |
] | |
return states |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment