"Fossies" - the Fresh Open Source Software Archive

Member "highlight-3.57-x64/langDefs/toml.lang" (14 May 2020, 1445 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. See also the last Fossies "Diffs" side-by-side code changes report for "toml.lang": 3.56_vs_3.57.

    1 
    2 -- for highlight 3.57
    3 
    4 Description="TOML"
    5 
    6 Categories = {"config"}
    7 
    8 Digits=[[ (?:0x|0o|0b)[0-9a-fA-F]+_?[0-9a-fA-F]*|\d*[\.\_]?[\d_]+(?:[eE][\-\+]?\d+)? ]]
    9 
   10 Keywords={
   11   { Id=1,
   12     Regex=[[^\s*(\[.+\])]],
   13   },
   14   { Id=2,
   15     Regex=[[^\s*([^=#]+)\s*=]],
   16   },
   17   { Id=3,
   18     Regex=[[^\s*[\[^=#]+\s*=\s*(\S.*)#?]],
   19   },
   20   { Id=4,
   21     List={"inf", "nan", "true", "false"}
   22   },
   23   { Id=4,
   24     Regex=[[\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}[Z]?|\d{4}-\d{2}-\d{2}]]
   25   }
   26 }
   27 
   28 Strings={
   29   Delimiter=[["""|'''|"|']],
   30   Escape = [[ \\[0%\\\"abfnrtv]|\\U[0-9a-fA-F]{8}|\\u[0-9a-fA-F]{4}|\\x[0-9a-fA-F]{2} ]]
   31 }
   32 
   33 Comments={
   34   { Block=false,
   35     Delimiter= { [[#]] },
   36   },
   37 }
   38 
   39 Operators=[[\(|\)|\{|\}|\,|\:|\&|<|>|\!|\=|\/|\*|\%|\+|\-|\[|\] ]]
   40 
   41 
   42 function OnStateChange(oldState, newState, token, groupID)
   43 
   44   if rawStringDelim~=nil and token==rawStringDelim then
   45     rawStringDelim=nil
   46     return newState
   47   end
   48   if oldState == HL_STANDARD  and (token=="'''" or token=="'") then
   49     rawStringDelim=token
   50     OverrideParam("state.string.raw", "true")
   51     return newState
   52   end
   53   return newState
   54 end
   55 
   56 --[[============================================================================
   57                                   CHANGELOG
   58 ================================================================================
   59 
   60 v1.1 (2020/05/12) | Highlight 3.57
   61 
   62   - makes use of OverrideParam to handle raw strings with identical start/end
   63     delimiters
   64 
   65 v1.0
   66   - initial version
   67 
   68 --]]