Skip to content

Instantly share code, notes, and snippets.

@edgurgel
Created June 4, 2013 21:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save edgurgel/5709927 to your computer and use it in GitHub Desktop.
Save edgurgel/5709927 to your computer and use it in GitHub Desktop.
pygments for Elixir
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