EControl Ltd. Forum Index EControl Ltd.
VCL libraries and software support forum
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Lexer parser rules expression not working correctly

 
Post new topic   Reply to topic    EControl Ltd. Forum Index -> EControl Syntax Editor
View previous topic :: View next topic  
Author Message
mstaszew



Joined: 21 Jul 2006
Posts: 67
Location: North Carolina, USA

PostPosted: Wed May 13, 2009 1:38 pm    Post subject: Lexer parser rules expression not working correctly Reply with quote

I am not sure what exactly is going on, but let me explain what I'm seeing.

I have some text in the editor that is a mix of ASCII and Korean characters. I have a parser rule with the expression set to [\l]+. When I mouse over the editor I have code set to retrieve TokenAtPos. The return value is -1 for the Korean whereas it is something valid for the ASCII. I have a highlighting style as well set that is not coloring the Korean correctly. On the other hand, if I use that expression in the Find dialog then it correctly locates the Korean text as well as the ASCII.

Also, if I add Korean directly to the conditions list of a Tag Detector rule then the Korean is not colored correctly either.

Thanks,
Michael
Back to top
View user's profile Send private message
econtrol
Site Admin


Joined: 09 Jun 2006
Posts: 202

PostPosted: Mon May 18, 2009 5:25 pm    Post subject: Reply with quote

Hello,

In lexers option (?r) is by default off. So \l metaclass is equal to \g (i.e. latin letter) .
To process national characters (depending on chracter set of the lexer) add option (?r).
Instead of
Code:
\l+

use
Code:
(?r)\l+
Back to top
View user's profile Send private message Send e-mail
mstaszew



Joined: 21 Jul 2006
Posts: 67
Location: North Carolina, USA

PostPosted: Wed May 27, 2009 3:01 pm    Post subject: Reply with quote

Thanks. This works as expected.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    EControl Ltd. Forum Index -> EControl Syntax Editor All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group