![]()  | 
 
LexClass Folding Program | 
 
    Post Reply  
   | 
  
| Author | |
   
   yixincheng  
   
   Newbie  
   Joined: 23 November 2020 Status: Offline Points: 2  | 
  
   
      Post Options
    
        Thanks(0)
      Quote   Reply
   
     Topic: LexClass Folding ProgramPosted: 23 November 2020 at 11:04am  | 
 
| 
   
    I refer to the configuration file related to lexClass, such as _cpp.schclass of C++ language, and modify it to generate a new file. The folding part is written like this lexClass: 	 	name = c_STCodeBlock 	parent:dyn 	= c_ST,c_STCodeBlock 	start:tag 	='VAR','VAR_INPUT' 	// skip:tag 	='\\\ r \ n','\\\ n \ r','\\\ n','\\\ r','\\\ t \ n'	 	end:tag 		='END_VAR' 	Collapsable	= 1  	CollapsedText 	='...'	 or lexClass: 	 	name		= c_STCodeBlock 	parent:dyn	= c_ST, c_STCodeBlock 	start:tag	= 'VAR' 	start:tag	= 'PROGRAM' 	start:tag	= 'FUNCTION' 	start:tag	= 'FUNCTION_BLOCK' 	start:tag	= 'UNION' 	start:tag	= 'TYPE' 	start:tag	= 'STRUCT' 	start:tag	= 'CASE' 	start:tag	= 'FOR' 	start:tag	= 'REPEAT' 	start:tag	= 'WHILE' 	start:tag	= 'IF' 	start:tag	= ':' 	start:tag	= 'VAR_INPUT' 	start:tag	= 'VAR_OUTPUT' 	start:tag	= 'VAR_IN_OUT' 	start:tag	= 'VAR_GLOBAL' 	end:tag		= 'END_VAR' 	end:tag		= 'END_PROGRAM' 	end:tag		= 'END_FUNCTION' 	end:tag		= 'END_FUNCTION_BLOCK' 	end:tag		= 'END_UNION' 	end:tag		= 'END_TYPE' 	end:tag		= 'END_STRUCT' 	end:tag		= 'END_CASE' 	end:tag		= 'END_FOR' 	end:tag		= 'END_REPEAT' 	end:tag		= 'END_WHILE' 	end:tag		= 'END_IF' 	end:tag		= 'JMP' 	Collapsable	= 1  	CollapsedText	= '...' 	DisplayName		= 'Curly Braces'	 ![]() There are folds, but the keyword color has changed, and nested folds are not supported 
    | 
 |
![]()  | 
 |
    Post Reply  
   | 
  |
|       
  
  Tweet   	
    | 
 
| Forum Jump | Forum Permissions  ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum  |