Would you like to react to this message? Create an account in a few clicks or log in to continue.

You are not connected. Please login or register

gcbasic Syntax file mod

2 posters

Go down  Message [Page 1 of 1]

1gcbasic Syntax file mod Empty gcbasic Syntax file mod Sun Jul 25, 2021 8:06 am

Tonigau



I have modified my gcbasic.sintax file for the CodeEditor to set the color highlighting closer to the GCB IDE that I am used to.
Line 48 (preprocessor) was also highlighting the whole line, changed to [\^]
A few of rules I can't get to work:
1. A line ending with semi colon:
2. Operators + - = / < > >= <=
3. A block comment (multilineComment)
   /*
     Commented code
     etc...
   */

I am still learning to understand the rule structure (without a good reference), looks like QRegExp is like RichText?
For the block comment it seems the functionality exists in source but I cant get the rule exression/structure right.

This is not that important & I appreciate there are other more pressing issues to deal with.

Observations:
The .gcb file extension must be lower case.\

gcbasic Syntax file mod Gcb_sy10
Attachments
gcbasic Syntax file mod AttachmentTestSintaxGCBasic.zip
You don't have permission to download attachments.
(2 Kb) Downloaded 1 times

2gcbasic Syntax file mod Empty Re: gcbasic Syntax file mod Sun Jul 25, 2021 10:37 am

arcachofo

arcachofo

I have modified my gcbasic.sintax file for the CodeEditor to set the color highlighting closer to the GCB IDE that I am used to.
Line 48 (preprocessor) was also highlighting the whole line, changed to [\^]
Thanks, following GCB IDE color highlighting looks a good idea.
Changes added to development version.

A few of rules I can't get to work:
1. A line ending with semi colon:
2. Operators + - = / < > >= <=
Can yo share what you tried?

3. A block comment (multilineComment)
  /*
    Commented code
    etc...
  */
Added block comment to sintax files (needs start and end expressions):

Code:

multiLineComment-style: #00a651 default false true
multiLineComment: "/\\*" "\\*/"


gcbasic Syntax file mod Gcb_si10

3gcbasic Syntax file mod Empty Re: gcbasic Syntax file mod Sun Jul 25, 2021 11:21 am

Tonigau



Using SimulIDE_0.4.15-SR1_Win64 (tested win32 same)

I did have that expression at some point multiLineComment: "/\\*" "\\*/"
But I still don't get block comment. (will have to try on my dev PC in the morning...)

4gcbasic Syntax file mod Empty Re: gcbasic Syntax file mod Sun Jul 25, 2021 9:43 pm

arcachofo

arcachofo

Using SimulIDE_0.4.15-SR1_Win64 (tested win32 same)

I did have that expression at some point multiLineComment: "/\\*" "\\*/"
But I still don't get block comment. (will have to try on my dev PC in the morning...)
This is in development version.
Not possible in 0.4.15.SR1.

5gcbasic Syntax file mod Empty Re: gcbasic Syntax file mod Mon Jul 26, 2021 12:24 am

Tonigau



ok thanks,  I test on "SimulIDE_0.5.16-R373_Win64"= no block highlight.

Can yo share what you tried?

I need to learn/refer more on Regular Expressions first...

6gcbasic Syntax file mod Empty Re: gcbasic Syntax file mod Mon Jul 26, 2021 2:36 am

Tonigau



Update:
The line end with semiColon : (Sub) is hilite ok now,

Code:
subroutine-style: #FF1493 default true false
 subroutine: "^(.*):"

For the operators it is part working... (see image line19)
Code:
operator-style: #800000 default true false
operator: "[\(\)\/\=\+\-\<\>]"
Looks like the < > are the problem, it works on regex101.com (without quotes)

Also need to workout how to exclude '/' character(divide) when it is an operator from hilite as comment color.

This detects hex number also...
Code:
number-style: #FF0000 default True false
number: "\b[0-9]+\b" "0[xX][0-9a-fA-F]+"

After its working then I need to check for missing operator/keyword etc...


gcbasic Syntax file mod Sub_ok10
Attachments
gcbasic Syntax file mod AttachmentTestSintax26-07.zip
You don't have permission to download attachments.
(3 Kb) Downloaded 2 times



Last edited by Tonigau on Mon Jul 26, 2021 5:44 am; edited 1 time in total (Reason for editing : Update text & zip)

7gcbasic Syntax file mod Empty Re: gcbasic Syntax file mod Mon Jul 26, 2021 9:10 am

arcachofo

arcachofo

Uploaded build at Rev 392.

This build has multiline comment functional.
Have a look at new readme_sintax.txt file.

8gcbasic Syntax file mod Empty Re: gcbasic Syntax file mod Mon Jul 26, 2021 11:34 am

Tonigau



I see the changes, no header in .sintax file, readme common to all.

Tested working for R392 winx64:
. multiline comment,
. subroutine,  
. number(now include hex numbers)
. divide chr is now operator color.
. operators is part working (see image circled) the < > characters are escaped so issue might be in the regexp engine ?

With the number rule it is working with 2 regexp on the same line.

gcbasic Syntax file mod R392_s10
Attachments
gcbasic Syntax file mod Attachmentgcbasic.sintax.zip
You don't have permission to download attachments.
(1 Kb) Downloaded 1 times

9gcbasic Syntax file mod Empty Re: gcbasic Syntax file mod Mon Jul 26, 2021 6:12 pm

arcachofo

arcachofo

. operators is part working (see image circled) the < > characters are escaped so issue might be in the regexp engine ?
htmlTag rule is interfering with < > characters.

Indeed I don't know why htmlTag rule is there....

With the number rule it is working with 2 regexp on the same line.
Yes, you can use several regexps for one style.
It is equivalent to create several rules with same style.
What you can't do is mixing a regexp and a word list  in the same rule.

10gcbasic Syntax file mod Empty Re: gcbasic Syntax file mod Tue Jul 27, 2021 12:09 am

Tonigau



I should have seen that... Sleep

Just commented the 2 lines

Code:
#htmlTag-style: #303078 default false false
#htmlTag: "<.*>"

11gcbasic Syntax file mod Empty Re: gcbasic Syntax file mod Tue Jul 27, 2021 1:52 am

Tonigau



Issue with subroutine rule:

Just need to include "only if contains no whitespace"
Attachments
gcbasic Syntax file mod AttachmentRegExColon.png
You don't have permission to download attachments.
(20 Kb) Downloaded 0 times

arcachofo likes this post

12gcbasic Syntax file mod Empty Re: gcbasic Syntax file mod Thu Jul 29, 2021 11:47 pm

Tonigau



Sub name Label hilite is working better now  
Code:
 Label: "^[A-Za-z_]\w+:"
It just needs to be at the start of line.
Tested in V16-R413

Update 2021-08-01:
Change rule name "Subroutine" to "Label" in gcbasic.sintax file

Note: gcb file loaded must be lower case extension.
Attachments
gcbasic Syntax file mod AttachmentSubSyntax.png
You don't have permission to download attachments.
(35 Kb) Downloaded 0 times
gcbasic Syntax file mod Attachmentgcbasic.sintax_2021-08-01.zip
You don't have permission to download attachments.
(1 Kb) Downloaded 0 times



Last edited by Tonigau on Sat Jul 31, 2021 11:51 pm; edited 2 times in total (Reason for editing : Make corrections to gcbasic.sintax file)

arcachofo likes this post

Sponsored content



Back to top  Message [Page 1 of 1]

Permissions in this forum:
You cannot reply to topics in this forum