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..feda510271 100644 --- a/spec/visual/samples/make +++ b/spec/visual/samples/make @@ -152,3 +152,12 @@ export variable := value export variable += value export variable unexport variable + +# handle +ifeq ($(OS), Linux) + MES = "Hi, Linux" +else ifeq ($(OS), Darwin) + MES = "Hi, Mac" +else + MES = "Unknown" +endif