Ticket #4319: 0001-Fix-SPICE-syntax-file-to-recognize-where-control-scr.patch

File 0001-Fix-SPICE-syntax-file-to-recognize-where-control-scr.patch, 1.9 KB (added by gszymaszek, 3 years ago)
  • misc/syntax/spice.syntax

    From 73e8a7806c76190ca796b9db9dd77c1a7b11ad9f Mon Sep 17 00:00:00 2001
    From: Grzegorz Szymaszek <gszymaszek@short.pl>
    Date: Sat, 4 Dec 2021 23:31:47 +0100
    Subject: [PATCH] Fix SPICE syntax file to recognize where control script
     context ends
    
    Since .endc was defined both as the context end delimiter and a context
    keyword, it was not recognized as the former and the control script
    context, once started, would never be finished. This issue can be
    noticed, for example, in wrong syntax highlighting of the .end command
    if it was preceded by a control script.
    
    Fix the issue by making the control script context exclusive and
    highlighting the .control and .endc keywords in the default context
    instead.
    ---
     misc/syntax/spice.syntax | 7 +++----
     1 file changed, 3 insertions(+), 4 deletions(-)
    
    diff --git a/misc/syntax/spice.syntax b/misc/syntax/spice.syntax
    index 15e6aea58..86ff10e4f 100644
    a b context default 
    99 
    1010    # dot commands 
    1111    keyword whole .ac brightmagenta 
     12    keyword whole .control brightmagenta 
    1213    keyword whole .csparam brightmagenta 
    1314    keyword whole .dc brightmagenta 
    1415    keyword whole .disto brightmagenta 
    1516    keyword whole .else brightmagenta 
    1617    keyword whole .elseif brightmagenta 
    1718    keyword whole .end brightmagenta 
     19    keyword whole .endc brightmagenta 
    1820    keyword whole .endif brightmagenta 
    1921    keyword whole .ends brightmagenta 
    2022    keyword whole .four brightmagenta 
    context default 
    186188 
    187189context " " green 
    188190 
    189 context .control .endc 
     191context exclusive .control .endc 
    190192    keyword linestart \**\n brown 
    191193    keyword $*\n brown 
    192194    keyword ;*\n brown 
    193195    keyword //*\n brown 
    194196    keyword linestart \+ red 
    195197 
    196     keyword .control brightmagenta 
    197     keyword .endc brightmagenta 
    198  
    199198    # commands 
    200199    keyword whole ac yellow 
    201200    keyword whole alias yellow