We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Syntax Highlighting Problem!

I have to highlight the source files of an tool machine, so I have defined a new language in the config file. In this programming language a program has only a start block(N>9000) and the last code line befor the next start block is the end block, this region should be collapsable. The problem is that the parser search for a lexem block not over more lines. Is there a way to highlight this blocks? Syncfusion version: Essential Studio 4.2.0.37 The regex pattern works I have testet this pattern with a regex tester: StartBlock="\bN([1-9][0-9]{4,}|9[1-9][0-9]{2}|9[0-9]{2}[1-9]|9[0-9][1-9][0-9])\b" EndBock="(?:\bN([0-8][0-9]{3}|[0-9]{1,3})\b).*[\r\s]*(?=\Z|\bN([1-9][0-9]{4,}|9[1-9][0-9]{2}|9[0-9]{2}[1-9]|9[0-9][1-9][0-9])\b)" A source file look like this: N9001 (Start block) N1 G1 X+1 Y-1 N2 G50 T15 N3 G60 S456 (End block) N9002 (Start block) N1 G1 X+1 Y-1 N2 G50 T15 N3 G60 S456 (End block)

8 Replies

AD Administrator Syncfusion Team June 28, 2006 04:22 PM UTC

Hi Michael, Our apologies for the delayed response.We are looking in to this issue and will get back to you shortly. Thanks for your patience. Regards, Ebenezer.P


AD Administrator Syncfusion Team June 29, 2006 06:29 AM UTC

Hi Michael, I have attached a sample that illustrates how to apply highlighting for a source file. Let me know if this meets your requirements. Thanks for your patience. Regards, Ebenezer.P

CS30.zip


MI Michael June 29, 2006 08:40 AM UTC

Hi Ebenezer P. thank you for your fast answer! Unfortunately the sample does not meet my requirements, because when you collapse the first block the second block is collapsed with and in the first block but I want two seperate blocks. I think the problem is that the regular expression Positive lookahead (?=) does not work. If the lookahead works I could check if in the next line is a N grater then 9000 then I highlight the N lower then 9000 that is befor this line. This are the blocks i want: + N9001 | N1 |- N2 + N9002 | N1 |- N2 Now I have a second problem. Axis position is decremented it looks like this X+12 X is text + is an operator and 12 is a number this works great, but you also can write X12 and there is the problem I want X as text and 12 as number. Somthing like this (?<=X)12 works in the regex tester but not in the editcontrol. Is there a way to do this. I have attached a modified sample with my current syntax file and a real source file.


MI Michael June 29, 2006 08:41 AM UTC

Sorry I forgot the attachment.

modified.zip


AD Administrator Syncfusion Team June 30, 2006 12:41 PM UTC

Hi Michael, Our apologies for the delayed response.We are looking in to this issue and will get back to you shortly. Thanks for your patience. Regards, Ebenezer.P


AD Administrator Syncfusion Team July 10, 2006 06:27 AM UTC

Hi Michael, I have consulted the Edit development team regarding collapsable blocks.Our development team''s opinion is that it is not possible to support undefined end blocks in the current architecture,so please give some more strict rules for end blocks if you want to support collapsing in this case. I have also tested for the second issue and was able to see the problem here and have notified the development team in this regard. We have logged a bug report Defect # 2328 on this, and will try our very best to address the same at the earliest. You could track the progress of this bug fix at this link below : Defect #2328 - Issue with regular expression in configuration file Thanks for your patience. Regards, Ebenezer.P


MI Michael July 11, 2006 06:56 AM UTC

Hi Ebenezer P., Thanks for your help! Regards, Michael


AD Administrator Syncfusion Team October 11, 2006 11:20 AM UTC

Hi Michael,

Defect #2328 has been fixed and the fixes will be available in the next release of Essential Edit.

Thanks for your patience.

Regards,
Manohari.R

Loader.
Live Chat Icon For mobile
Up arrow icon