From 1c43114a71e03a6099c79dcd16f1fc083c2402b8 Mon Sep 17 00:00:00 2001 From: cn Date: Tue, 18 Apr 2017 21:18:38 +0200 Subject: [PATCH] Add draft Makefile highlighter --- ftyperc | 10 +++---- makefile.jsf | 81 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 86 insertions(+), 5 deletions(-) create mode 100644 makefile.jsf diff --git a/ftyperc b/ftyperc index 4a7f284..74ea491 100644 --- a/ftyperc +++ b/ftyperc @@ -689,27 +689,27 @@ Makefile *Makefile -autoindent --syntax conf +-syntax makefile -pound_comment *makefile -autoindent --syntax conf +-syntax makefile -pound_comment *Makefile.in -autoindent --syntax conf +-syntax makefile -pound_comment *makefile.in -autoindent --syntax conf +-syntax makefile -pound_comment *MAKEFILE -autoindent --syntax conf +-syntax makefile -pound_comment Pascal diff --git a/makefile.jsf b/makefile.jsf new file mode 100644 index 0000000..0ffdb96 --- /dev/null +++ b/makefile.jsf @@ -0,0 +1,81 @@ +# JOE syntax highlight file for Makefile + +=Idle +=Comment green +=CommentLabel bold green +=Constant cyan +=Escape bold cyan +=Bad bold red + +=BadSpace inverse red +=Variable blue +=Target fg_310 # brown +=TargetRest + +:line_start Idle + * idle noeat + " " bad_space recolor=-1 + "#" line_comment recolor=-1 + "a-zA-Z_" maybe_var_or_target mark + +:idle Idle + * idle + "$" maybe_substitute + "\n" line_start + +:maybe_substitute Idle + * idle noeat + "(" substitute recolor=-2 + +:substitute Constant + * substitute + ")" idle + +:bad_space BadSpace + * line_start noeat + +:line_comment Comment + * line_comment + # might be TODO label + "BFHNTX" comment noeat call=.comment_todo() + "\n" line_start + +:maybe_var_or_target Idle + * idle noeat + "a-zA-Z_-" maybe_var_or_target + "=" variable recolormark + ":" target noeat recolormark + +:variable Variable + * idle noeat + +:target Target + * target_rest + +:target_rest TargetRest + * target_rest + "\n" line_start + +.subr comment_todo +# initial state +:comment_todo_init Comment + * comment_todo_guess buffer + +# highlight common TODO labels +:comment_todo_guess Comment + * comment_todo_unknown noeat strings + "BUG" comment_todo + "FIXME" comment_todo + "HACK" comment_todo + "NOTE" comment_todo + "TODO" comment_todo + "XXX" comment_todo +done + "A-Z" comment_todo_guess + +:comment_todo_unknown Comment + * NULL noeat return + +:comment_todo CommentLabel + * NULL noeat return +.end