"Fossies" - the Fresh Open Source Software Archive

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

    1 
    2 Description="Terraform"
    3 
    4 Categories = {"config"}
    5 
    6 Digits = [[ (?:0x|0X|0b)[0-9a-fA-F']+|\d*[\.]?\d+(?:[eE][\-\+]\d+)?[lLuU]* ]]
    7 
    8 Keywords={
    9 
   10   { Id=1,
   11     List= { "variable", "resource", "connection", "data", "vars", "tags", "module", "locals", "provider"
   12           }
   13   },
   14 
   15   { Id=3,
   16     Regex=[[(\w+)\s*\=]]
   17   },
   18   { Id=2,
   19     List= { "false", "true"
   20           }
   21   }
   22 
   23 }
   24 
   25 
   26 -- hereDoc opening delimiter, see OnStateChange to handle end of string
   27 Strings={
   28   Delimiter=[[<<[\-]?\s*["']?\s*[A-Za-z_]+["']?|"|`|']],
   29   Interpolation=[[ (\$\{.+?\}) ]]
   30 }
   31 
   32 Comments = {
   33   { Block=true,
   34     Nested=false,
   35     Delimiter = { [[\/\*]], [[\*\/]] }
   36   },
   37   {
   38     Block=false,
   39     Delimiter = { [[#]] }
   40   }
   41 }
   42 
   43 IgnoreCase=false
   44 
   45 
   46 Operators=[[\(|\)|\[|\]|\{|\}|\,|\;|\:|\&|<|>|\!|\=|\/|\*|\%|\+|\-]]
   47 
   48 function OnStateChange(oldState, newState, token)
   49 
   50   if oldState==HL_STRING and token==hereDoc then
   51     hereDoc = nil
   52     return HL_STRING_END
   53   end
   54 
   55   if  (string.sub(token,1,1) =="$" )  and oldState==HL_STRING and newState==HL_KEYWORD then
   56     return HL_INTERPOLATION
   57   end
   58 
   59   if hereDoc~=nil then
   60     return HL_STRING
   61   end
   62 
   63   --recognize hereDoc multine strings
   64   if oldState==HL_STANDARD and newState==HL_STRING  then
   65     hereDoc = string.match(token, "<<%-?%s*%'?([%-%a%d_]+)" )
   66   end
   67 
   68   return newState
   69 end