"Fossies" - the Fresh Open Source Software Archive

Member "highlight-3.57-x64/langDefs/cmake.lang" (12 May 2020, 1272 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 "cmake.lang": 3.53_vs_3.54.

    1 
    2 Description="CMake"
    3 
    4 Categories = {"config", "script"}
    5 
    6 Keywords={
    7   { Id=1,
    8     List={
    9     "if", "elseif", "else", "endif", "foreach", "endforeach", "and", "while", "endwhile", "macro", "endmacro", "function", "endfunction", "set", "unset"
   10     },
   11   },
   12   { Id=2,
   13     Regex=[[ [0-9A-Z_]{2,}  ]],
   14   },
   15   { Id=3,
   16     Regex=[[\$\{.+\$\{.+?\}.+?\}|\$\{.+?\} ]],
   17   },
   18   { Id=3,
   19     Regex=[[ [A-Z_\>]+\:([\w/]+) ]],
   20   },
   21   { Id=4,
   22     Regex=[[(\w+)\s*\(]],
   23   },
   24 }
   25 
   26 Strings={
   27   Delimiter=[["|']],
   28   DelimiterPairs= {
   29     { Open=[[ \[=*\[ ]], Close=[[ \]=*\] ]], Raw=true }
   30   },
   31   AssertEqualLength=true,
   32   Interpolation=[[ \$\{.+?\} ]]
   33 }
   34 
   35 IgnoreCase=false
   36 
   37 Comments={
   38   { Block=false,
   39     Delimiter= { [[ #(?!\[\[) ]] },
   40   },
   41 
   42   { Block=true,
   43     Nested=false,
   44     Delimiter= { [[ #\[\[ ]],[[ \]\] ]],}
   45   }
   46 }
   47 
   48 Operators=[[\(|\)|\{|\}|\[|\]|\,|\;|\.|\:|\&|<|>|\!|\=|\/|\*|\%|\+|\-|\~|\#|\\]]
   49 
   50 
   51 -- resolve issue with ]] close delimiter which ends comments and strings
   52 function OnStateChange(oldState, newState, token)
   53 
   54   if token=="]]" and oldState==HL_STRING and newState==HL_BLOCK_COMMENT_END then
   55     return HL_STRING_END
   56   end
   57 
   58   if  (string.sub(token,1,1) =="$" )  and oldState==HL_STRING and newState==HL_KEYWORD then
   59     return HL_INTERPOLATION
   60   end
   61 
   62   return newState
   63 end