From fd89e4dd1418d1474894d09c0ea8418f32dba490 Mon Sep 17 00:00:00 2001 From: "David B. Lamkins" Date: Thu, 6 Aug 2015 09:36:05 -0700 Subject: Add APL syntax highlighting. --- config.def.h | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) (limited to 'config.def.h') diff --git a/config.def.h b/config.def.h index 5da2ec3..78b2ccb 100644 --- a/config.def.h +++ b/config.def.h @@ -1378,6 +1378,41 @@ static Syntax syntaxes[] = {{ "^[!@]?(account|alias|assert|bucket|capture|check|comment|commodity|define|end|fixed|endfixed|include|payee|apply|tag|test|year|[AYNDCIiOobh])"B".*", &colors[COLOR_DATATYPE], }} +},{ + .name = "apl", + .file = "\\.apl$", + .settings = (const char*[]){ + "set number", + NULL + }, + .rules = {{ + "(⍝|#).*$", + &colors[COLOR_COMMENT], + },{ + "('([^']|'')*')|(\"([^\"]|\"\")*\")", + &colors[COLOR_STRING], + },{ + "^ *(∇|⍫)", + &colors[COLOR_SYNTAX9], + },{ + "(⎕[a-zA-Z]*)|[⍞χ⍺⍶⍵⍹]", + &colors[COLOR_KEYWORD], + },{ + "[∆⍙_a-zA-Z][∆⍙_¯a-zA-Z0-9]* *:", + &colors[COLOR_SYNTAX2], + },{ + "[∆⍙_a-zA-Z][∆⍙_¯a-zA-Z0-9]*", + &colors[COLOR_IDENTIFIER], + },{ + "¯?(([0-9]+(\\.[0-9]+)?)|\\.[0-9]+)([eE]¯?[0-9]+)?([jJ]¯?(([0-9]+(\\.[0-9]+)?)|\\.[0-9]+)([eE]¯?[0-9]+)?)?", + &colors[COLOR_CONSTANT], + },{ + "[][(){}]", + &colors[COLOR_BRACKETS], + },{ + "[←→◊]", + &colors[COLOR_SYNTAX3], + }} },{ /* empty last element, array terminator */ }}; -- cgit v1.2.3