diff --git a/lib/rouge/lexers/make.rb b/lib/rouge/lexers/make.rb index 7320632ecf..3b7338325c 100644 --- a/lib/rouge/lexers/make.rb +++ b/lib/rouge/lexers/make.rb @@ -40,6 +40,10 @@ def initialize(opts={}) groups Keyword, Text, Name::Variable end + rule %r/(else\b)([\t ]+)((?:ifn?def|ifn?eq)\b)([\t ]+)([^#\n]+)/ do + groups Keyword, Text, Keyword, Text, Name::Variable + end + rule %r/(?:else|endif|endef|endfor)[\t ]*(?=[#\n])/, Keyword rule %r/(export)([\t ]+)(?=[\w\${}()\t -]+\n)/ do diff --git a/spec/visual/samples/make b/spec/visual/samples/make index c6a0aef84f..4581a31ba2 100644 --- a/spec/visual/samples/make +++ b/spec/visual/samples/make @@ -92,6 +92,14 @@ else THING2 = default endif +ifeq ($(OS), Linux) +MES = "Hi, Linux" +else ifeq ($(OS), Darwin) +MES = "Hi, Mac" +else +MES = "Unknown" +endif + ifeq ($(TARGET),special) # syntax variant: parentheses and separating comma TARGET = something_else else