Loading ...
Sorry, an error occurred while loading the content.

6246Problems with syntax highlighting

Expand Messages
  • Peter Anderson
    Apr 11, 2009
    • 0 Attachment
      Hi!

      I would be pleased to have some help with this infuriating problem I'm
      having with a Python 3 syntax file. I have attached a sample bit of code
      repeated here:

      # syntax_check.py
      # The purpose of this script is to test syntax colours

      def main():

      False - displays in blue
      BaseException - displays in red
      float - displays in teal
      print( - displays in BLACK not olive
      difflib - displays in brown

      main()

      Syntax file extract:

      #KEYWORD=Built-in Functions
      abs(
      ...
      print(
      ...
      zip(
      __import__(

      The first bit of code is a small Python program that does nothing other
      than have five key/reserved words from each of the five syntax #KEYWORD
      lists. The problem is with the Built-in Functions list. Items in this
      list ought to display in an olive colour; however, they are displayed in
      black.

      In the syntax file if I change "print(" "print" and make the same change
      in the syntax_check.py file then "print" will display in olive. However
      if I then change the syntax_check.py file to "print(" the syntax
      highlight colour goes back to black.

      Python syntax for most built-in functions is:

      print("The answer is", 2*2) or
      format(format_string, *args, *kwargs)
      etc. etc.

      Note: There is no spaces between "print" and "(...".

      Does anyone have any thoughts on how this can be fixed?

      Regards,
      Peter
      --
      *Peter Anderson*
      There is nothing more difficult to take in hand, more perilous to
      conduct, or more uncertain in its success, than to take the lead in the
      introduction of a new order of things�Niccolo Machiavelli, /The Prince/,
      ch. 6

      ----------

      # syntax_check.py
      # The purpose of this script is to test syntax colours

      def main():

      False - displays in blue
      BaseException - displays in red
      float - displays in teal
      print( - displays in BLACK not olive
      difflib - displays in brown

      main()

      Syntax file extract:

      #KEYWORD=Built-in Functions
      abs(
      ...
      print(
      ...
      zip(
      __import__(



      [Non-text portions of this message have been removed]
    • Show all 3 messages in this topic