Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#1554 bugs within Scintilla's interface file

Bug
closed-fixed
Neil Hodgson
scintilla (113)
5
2013-12-12
2013-11-19
green9
No

When parsing and analysing the Scintilla's interface file, I have found the following issues:

You should be able to correct points 2, 3, 5, 6, 7 and 9 within a matter of minutes. 1, 4 and 8 might take a little longer. I was wondering if I should post 9 different bug reports .. but then, I didn't want to spam the tracker...

1:: (ERR) enu IndicatorStyle (line 569)
- INDIC_STRAIGHTBOX and INDIC_CONTAINER
- value collision as both having value 8

2:: (WARN) enu FindOption (line 858)
- has mixed int/hex values
- write all int-values as hex-values

3:: (WARN) enu FontQuality (line 1294)
- has mixed int/hex values
- write all int-values as hex-values

4:: (WARN) additional problem with FontQuality
- SC_EFF_QUALITY_ANTIALIASED and SC_EFF_QUALITY_NON_ANTIALIASED
- one might run into the problem of having both set at the same time
- better select one and declare the other one as deprecated

5:: (ERR) lexer-id not defined (line 2707)
- there is no value definition for SCLEX_ASP

6:: (ERR) lexer-id not defined (line 2708)
- there is no value definition for SCLEX_PHP
- SCLEX_PHPSCRIPT seems to be available

7:: (ERR) lexer-id not defined (line 3949)
- there is no value definition for SCLEX_MAGIKSF
- SCLEX_MAGIK seems to be available

8:: (ERR) lex CoffeeScript (line 4188)
- SCE_COFFEESCRIPT_HASHQUOTEDSTRING and SCE_COFFEESCRIPT_COMMENTBLOCK
- value collision as both having value 22

9:: (ERR) lex KVIrc (line 4330)
- has no values assigned to it
- replace prefix "SCLEX_KVIRC_" with "SCE_KVIRC_"

Discussion

  • Eric Promislow
    Eric Promislow
    2013-11-19

    AFAICT, SCE_COFFEESCRIPT_HASHQUOTEDSTRING isn't used and can be removed.

     
    • so does STRINGRAW and TRIPLEVERBATIM, as noted in [#1518]

      However, I don't know what is the policy on removing existing states, since they are exposed in the API

       

      Related

      Bugs: #1518


      Last edit: Colomban Wendling 2013-11-19
      • Neil Hodgson
        Neil Hodgson
        2013-11-19

        Its a judgment call and depends on the impact since having additional unused constants does no great harm. If its possible that these may be implemented in the future then they should stay otherwise they should be removed. For a more widely used lexer like C++ or HTML, then more care would be warranted.

         
  • green9
    green9
    2013-11-19

    At the bottom of the interface file, there is a "Deprecated" category. So I assume - if they are to be removed - they will go through a grace period before their final removal.

     
    • Neil Hodgson
      Neil Hodgson
      2013-11-19

      The deprecated category is used for features that were used and important in the past, not symbols that may be a mistake. Moving features into deprecation is rare.

       
  • Neil Hodgson
    Neil Hodgson
    2013-11-19

    1: INDIC_STRAIGHTBOX and INDIC_CONTAINER are used for different purposes and do not clash.

    2: OK

    3: The hex constant is to be able to break up the value into subfields in the future. The decimal constants are values to go into the only currently defined subfield.

    4: Having both SC_EFF_QUALITY_ANTIALIASED and SC_EFF_QUALITY_NON_ANTIALIASED is reasonable since they have different appearances.

    5,6: OK to remove since SCLEX_ASP and SCLEX_PHP were removed in 2009. SCLEX_PHPSCRIPT is for using PHP as a scripting language instead of embedded into HTML.

    7: OK

    8: Eric says to drop SCE_COFFEESCRIPT_HASHQUOTEDSTRING.

    9: OK.

    A patch for these changes:

    diff -r 919f80b722de include/Scintilla.iface
    --- a/include/Scintilla.iface   Tue Nov 19 09:01:06 2013 +1100
    +++ b/include/Scintilla.iface   Wed Nov 20 08:51:02 2013 +1100
    @@ -856,8 +856,8 @@
     get int GetPrintColourMode=2149(,)
    
     enu FindOption=SCFIND_
    -val SCFIND_WHOLEWORD=2
    -val SCFIND_MATCHCASE=4
    +val SCFIND_WHOLEWORD=0x2
    +val SCFIND_MATCHCASE=0x4
     val SCFIND_WORDSTART=0x00100000
     val SCFIND_REGEXP=0x00200000
     val SCFIND_POSIX=0x00400000
    @@ -2706,8 +2706,6 @@
     # Lexical states for SCLEX_HTML, SCLEX_XML
     lex HTML=SCLEX_HTML SCE_H_ SCE_HJ_ SCE_HJA_ SCE_HB_ SCE_HBA_ SCE_HP_ SCE_HPHP_ SCE_HPA_
     lex XML=SCLEX_XML SCE_H_ SCE_HJ_ SCE_HJA_ SCE_HB_ SCE_HBA_ SCE_HP_ SCE_HPHP_ SCE_HPA_
    -lex ASP=SCLEX_ASP SCE_H_ SCE_HJ_ SCE_HJA_ SCE_HB_ SCE_HBA_ SCE_HP_ SCE_HPHP_ SCE_HPA_
    -lex PHP=SCLEX_PHP SCE_H_ SCE_HJ_ SCE_HJA_ SCE_HB_ SCE_HBA_ SCE_HP_ SCE_HPHP_ SCE_HPA_
     val SCE_H_DEFAULT=0
     val SCE_H_TAG=1
     val SCE_H_TAGUNKNOWN=2
    @@ -3951,8 +3949,8 @@
     val SCE_R_IDENTIFIER=9
     val SCE_R_INFIX=10
     val SCE_R_INFIXEOL=11
    -# Lexical state for SCLEX_MAGIKSF
    -lex MagikSF=SCLEX_MAGIKSF SCE_MAGIK_
    +# Lexical state for SCLEX_MAGIK
    +lex MagikSF=SCLEX_MAGIK SCE_MAGIK_
     val SCE_MAGIK_DEFAULT=0
     val SCE_MAGIK_COMMENT=1
     val SCE_MAGIK_HYPER_COMMENT=16
    @@ -4214,7 +4212,6 @@
     val SCE_COFFEESCRIPT_GLOBALCLASS=19
     val SCE_COFFEESCRIPT_STRINGRAW=20
     val SCE_COFFEESCRIPT_TRIPLEVERBATIM=21
    -val SCE_COFFEESCRIPT_HASHQUOTEDSTRING=22
     val SCE_COFFEESCRIPT_COMMENTBLOCK=22
     val SCE_COFFEESCRIPT_VERBOSE_REGEX=23
     val SCE_COFFEESCRIPT_VERBOSE_REGEX_COMMENT=24
    @@ -4333,7 +4330,7 @@
     val SCE_STTXT_VARS=17
     val SCE_STTXT_PRAGMAS=18
     # Lexical states for SCLEX_KVIRC
    -lex KVIrc=SCLEX_KVIRC SCLEX_KVIRC_
    +lex KVIrc=SCLEX_KVIRC SCE_KVIRC_
     val SCE_KVIRC_DEFAULT=0
     val SCE_KVIRC_COMMENT=1
     val SCE_KVIRC_COMMENTBLOCK=2
    
     
    • green9
      green9
      2013-11-20

      1: I was pretty certain that C#'s enum types wouldn't allow different constants with the same value. Surprisingly I was wrong.

       
  • Neil Hodgson
    Neil Hodgson
    2013-11-20

    Committed as [2d9376].

     

    Related

    Commit: [2d9376]

  • Neil Hodgson
    Neil Hodgson
    2013-11-20

    • labels: --> scintilla
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -1,4 +1,3 @@
    -
     When parsing and analysing the Scintilla's interface file, I have found the following issues:
    
     You should be able to correct points 2, 3, 5, 6, 7 and 9 within a matter of minutes. 1, 4 and 8 might take a little longer. I was wondering if I should post 9 different bug reports .. but then, I didn't want to spam the tracker...
    
    • status: open --> open-fixed
    • assigned_to: Neil Hodgson
     
  • Neil Hodgson
    Neil Hodgson
    2013-12-12

    • status: open-fixed --> closed-fixed