From b36fa829099c9612c91b879c6b3484e417863868 Mon Sep 17 00:00:00 2001 From: cn Date: Sun, 30 Oct 2011 20:33:38 +0100 Subject: [PATCH] New highlighter for Erlang This is a first version featuring most of the important syntax elements as comments, keywords, atoms and variables etc. Btw fixed prolog parsed to behave like the erlang one when highlighting atoms and variables. --- erlang.jsf | 95 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ ftyperc | 5 +++ prolog.jsf | 4 +-- 3 files changed, 102 insertions(+), 2 deletions(-) create mode 100644 erlang.jsf diff --git a/erlang.jsf b/erlang.jsf new file mode 100644 index 0000000..ea4138b --- /dev/null +++ b/erlang.jsf @@ -0,0 +1,95 @@ +# JOE syntax highlight file for Erlang + +=Idle +=Comment green +=Constant cyan +=Escape bold cyan +=Keyword bold +=Bad bold red +=Brace magenta + +=Variable fg_310 +=Attribute magenta + +:idle Idle + * idle + "A-Z" variable noeat + "%" line_comment noeat + "\"" string recolor=-1 + "'" quoted_atom recolor=-1 + "0-9" decimal recolor=-1 + "{[]}" brace recolor=-1 + "-" maybe_attribute mark + "a-z" atom buffer + +:line_comment Comment + * line_comment + "\n" idle + +:variable Variable + * idle noeat + "a-zA-Z" variable + +:string Constant + * string + "\"" idle + +:decimal Constant + * idle noeat + "0-9" decimal + "." float + +:float Constant + * idle noeat + "0-9" float + +:brace Brace + * idle noeat + +:maybe_attribute Idle + * idle noeat + "a-z" maybe_attribute + "(" attribute recolormark + +:attribute Attribute + * idle noeat + +:atom Idle + * idle noeat strings + "after" kw + "and" kw + "andalso" kw + "band" kw + "begin" kw + "bnot" kw + "bor" kw + "bsl" kw + "bsr" kw + "bxor" kw + "case" kw + "catch" kw + "cond" kw + "div" kw + "end" kw + "fun" kw + "if" kw + "let" kw + "not" kw + "of" kw + "or" kw + "orelse" kw + "query" kw + "receive" kw + "rem" kw + "try" kw + "when" kw + "xor" kw +done + "a-zA-Z0-9_@" atom + +:kw Keyword + * idle noeat + +:quoted_atom Idle + * quoted_atom + "'" idle diff --git a/ftyperc b/ftyperc index 700b472..8af02a7 100644 --- a/ftyperc +++ b/ftyperc @@ -878,3 +878,8 @@ -autoindent -smarthome -smartbacks + + Erlang +*.erl +-syntax erlang +-autoindent diff --git a/prolog.jsf b/prolog.jsf index eda3443..3a6cf9c 100644 --- a/prolog.jsf +++ b/prolog.jsf @@ -4,11 +4,11 @@ =Comment green =Constant cyan =Escape bold cyan -=Variable cyan =Keyword bold =Bad bold red -=Brace +=Brace #magenta +=Variable fg_310 =Predicate red :idle Idle