code folding for Assembly Language...

Syntax highlighting, code folding, brace matching, code indenting, and function list

code folding for Assembly Language...

Postby ueisok » Sat Jul 29, 2006 11:06 am

Is anyone able to achieve code folding for assembly language?

I came across several issues while trying to do the same. I imported the language syntax file into wordfile.txt. My .ASM files are correctly recognized as an assembly file and syntax highlighting works as expected. Although code folding does not work and that with assembly language becomes most important feature - since this files can grow pretty large quickly.

I created following lines for code folding.

/L20"Assembler x86" Nocase Line Comment = ; File Extensions = ASM
/Function String = "%[a-zA-Z0-9_@?$]+[ ^t]+proc+[ ^t^p]"
/Open Fold Strings = ";{"
/Close Fold Strings = ";}"
/C1

I am trying to use ;{ and ;} as my open/close folder marks since ; is the comment character. Once saved - I hoped that UE will recognize my code blocks and show the block begin/close section on the gutter with "-" and "+" characters.

UE does not recognize code folder begin/end characters.

Also each time I need to fold a block of code, I need to select it - then do - View->Hide/Show Lines->Hide/Show Selection. This is getting tedious.

Can anyone help? What am I doing wrong here?

Thanks!
User avatar
ueisok
Newbie
 
Posts: 2
Joined: Fri Jul 28, 2006 11:00 pm

Re: code folding for Assembly Language...

Postby Mofi » Sat Jul 29, 2006 3:38 pm

ueisok wrote:UE does not recognize code folder begin/end characters.

UE will not recognize your open and fold strings because they are inside a line comment. Line comments are ignored for code folding. But I think you don't need to add line comments for code folding. I'm not familiar with the x86 assembler syntax, but I have modified my wordfiles for the C166/ST10 assembler of TASKING with open/close fold strings. Here are my definitions for this assembler:

/L20"C166 ASM Tasking" Nocase Line Comment = ; String Chars = "' EnableMLS File Extensions = ASM LST SRC
/Delimiters = " #tab'()+,-:;?[]
/Function String = "%^([0-9a-z_]+^)[ ^t]+PROC"
/Open Brace Strings = "("
/Close Brace Strings = ")"
/Open Fold Strings = "PROC" "@IF" "@ELSE" "SECTION"
/Close Fold Strings = "ENDP" "@ELSE" "@ENDI" "ENDS"

tab is a place holder for a real horizontal tab (hex code 0x09) which is displayed as normal space by WWW browsers.

According to your function string the x86 assembler has also PROC as keyword for a new procedure (function). Maybe it also has ENDP as keyword for end of a procedure. And I guess, the x86 assembler also knows the other keywords I have used for the Tasking C166/ST10 assembler.

Hm, that post reminds me to sent IDM my updated wordfiles for their collection.
User avatar
Mofi
Grand Master
Grand Master
 
Posts: 4058
Joined: Thu Jul 29, 2004 11:00 pm
Location: Vienna

Re: code folding for Assembly Language...

Postby ueisok » Tue Aug 01, 2006 6:50 am

Nice!

Really. I was thinking on the wrong direction. I should have used PROC, ENP and ENDS as they are truely blocking strings for Assembly language.

Thanks for replying.

DP
User avatar
ueisok
Newbie
 
Posts: 2
Joined: Fri Jul 28, 2006 11:00 pm


Return to Syntax Highlighting