Print Page | Close Window

LexClass Folding Program

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Syntax Edit
Forum Description: Topics Related to Codejock Syntax Edit
URL: http://forum.codejock.com/forum_posts.asp?TID=24099
Printed Date: 28 April 2024 at 5:43pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: LexClass Folding Program
Posted By: yixincheng
Subject: LexClass Folding Program
Date Posted: 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



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net