"Fossies" - the Fresh Open Source Software Archive

Member "highlight-3.57-x64/plugins/keywords_uppercase.lua" (12 May 2020, 474 Bytes) of package /windows/www/highlight-3.57-x64.zip:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Lua source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. 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 "keywords_uppercase.lua": 3.53_vs_3.54.

    1 --[[
    2 Sample plugin file for highlight 3.9
    3 ]]
    4 
    5 Description="Convert keywords to upper case, if the syntax is not case sensitive."
    6 
    7 Categories = {"format" }
    8 
    9 -- optional parameter: syntax description
   10 function syntaxUpdate(desc)
   11 
   12   if IgnoreCase ~=true then
   13     return
   14   end
   15 
   16   function Decorate(token, state)
   17     if (state == HL_KEYWORD and not token:match("%W")) then
   18       return  string.upper(token)
   19     end
   20   end
   21 
   22 end
   23 
   24 Plugins={
   25 
   26   { Type="lang", Chunk=syntaxUpdate },
   27 
   28 }