This is an update to inno.properties which has not been done for many years. It is based on latest sources of Inno Setup v6.2.0.
I created a repository at Github to maintain a Python 3 script named generate_inno_api.py.
Note that the parameter named String is omitted. While the parameter exist in the INI section of Inno Setup, it is also used in the Registry section as a value of the ValueType parameter. The INI section is rarely used compared to the Registry section which is used often. For this reason, colouring string is undesirable as to how it is used.
Example:
[INI]
Filename: "MyProg.ini"; Section: "InstallSettings"; Key: "InstallPath"; String: "{app}"
[Registry]
Root: HKLM; Subkey: "Software\My Company\My Program\Settings"; ValueType: string; ValueName: "InstallPath"; ValueData: "{app}"
Unfortunately, the inno lexer cannot tell the difference between the parameter String and the value string.
Some hardcoded styles are replaced with $(colour...) variables.
The full file attached has been generated at current default settings.
Committed as [512e5f].
The inno lexer calls
toloweron each character as it is accumulated into thebuffervariable. Thus it is unable to distinguish case. If case is significant in some aspects of inno, thosetolowercalls should be avoided and any case-insensitivity implemented when checking the value.Related
Commit: [512e5f]
Inno Setup is case-insensitive so
tolowershould be avoided, might be a true statement.The LexInno.cxx lexer file checks whether
ch == '#'to determine if to set to SCE_INNO_PREPROC. Similar possibly could be done for setting SCE_INNO_PARAMETER. A parameterisalpha(ch)and ends with:, could be a valid parameter keyword to be set as SCE_INNO_PARAMETER, else it could be a ValueType value to remain as SCE_INNO_DEFAULT.I changed line 136:
to
Seems to style good with testing. The example given in initial post looks good. Other inno scripts I have look good.
So now if
String:, it a styled as SCE_INNO_PARAMETER. IfString :it is SCE_INNO_DEFAULT. The string in registry section isstring;so it is SCE_INNO_DEFAULT. I do not have much C++ experience to know how to handle syntax with optional spaces, especially aschrepresents 1 character. For me would be fine, for someone who likes inserting a space before the colon, I do not know how to implement if it is suitable. I have not seen any inno scripts with a space preceding the colon after a parameter keyword so perhaps it is the fix. Just like a preprocessor does not account for space,#defineis good,# defineis not good. I'm not even sure if the later is valid.The submission of this Feature Request with the declaration that I was doing a workaround by omitting
string. If you think this is fixable, then an issue report could be submitted to Lexilla repository. If fixed, inno.properties could be updated with parameter keywordstring. I could submit an issue and attach a updated inno.properties. Let me know what you think of this.If you want this change then it can go in. Its unclear if spaces before the ':' are allowed or have an effect. The change could then be amended if others find it a problem.
To allow spaces, there could be a function that loops until
styler.SafeGetCharAt(pos)is not white space then checks if the character is ':'. For a similar example, seelatexNextNotBlankIsin LexLaTeX.cxx .Its better for changes to the code to go to the Lexilla project. Its on github which is familiar to more people.
https://github.com/ScintillaOrg/lexilla
Thanks for the advice. Use of
latexNextNotBlankIsas a base to code allows optional spaces and tabs before the colon.String :will be styled as SCE_INNO_PARAMETER now.I may inspect LexInno.cxx more and see if other improvements can be done while I am at it. I will then be able to submit a Pull Request to the lexilla repository.
space is allowed after parameter and before
=or:.also current lexer has bug for single quoted string, which only appears inside pascal code section or after
Checkparameter.This file can be used for test: https://github.com/XhmikosR/notepad2-mod/blob/master/distrib/notepad2_setup.iss
=for Keyword:for ParameterSpace allowed is True for both.
Single quote issue. May have seen before with Check Parameter with escaping or other.
Thanks for the link. Issues I view in that file:
WizardSmallImageFile=WizardSmallImageFile.bmp, part of value is recognized as Keyword.=detection.tasks:in CustomMessages section recognized as a Parameter.OnlyBelowVersionis a Keyword and a Parameter. A duplicate that can be recognized incorrect depending where used.=and:detection.Thanks for the information. I might be able to fix. No more issues here as not the correct place for lexilla issues. :)
I have a extension.lua file for inno that changes the api property value based on section. LexInno.cxx sets name IsCode by section detection, so might be able to do something for other sections.
Due to a Pull Request for LexInno.cxx, I have changed generate_inno_api.py to remove setting of keep_parameter_string which could omit the parameter named
stringand have generated a new inno.properties.The full file attached has been generated at current default settings.
Committed as [c56891].
Related
Commit: [c56891]