I'm trying make User Language Define for CiCode ( http://www.citect.com/ ), and this language consist next construction:
FUNCTION Func0()
WHILE 1 DO
SELECT CASE Rand(1)
CASE 0 Func1()
CASE 1 Funk2()
END SELECT
END
END
i.e. close folder definition for words: FUNCTION, WHILE is equally - END;
and open folder definition "SELECT CASE" and close folder definition "END SELECT" consists of two words.
How to define this in the User Language Define?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
PS: try collapse the WHILE or SELECT or IF in this code with settings:
open folder definition: SELECT WHILE THEN ELSE IF FUNCTION
close folder definition: END
right wirks only ELSE collapse :(
FUNCTION Func0(INT x)
WHILE 1 DO
SELECT CASE Rand(1)
CASE 0 Func1()
CASE 1 Funk2()
END SELECT
IF x THEN
Func5()
ELSE
Func6()
END
END
END
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I have nearly the same issue - in my user-defined language (PCL)I would like to fold on :
start end
"FUNCTION" "END FUNCTION"
"WHILE" "END WHILE"
"SWITCH" "END SWITCH"
"IF" "END IF"
"FOR" "END FOR"
Is it possible to escape the space character?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
If you use END for everything then it does not work because the open's and close's do not match:
for example
FOR( n = 1 TO numWords ) /* open folding for FOR */
WHILE( word_id(n) >0 ) /* open folding for WHILE */
. . .
END WHILE /* want to close folding for WHILE */
/* - if you use 'END' will close folding for FOR */
END FOR /* want to close folding for FOR */
/* - if you use 'END' to close folding 'open' and 'close' are out of synch. */
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
This word separating seems to be necessary for syntax coloring and folding.
LET'S EXPLOIT THIS!
Try this code:
FOR ( n = 1 TO numWords ) /* open folding for FOR */
WHILE ( word_id(n) >0 ) /* open folding for WHILE */
. . .
END WHILE/* >WHILE and comment not colored */
/* - if you use 'END' will close folding for FOR */
END FOR/* >FOR and comment not colored */
The WHILE and FOR after the END won't be colored, because they are not separated. The same goes for the WHILE and FOR inside the comments.
The words aren't highlighted now and they are not recognized as opening folder keywords anymore. As far as I know, this "sticked" code should compile just as well.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I'm trying make User Language Define for CiCode ( http://www.citect.com/ ), and this language consist next construction:
FUNCTION Func0()
WHILE 1 DO
SELECT CASE Rand(1)
CASE 0 Func1()
CASE 1 Funk2()
END SELECT
END
END
i.e. close folder definition for words: FUNCTION, WHILE is equally - END;
and open folder definition "SELECT CASE" and close folder definition "END SELECT" consists of two words.
How to define this in the User Language Define?
PS: try collapse the WHILE or SELECT or IF in this code with settings:
open folder definition: SELECT WHILE THEN ELSE IF FUNCTION
close folder definition: END
right wirks only ELSE collapse :(
FUNCTION Func0(INT x)
WHILE 1 DO
SELECT CASE Rand(1)
CASE 0 Func1()
CASE 1 Funk2()
END SELECT
IF x THEN
Func5()
ELSE
Func6()
END
END
END
I have nearly the same issue - in my user-defined language (PCL)I would like to fold on :
start end
"FUNCTION" "END FUNCTION"
"WHILE" "END WHILE"
"SWITCH" "END SWITCH"
"IF" "END IF"
"FOR" "END FOR"
Is it possible to escape the space character?
What's wrong with using END as a folder closing word???
If you use END for everything then it does not work because the open's and close's do not match:
for example
FOR( n = 1 TO numWords ) /* open folding for FOR */
WHILE( word_id(n) >0 ) /* open folding for WHILE */
. . .
END WHILE /* want to close folding for WHILE */
/* - if you use 'END' will close folding for FOR */
END FOR /* want to close folding for FOR */
/* - if you use 'END' to close folding 'open' and 'close' are out of synch. */
The problem here is that WHILE after END is opening a folder again.
This seems to undo the closing of the previous folder.
Just notice what happens when you put a linebreak between END and WHILE.
By the way, you need to separate your keywords from the other code.
Wrong___: WHILE(
Correct_: WHILE (
This word separating seems to be necessary for syntax coloring and folding.
LET'S EXPLOIT THIS!
Try this code:
FOR ( n = 1 TO numWords ) /* open folding for FOR */
WHILE ( word_id(n) >0 ) /* open folding for WHILE */
. . .
END WHILE/* >WHILE and comment not colored */
/* - if you use 'END' will close folding for FOR */
END FOR/* >FOR and comment not colored */
The WHILE and FOR after the END won't be colored, because they are not separated. The same goes for the WHILE and FOR inside the comments.
The words aren't highlighted now and they are not recognized as opening folder keywords anymore. As far as I know, this "sticked" code should compile just as well.