Python block comment syntax highlighting
is not supported with UltraEdit
< v2022.1.0.90 (v29.1.0.90 with former version numbering scheme) or UEStudio
< v2022.1.0.90 (v22.1.0.90 with former version numbering scheme).
Python block comment syntax highlighting
is supported with UltraEdit
≥ v2022.1.0.90 or UEStudio
≥ v2022.1.0.90 by using in the Python syntax highlighting wordfile as first line either
Code: Select all
/L16"Python" PYTHON_LANG String Chars = "' Escape Char = \ Line Comment = # Block Comment On = ''' Block Comment Off = ''' Block Comment On Alt = """ Block Comment Off Alt = """ File Extensions = PY PYW
or
Code: Select all
/L16"Python" PYTHON_LANG String Chars = "' Escape Char = \ Line Comment = # Block Comment On = """ Block Comment Off = """ Block Comment On Alt = ''' Block Comment Off Alt = ''' File Extensions = PY PYW
The Python syntax highlighting wordfile is by default
%APPDATA%\IDMComp\UltraEdit\wordfiles\python.uew or
%APPDATA%\IDMComp\UEStudio\wordfiles\python.uew. Open the wordfile by opening in UltraEdit/UEStudio
Advanced - Settings or Configuration - Syntax highlighting, selecting the
installed wordfile Python, clicking on button
Open, and closing the configuration dialog window.
I tested the Python block comment highlighting with UltraEdit v2022.0.0.102 (not working because of the reasons written by rtv0075), v2022.1.0.90 (working due to syntax highlighting parser overhaul as written in changes.txt of UE/UES v2022.1 and later versions) and currently latest v2024.3.0.13.
Which of the two possible lines is used depends on which type of block comment is preferred on using the commands
Comment selection and
Uncomment selection in traditional menu
Edit or
Block comment selection in submenu
Comment and
Remove block comment in submenu
Uncomment of contemporary menu
Coding or clicking on ribbon tab
Coding on down arrow below the command
Comment or right to the command
Uncomment to open the appropriate pop-up menu and clicking on the command
Block comment selection respectively
Remove block comment.
Line comments, alternate line comments and block comments are all syntax highlighted with the color and the font style settings as defined for the
language Python for color group
Comments in the
Manage Themes dialog window on tab
Syntax. The color group
Alternate block comments defines the color and font style for syntax highlighting alternate block comments. It is therefore possible to syntax highlight block comments with
""" different to block comments with
''' or get them both syntax highlighted identical on using identical settings for the color groups
Comments and
Alternate block comments.
NOTE: There is according to the Python documentation
Lexical analysis just one type of comments: line comments starting with
#. A block enclosed in
""" or
''' is in real a
longstring (which can be a multi-line string) which is ignored on parsing the Python script file on not being assigned to a variable. See also
Python Multiline Strings and
Python Comments of W3 schools. The syntax highlighting definition above is not capable to distinguish between a
longstring assigned to a string variable or passed to a function as parameter and a
longstring used as block comment and being more or less ignored on parsing the Python script file.