Line Comment for AS400/RPG

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

Line Comment for AS400/RPG

Postby 1.01 » Mon Dec 07, 2009 3:06 am

Hi,
I want to define a regular expression for Line Comment.

It should be :
1. If position 7 is a '*' character, then comment all the line;
2. Whatever shows from position 81, comment all from position 81 to the line end.

Now I just can make 1. work via:
Code: Select all
Line Comment = * Line Comment Valid Columns = [7]

But I have no ideas for 2. Is there any kindly to help this? Thanks a lot.
1.01
Newbie
 
Posts: 2
Joined: Mon Dec 07, 2009 2:57 am

Re: Line Comment for AS400/RPG

Postby Mofi » Mon Dec 07, 2009 5:38 am

The second rule is not really possible because regular expressions are not possible yet (=UE v15.20.0.1022) except for function strings. And for line comments there must be a comment starting string. I can only suggest following:

Line Comment Num = 1  Line Comment Valid Columns = [80] Line Comment Alt = * Line Comment Valid Columns Alt = [7]

Please note: There are 2 spaces after Line Comment Num = 1.

With this definition everything after column 80 is highlighted as comment when in column 80 there is a space character. To be 100% correct the space at column 80 is also highlighted as comment which of course you can see only when using a different background color for comments.

You can also use

Line Comment Num = 1  Line Comment Valid Columns = [80-4095] Line Comment Alt = * Line Comment Valid Columns Alt = [7]

to start line comment highlighting with first space found after column 79.
User avatar
Mofi
Grand Master
Grand Master
 
Posts: 4055
Joined: Thu Jul 29, 2004 11:00 pm
Location: Vienna

Re: Line Comment for AS400/RPG

Postby 1.01 » Mon Dec 07, 2009 9:57 pm

Thank you. It's totally clear now.
1.01
Newbie
 
Posts: 2
Joined: Mon Dec 07, 2009 2:57 am


Return to Syntax Highlighting