"Fossies" - the Fresh Open Source Software Archive

Member "highlight-3.57-x64/langDefs/swift.lang" (12 May 2020, 1711 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 "swift.lang": 3.56_vs_3.57.

    1 
    2 Description="Swift"
    3 
    4 Categories = {"source"}
    5 
    6 Keywords={
    7   {  Id=1,
    8     List= { "class", "deinit", "enum", "extension", "func", "import", "init",
    9             "internal", "let", "operator", "private", "protocol", "public", "static",
   10             "struct", "subscript", "typealias", "var", "fileprivate", "open", "final",
   11             "break", "case", "continue", "default", "do", "else", "fallthrough",
   12             "for", "if", "in", "return", "switch", "where", "while", "try","throw","catch",
   13             "guard", "mutating", "throws"
   14         }
   15   },
   16   { Id=2,
   17     List= { "as", "dynamicType", "false", "is", "nil", "self", "Self", "super",
   18             "true", "__COLUMN__", "__FILE__", "__FUNCTION__", "__LINE__",
   19             "Bool", "UInt", "Int", "Int8", "Float", "Double", "Character", "String"
   20         }
   21   },
   22   { Id=3,
   23     Regex=[[ (let|var)\s+(\w+)]], Group=2
   24   },
   25   { Id=4,
   26     Regex=[[(\w+)\s*\(]]
   27   },
   28 
   29   { Id=2,
   30     Regex=[[@\w+]]
   31   }
   32 }
   33 
   34 -- add keywords to list 3
   35 function OnStateChange(oldState, newState, token, kwgroup)
   36   if newState==HL_KEYWORD and kwgroup==3 then
   37     AddKeyword(token, 3)
   38   end
   39   return newState
   40 end
   41 
   42 Identifiers=[[ [a-zA-Z_]\w* ]]
   43 
   44 Digits=[[ (?:0x|0o|0b)[0-9a-fA-F]+|\d*[\.\_]?\d+(?:[eE][\-\+]\d+)? ]]
   45 
   46 Strings = {
   47   Delimiter=[["]],
   48   Interpolation = [[ \\\(.+?\)\)? ]],
   49   RawPrefix="R",
   50   Escape = [[ \\t|\\0|\\v|\\r|\\"|\\'|\\u\{[0-9a-fA-F]+\} ]],
   51 }
   52 
   53 Comments = {
   54   { Block=true,
   55     Nested=true,
   56     Delimiter = { [[\/\*]], [[\*\/]] }
   57   },
   58   {
   59     Block=false,
   60     Delimiter = { [[//]] }
   61   }
   62 }
   63 
   64 IgnoreCase=false
   65 
   66 PreProcessor = {
   67   Prefix=[[#]],
   68   Continuation="\\",
   69 }
   70 
   71 Operators=[[\(|\)|\[|\]|\{|\}|\,|\;|\.|\:|\&|<|>|\!|=|\/|\*|\%|\+|\-|\~|\||\^]]
   72 
   73 EnableIndentation=false