Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Style number assumptions for LexPerl variable interpolation
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  14 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
KHMan  
View profile  
 More options Aug 9 2011, 10:15 pm
From: KHMan <keinh...@gmail.com>
Date: Wed, 10 Aug 2011 10:15:30 +0800
Local: Tues, Aug 9 2011 10:15 pm
Subject: Style number assumptions for LexPerl variable interpolation
Looks like I'll use 9 new styles to do basic variable
interpolation highlighting of $<identifier> and @<identifier> in
the various quote[-like] operator strings:

     "" qq{} `` qx{} // m{} qr{} s{}{} <<HERE

For things like qq{}, interpolation highlighting is not done when
the a single quote delimiter is used. Skipping highlighting of
more complex forms like $a[1], $b->{key} etc. Too much of talk of
'heuristics' in the documentation... leaving that for another day.
Also skipping highlighting of interpolated special variables
except for the usual $_ and @_.

This is roughly the behaviour of the oldish gvim and Komodo I have
currently, although they do not seem to do variable interpolation
highlighting for <<HERE blocks.

For the new style numbers, the plan is they are offset in value
from the parent style by a fixed, identical constant, in case I
want to use that behaviour. If this assumption is not desirable,
let me know and I'll skip the use of this assumption.

--
Cheers,
Kein-Hong Man (esq.)
Kuala Lumpur, Malaysia


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
KHMan  
View profile  
 More options Aug 11 2011, 11:42 am
From: KHMan <keinh...@gmail.com>
Date: Thu, 11 Aug 2011 08:42:30 -0700 (PDT)
Local: Thurs, Aug 11 2011 11:42 am
Subject: Re: Style number assumptions for LexPerl variable interpolation
On Aug 10, 10:15 am, KHMan wrote:

> Looks like I'll use 9 new styles to do basic variable
> interpolation highlighting of $<identifier> and @<identifier> in
> the various quote[-like] operator strings:

>      "" qq{} `` qx{} // m{} qr{} s{}{} <<HERE

Preliminary work code and test cases (simple variable interpolation
for double-quoted strings only):
http://sites.google.com/site/rubblepiles/scintilla-and-scite-stuff/Le...

--
Cheers,
Kein-Hong Man (esq.)
Kuala Lumpur, Malaysia


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Neil Hodgson  
View profile  
 More options Aug 11 2011, 7:26 pm
From: Neil Hodgson <nyamaton...@gmail.com>
Date: Fri, 12 Aug 2011 09:26:27 +1000
Local: Thurs, Aug 11 2011 7:26 pm
Subject: Re: [scintilla] Re: Style number assumptions for LexPerl variable interpolation
KHMan:

> Preliminary work code and test cases (simple variable interpolation
> for double-quoted strings only):

   VarInterpolation doesn't need to be marked with SCI_METHOD since it
is only used locally. SCI_METHOD is there to force a particular
calling convention (stdcall) so that lexers can be used if they are
separately compiled from Scintilla with a different calling convention
as may be the case with external lexers. Forcing stdcall on a method
may stop compiler optimizations like using fastcall or thiscall.

   Otherwise, it looks good.

   Neil


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
KHMan  
View profile  
 More options Aug 11 2011, 8:44 pm
From: KHMan <keinh...@gmail.com>
Date: Fri, 12 Aug 2011 08:44:32 +0800
Local: Thurs, Aug 11 2011 8:44 pm
Subject: Re: [scintilla] Re: Style number assumptions for LexPerl variable interpolation
On 8/12/2011 7:26 AM, Neil Hodgson wrote:

> KHMan:
>> Preliminary work code and test cases (simple variable interpolation
>> for double-quoted strings only):

>     VarInterpolation doesn't need to be marked with SCI_METHOD since it
> is only used locally. SCI_METHOD is there to force a particular
> calling convention (stdcall) so that lexers can be used if they are
> separately compiled from Scintilla with a different calling convention
> as may be the case with external lexers. Forcing stdcall on a method
> may stop compiler optimizations like using fastcall or thiscall.

OK

>     Otherwise, it looks good.

--
Cheers,
Kein-Hong Man (esq.)
Kuala Lumpur, Malaysia

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ahmad M. Zawawi  
View profile  
 More options Aug 12 2011, 6:56 am
From: "Ahmad M. Zawawi" <ahmad.zaw...@gmail.com>
Date: Fri, 12 Aug 2011 03:56:45 -0700 (PDT)
Local: Fri, Aug 12 2011 6:56 am
Subject: Re: Style number assumptions for LexPerl variable interpolation
Thanks for the great patch.

I took the liberty of including it in Wx::Scintilla 0.21_05 which is
found at:
https://metacpan.org/release/AZAWAWI/Wx-Scintilla-0.21_05

Now Padre (http://padre.perlide.org) and other Wx-based Perl editors
can utilize your awesome patch right away.

Note: 'perl -c perl-test-interpolation.pl' fails. Is it that intended?
--
Thanks,
Ahmad M. Zawawi

On Aug 12, 3:44 am, KHMan <keinh...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
KHMan  
View profile  
 More options Aug 12 2011, 7:25 am
From: KHMan <keinh...@gmail.com>
Date: Fri, 12 Aug 2011 19:25:52 +0800
Local: Fri, Aug 12 2011 7:25 am
Subject: Re: [scintilla] Re: Style number assumptions for LexPerl variable interpolation
On 8/12/2011 6:56 PM, Ahmad M. Zawawi wrote:

> Thanks for the great patch.

> I took the liberty of including it in Wx::Scintilla 0.21_05 which is
> found at:
> https://metacpan.org/release/AZAWAWI/Wx-Scintilla-0.21_05

> Now Padre (http://padre.perlide.org) and other Wx-based Perl editors
> can utilize your awesome patch right away.

Hey, not so fast. It's just a preview, I pinged and got the
feedback I need from Neil.

I've done "" qq{} `` qx{}, hope to finish it before the end of the
month. A few hundred more test cases to check...

The final to-be-applied version will be posted to the Scintilla SF
feature tracker. You can grab it once it gets into hg.

> Note: 'perl -c perl-test-interpolation.pl' fails. Is it that intended?

Hmmm... perhaps you should look at the contents of the file. :-)

--
Cheers,
Kein-Hong Man (esq.)
Kuala Lumpur, Malaysia

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ahmad M. Zawawi  
View profile  
 More options Aug 12 2011, 9:14 am
From: "Ahmad M. Zawawi" <ahmad.zaw...@gmail.com>
Date: Fri, 12 Aug 2011 06:14:02 -0700 (PDT)
Local: Fri, Aug 12 2011 9:14 am
Subject: Re: Style number assumptions for LexPerl variable interpolation
I released it in as a *developer* version to CPAN as part of the
transition from Scintilla 1.x to scintilla latest. So it is not a big
deal. I am also working on a Perl 6 lexer for Scintilla. Basically
we're backporting Wx::STC binding to use scintilla latest over older
wxWidgets 2.8.x platforms.

Please keep us up-to-date with LexPerl.cxx changes. As soon as I have
a working LexPerl6.cxx, i'll post it on this group.

--
Thanks,
Ahmad M. Zawawi

On Aug 12, 2:25 pm, KHMan <keinh...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
KHMan  
View profile  
 More options Aug 12 2011, 10:06 am
From: KHMan <keinh...@gmail.com>
Date: Fri, 12 Aug 2011 22:06:55 +0800
Local: Fri, Aug 12 2011 10:06 am
Subject: Re: [scintilla] Re: Style number assumptions for LexPerl variable interpolation
On 8/12/2011 9:14 PM, Ahmad M. Zawawi wrote:

> I released it in as a *developer* version to CPAN as part of the
> transition from Scintilla 1.x to scintilla latest. So it is not a big
> deal. I am also working on a Perl 6 lexer for Scintilla. Basically
> we're backporting Wx::STC binding to use scintilla latest over older
> wxWidgets 2.8.x platforms.

> Please keep us up-to-date with LexPerl.cxx changes.

Easy, use automation -- make sure you're signed up for:
http://groups.google.com/group/scintilla-tracker

Variable interpolation is the last biggie that's missing from
LexPerl. I don't remember anything else that's really worth doing
for LexPerl...

> As soon as I have
> a working LexPerl6.cxx, i'll post it on this group.

Good to know, and looking forward to writing some Perl 6 on SciTE.
I never got started on doing anything serious on Perl 6. If you
have a good set of tests for Perl 6 highlighting, I'd be
interested to dabble in it in the (very vague) future. IMHO, it
was possible to get Perl 5 highlighted mostly correctly mainly by
amassing a large set of test cases.

--
Cheers,
Kein-Hong Man (esq.)
Kuala Lumpur, Malaysia


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
KHMan  
View profile  
 More options Aug 13 2011, 2:38 pm
From: KHMan <keinh...@gmail.com>
Date: Sun, 14 Aug 2011 02:38:19 +0800
Local: Sat, Aug 13 2011 2:38 pm
Subject: Re: [scintilla] Re: Style number assumptions for LexPerl variable interpolation
On 8/12/2011 9:14 PM, Ahmad M. Zawawi wrote:

>[snip]
> Please keep us up-to-date with LexPerl.cxx changes. As soon as I have
> a working LexPerl6.cxx, i'll post it on this group.

Interim code. Basic variable interpolation for:
"" qq{} `` qx{} // m{} qr{} s{}{}

Still to do: HERE docs.

http://sites.google.com/site/rubblepiles/scintilla-and-scite-stuff/Le...

--
Cheers,
Kein-Hong Man (esq.)
Kuala Lumpur, Malaysia


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ahmad Zawawi  
View profile  
 More options Aug 14 2011, 7:32 am
From: Ahmad Zawawi <ahmad.zaw...@gmail.com>
Date: Sun, 14 Aug 2011 14:32:30 +0300
Local: Sun, Aug 14 2011 7:32 am
Subject: Re: [scintilla] Re: Style number assumptions for LexPerl variable interpolation
Cool update.

By the way, I started experimenting more with LexPerl.cxx improved
styles using Wx::Scintilla
http://padre.perlide.org/trac/browser/trunk/Wx-Scintilla/share/perl_e...

One thing to note,  $self->SetStyleBits(7) is needed otherwise we'll
have indicators all over the place. Am i doing something wrong here?
GetStyleBitsNeeded() still reports only 5 needed bits.

Regards,
Ahmad M. Zawawi


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
KHMan  
View profile  
 More options Aug 14 2011, 7:36 am
From: KHMan <keinh...@gmail.com>
Date: Sun, 14 Aug 2011 19:36:56 +0800
Local: Sun, Aug 14 2011 7:36 am
Subject: Re: [scintilla] Re: Style number assumptions for LexPerl variable interpolation
On 8/14/2011 7:32 PM, Ahmad Zawawi wrote:

> Cool update.

> By the way, I started experimenting more with LexPerl.cxx improved
> styles using Wx::Scintilla
> http://padre.perlide.org/trac/browser/trunk/Wx-Scintilla/share/perl_e...

> One thing to note,  $self->SetStyleBits(7) is needed otherwise we'll
> have indicators all over the place. Am i doing something wrong here?
> GetStyleBitsNeeded() still reports only 5 needed bits.

Yes, I think. (I hack lexers only, I'm all at sea with the other
bits of Scintilla.)

--
Cheers,
Kein-Hong Man (esq.)
Kuala Lumpur, Malaysia


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Neil Hodgson  
View profile  
 More options Aug 14 2011, 7:54 pm
From: Neil Hodgson <nyamaton...@gmail.com>
Date: Mon, 15 Aug 2011 09:54:04 +1000
Local: Sun, Aug 14 2011 7:54 pm
Subject: Re: [scintilla] Re: Style number assumptions for LexPerl variable interpolation
Ahmad Zawawi:

> One thing to note,  $self->SetStyleBits(7) is needed otherwise we'll
> have indicators all over the place. Am i doing something wrong here?
> GetStyleBitsNeeded() still reports only 5 needed bits.

   SCI_GETSTYLEBITSNEEDED returns 8 for me. The number of bits is set
as the last parameter in the LexerModule constructor:
LexerModule lmPerl(SCLEX_PERL, LexerPerl::LexerFactoryPerl, "perl",
perlWordListDesc, 8);

   Neil


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
KHMan  
View profile  
 More options Aug 15 2011, 8:20 am
From: KHMan <keinh...@gmail.com>
Date: Mon, 15 Aug 2011 05:20:36 -0700 (PDT)
Local: Mon, Aug 15 2011 8:20 am
Subject: Re: Style number assumptions for LexPerl variable interpolation
On Aug 14, 2:38 am, KHMan wrote:

> On 8/12/2011 9:14 PM, Ahmad M. Zawawi wrote:
> >[snip]
> > Please keep us up-to-date with LexPerl.cxx changes. As soon as I have
> > a working LexPerl6.cxx, i'll post it on this group.

Interim code. One or two more things to do before submitting to the
tracker.

http://sites.google.com/site/rubblepiles/scintilla-and-scite-stuff/Le...

Basic variable interpolation done:
"" qq{} `` qx{} // m{} qr{} s{}{} here-docs

One style added for tr{}{} y{}{} translations which do not have
interpolation.

Some colours adjusted for the SciTE properties file, but then I not
real picky. The adjustment is intended that any interpolated variable
in various types of quoted blocks is darkish-red. Users welcome to
propose changes if their eyes hurt... :-)

TODO:
(1) Special variables (other than $_ and @_ which already work). Will
need it otherwise users will be wondering why they do not work, except
for // m{} qr{} s{}{} (unless some kind of reliable ruleset can be
divined).
(2) ${bareword} @{bareword} if it does not involve ripping up too much
code. Elsewhere, things like "$a[$i]" looks quite nice already;
parsing the entire var spec seems like overkill.

--
Cheers,
Kein-Hong Man (esq.)
Kuala Lumpur, Malaysia


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
KHMan  
View profile  
 More options Aug 17 2011, 3:28 am
From: KHMan <keinh...@gmail.com>
Date: Wed, 17 Aug 2011 00:28:03 -0700 (PDT)
Local: Wed, Aug 17 2011 3:28 am
Subject: Re: Style number assumptions for LexPerl variable interpolation
On Aug 15, 8:20 pm, KHMan wrote:

>[snipped all]

Interim code. A few more things to do and more testing. Special
variables are now interpolated for:
"" qq{} `` qx{}

http://sites.google.com/site/rubblepiles/scintilla-and-scite-stuff/Le...

The kinds of additional patterns recognized are:
${word} @{word} and things like $${word}
$#{word} @#{word} and things like $#${word}
${digit} @{digit}
$$ and most special variables with operator chars
$0 to $9 and things like $123 (perl seem to greedily lex)
$^A and other control char special variables

InterpolateSegment() is the new code for variable interpolation. Once
the others (// m{} qr{} s{}{} here-docs) are shifted too, the older
VarInterpolation() will be deleted. The new code is closer to the way
Perl parses quoted operators and is less likely to exhibit glitches.

--
Cheers,
Kein-Hong Man (esq.)
Kuala Lumpur, Malaysia


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »