"Fossies" - the Fresh Open Source Software Archive

Member "highlight-3.57-x64/langDefs/coffee.lang" (12 May 2020, 1686 Bytes) of package /windows/www/highlight-3.57-x64.zip:


As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 -- a highlight lang definition for coffeescript, by Jess Austin
    2 Description = "Coffeescript"
    3 
    4 Categories = {"source", "script"}
    5 
    6 Keywords = {
    7   {
    8     Id = 1,
    9     List = { "and", "break", "by", "catch", "class", "continue", "debugger",
   10     "default", "delete", "do", "else", "export", "extends", "finally", "for",
   11     "if", "import", "in", "instanceof", "is", "isnt", "loop", "new", "not",
   12     "of", "or", "return", "super", "switch", "then", "throw", "try", "typeof",
   13     "unless", "until", "when", "while", "yield", "as", "from", "var"
   14     }
   15   },
   16   {
   17     Id = 2,
   18     List = { "false", "Infinity", "NaN", "no", "null", "off", "on", "this",
   19     "undefined", "true", "yes" }
   20   },
   21   { -- property names in object literals
   22     Id = 3,
   23     Regex = [[\w+(?=:)]]
   24   },
   25   {
   26     Id = 1,
   27     Regex = [[///|/(?!//)]]
   28   },
   29 }
   30 
   31 Comments = {
   32   {
   33     Block = true,
   34     Nested = false,
   35     Delimiter = { [[###]], [[###]] }
   36   },
   37   {
   38     Block = false,
   39     Delimiter = { [[#(?!\{)]] } -- lookahead so string interpolation will work
   40   }
   41 }
   42 
   43 Strings = {
   44   Delimiter = [["""|'''|"|']],
   45   Escape = [=[\\u\{[[:xdigit:]]+\}|\\u[[:xdigit:]]{4}|\\x[[:xdigit:]]{2}|\\[\\bfnrtv0'"]]=],
   46   Interpolation = [[#\{[^}]+}]]
   47 }
   48 
   49 NestedSections = { -- regex as nested language seems to work?
   50   {
   51     Lang = "cs_block_regex",
   52     Delimiter = { [[///]], [[///[gimuy]*]] }
   53   },
   54   {
   55     Lang = "js_regex", -- js.lang might want to use this too
   56     Delimiter = { [[/(?!//)]], [[(?!\\)/[gimuy]*]] }
   57   },
   58 
   59 }
   60 
   61 Digits = [=[0[Bb][01]+|0[Oo][0-7]+|0[Xx][[:xdigit:]]+|\d+]=]
   62 Identifiers = [=[[A-Za-z$_][A-Za-z$_0-9]*]=]
   63 Operators = [[=|\+|-|\*|\/|%|<|>|&|\||^|!|\?|:|\.|,|@|\(|\)|\[|]|\{|}]]
   64 
   65 EnableIndentation = false
   66 IgnoreCase = false