[Gambas-user] New highlighting component (episode 2)
Bruce Steers
bsteers4 at gmail.com
Sun Oct 29 02:23:47 CEST 2023
On Sun, 29 Oct 2023 at 00:42, Benoît Minisini <
benoit.minisini at gambas-basic.org> wrote:
> Le 29/10/2023 à 01:00, Benoît Minisini a écrit :
> > Le 29/10/2023 à 00:50, Bruce Steers a écrit :
> >> after is required to be a comment.
> >>
> >>
> >> It is # anywhere in a line starts a comment just NOT if it is inside
> >> {curly braces}
> >> i changed
> >> from #
> >> to be...
> >> from /#\s/
> >>
> >> but it's a workaround as i do not know syntax for # if it's not inside
> >> { }
> >
> > What does "#" mean when it is between { and }?
> >
>
> I tried to enhance 'sh' highlighting after having quickly read bash
> documentation.
>
> The bash is cumbersome, so it will never be perfect.
>
yep, it's all over the place.
making the original sh file took a lot of tweaking and testing, it wasn't
perfect but i hit an "it will do" stage when i thought it was doing a
better job than pluma shell highlighting.
>
> Especially the definition file syntax does not allow implicit recursion,
> i.e. you can't say easily, for example, that inside a double quote
> string you have the same substitution than at top level, without writing
> the commands twice.
>
yep it looks interesting when you load something really complex like a
makefile
>
> But the goal of that definition file is to kept things simple, and make
> the file readable. Not to fully understand its syntax.
>
yeah , i will look at improving sh.
i notice your definition files have things that will need your
documentation like for example you have this for operators in cplusplus
operator.mul{Function}:
match /\*\s/
operator:
symbol { } . ; ( , ) [ :: ] -> ? : <=> ->* .* *
operator.action{Function}:
symbol = >= + << ! >>= == - >> ~ += != && -= &= < % & || *= |= > ++ | %=
^= -- ^ <<= <= / /=
I have no idea what that's all about but i'm sure it will make sense to me
some time :)
> If you want to see what I mean, look at the powerful XML highlight
> definition file of Kate and compare. I join it to the mail. 103 Ko
> against 1,5 Ko in Gambas. But it should handle bash syntax correctly (I
> guess).
>
wow , well one step at a time eh :)
Respects
BruceS
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20231029/15a48cdb/attachment.htm>
More information about the User
mailing list