Okay, something mysterious happens here. The fold strings work perfect, when I modified my "C" language definition with your 3 fold string lines and saved your example code as file Test.c.
Yesterday at the evening in Austria I tried it with your language definition and renamed the file to Test.bas and get the same result as you. I selected in
View - Views/Lists my "C" language definition which has still your fold strings and surprise, the code folding engine worked perfect on Test.bas. Back to "4690" language definition and Test.bas was again wrong interpreted by the code folding engine.
So I looked on your language definition, corrected all the mistakes, sorted the groups with my
SortLanguage macro which you can download from
the ultimate syntax highlighting tools and tried it again. But the code folding engine does not stop to sometimes work and sometimes not. After 40 minutes of experimenting with language "4690", I found what causes the problems.
If you remove the extension
BAS from the file extensions lists, then the code folding engine will always work perfect automatically on files with the extension J86 and INC and also BAS after manually selecting the language "4690" in the view menu for the file with extension BAS.
But with
BAS specified as file extension for language "4690" the code folding engine seems to ignore the fold string definitions and uses internal defaults or simply does not work correct.
You have to ask IDM per email to look into this and fix that problem. Attach in a zip archive
- your example code as file "Test4690.bas",
- the corrected syntax highlighting word file below,
- a PNG screenshot how the code folding works for the example code with that word file,
- a PNG screenshot how the code folding should work for the example code with that word file.
(Remove temporarily BAS at line 1 of the word file and specify the language "4690" via the view menu to get a screenshot (Alt+PrintScreen) of a correct working code folding engine.)
By the way: You don't need to restart UE after making changes to the word file, if you edit the word file in the same UE instance.
Here is your corrected and resorted word file. I'm not sure what is the real line comment. The string "! \" or only the character '!' or alternatively '\'. I used the second one (! or \) in the word file. If it is the string with a space between ! and \, then replace
Line Comment = ! Line Comment Alt = \ with
Line Comment Num = 3! \Please note:
tab on the second line must be replaced by a real tab character after copying the language definition from the browser window to your word file.
/L14"4690" Nocase Line Comment = ! Line Comment Alt = \ String Chars = " DisableMLS File Extensions =
BAS INC J86
/Delimiters = ~!@^&*()-+=|\/{}[]:;"'<> ,
tab.?
/Function String = "%*^{Sub^}^{Function^}^(*(*^)$"
/Open Brace Strings = "("
/Close Brace Strings = ")"
/Open Fold Strings = "FUNCTION" "SUB" "WHILE" "IF" "ENDIF ELSE"
/Close Fold Strings = "END FUNCTION" "END SUB" "WEND" "ENDIF ELSE" "ENDIF"
/Ignore Fold Strings = "EXIT SUB" "EXIT FUNCTION"
/C1"Functions"
ABS ASC
CHR$ COMMAND$ CONCHAR% CONSTAT%
DATE$ DISABLE
ENABLE ERR ERRF% ERRL ERRN EVENT%
FLOAT FRE
GET GETLONG
INKEY INT INT%
LEFT$ LEN LOCK
MATCH MFRE MID$ MOD
PACK$ PEEK POS PTRRTN
RENAME RIGHT$ RND ROUND
SADD SGN SHIFT SIZE STR$ STRING$
TAB TIME$ TRANSLATE$
UCASE$ UNLOCK UNPACK$
VAL VARPTR
/C2"Statements"
ACCESS ASSIGNKEY ASYNC
CALL CHAIN CHDIR CLEARS CLOSE COMMON CONSOLE CREATE
DATA DEF DELETE DELREC DIM
END ENDIF ELSE ERROR EXIT
FEND FOR FORM FUNCTION FUNCTIONKEY
GOSUB GOTO
IF INPUT INTEGER
KEYED
LET LINE LINK LOAD LOCATE LOCKDEV LOGO LPRINTER
MATRIX MKDIR
NEXT
ON OPEN OPTION
POINT POKE POSFILE PRINT PUT PUTLONG
RANDOM RANDOMIZE READ REAL REMARK RESTORE RESUME RETURN RMDIR
SERIAL SESSION STOP STRING SUB
TCLOSE
UNLOCKDEV USE USING
WAIT WEND WHILE WRITE
/C3"Operators"
(
)
*
+
-
// /
<
=
>
^
AND
EQ
GE GT
LE LT
NE NOT
OR
XOR