Problems in XML and SyntaxEditor

SyntaxEditor for Windows Forms Forum

Posted 14 years ago by tal
Avatar
I have a 15 day demo of SyntaxEditor v3.1.210.0, .NET 2.0 and Windows XP.
I have a macro for URLs (from Actipro) but I don't know how to fix it so it will contian those URLs:
1) When a letter or nore in http is uppercase:
HTTP://actipro
HttP://actipro
2) When there are more than 1 varaibles:
http://actipro.com/forum.asp?ID=1&Post=1

And I have another problem, I'm trying to creat a C program and I need in the C lang. a ASM lang. so i did it but i can't seem to close the ASM scope; for example:

#include "a"
call x
_asm
call x
_endasm
call x
The first "call" is black, the second and 3rd is blue, and "_asm" is blue but "_endasm" is black.
this is the scope's XML:

<State Key="ASMDefaultState" TokenKey="ASMDefaultStateToken">
    <!-- Scopes -->
    <Scopes>
        <Scope>
            <ExplicitPatternGroup Type="StartScope" TokenKey="ASMDirectiveStartToken" Style="ASMDelimiterStyle" PatternValue="_asm" />
            <RegexPatternGroup Type="EndScope" TokenKey="ASMDirectiveEndToken" Style="ASMDelimiterStyle" PatternValue="_endasm" />
        </Scope>
    </Scopes>
    <!-- Patterns Groups -->
    <PatternGroups>
        ...
    </PatternGroups>
    <!-- Child States -->
    <ChildStates>
        ...
    </ChildStates>
</State>
One more thing, how can I make SyntaxEditor to fixup my case (upper/lower) auto?

Can someone help me?
10x, Tal.

[Modified at 06/20/2006 05:15 AM]

Comments (6)

Posted 14 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Tal,

1) Good find on the URLMacro... here is a better version:
<Macro Key="URLMacro" Value="[hH][tT][tT][pP][sS]?:// [\w\-]+ (\. [\w\-]+)* (/ [\w\-./?%=&amp;]*)?" />
2) I'd have to see your whole language definition to be able to figure out what is wrong. Basically the way we debug language definition problems is simply to load them in the sample project. There is an option on the Language menu to load a Custom language. Once loaded, add some sample code in the editor. Then move the caret around. The statusbar will show you what lexical state and pattern were matched to each character (the one next to the caret). If you see an asterisk (*) next to the token name, that means that that character starts a token.

By doing this, whenever you see that something isn't highlighted correctly you can determine what token as assigned to the text. Often problems like yours are because you may have another pattern that SyntaxEditor matches before the one you really want. You have to remember to keep them in order since SyntaxEditor matches them in order and will quit at the first match for speed optimization reasons.

So if you had a language with "=" as an assignment and "==" as an equality test and you wanted to differentiate between them, always put the "==" pattern first because otherwise SyntaxEditor will match two instances of the "=" pattern.

I hope this helps and if you are still stuck then email us your language definition with example code in it.

3) You can add CaseSensitivity="AutoCorrect" to each pattern group tag. Then you also ensure that Document.AutoCaseCorrectEnabled is true.


Actipro Software Support

Posted 14 years ago by tal
Avatar
10x I fixed it all.

But there is a new problem:
In SyntaxEditor C# lang. If I put this passage in your app then:

asd "
a
The " is the StringStartToken from the left and a StringEndToken from the right.
The last 'a' is to make the end of the first line not the end of the document.

One more thing, In UIStudio, how can I change the visibility state of an exsiting button on a Bar?

10x alot, Tal.
Posted 14 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Strings in C# terminate on a line feed if you don't have the end quote on the same line. Visual Studio works like that and our definition does too.

For your UIStudio question, this code will do that sort of thing:
barManager.DockableToolBars["Standard"].CommandLinks["File.New"].Visible = false;


Actipro Software Support

Posted 14 years ago by tal
Avatar
10x I fixed the bar, but if I want a string to include a new line?
how can I do that?

Tal
Posted 14 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Look at the verbatim string pattern group in the C# definition. That shows a string that allows newlines like C# does.

The problem with having strings include newlines is that as the end user types a quote character the entire rest of the document will "flip" between string and non-string until the next quote is typed. If you have a large document open and you are typing at the top, this could slow down the response time since there is a lot of parsing involved in that case.


Actipro Software Support

Posted 14 years ago by tal
Avatar
10x you have helped me alot!

Tal
The latest build of this product (v2020.1 build 0400) was released 24 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.