Hi Niel,
I have solved the problem with a look ahead function. At the end of each
line that may require implicit folding I find the type of the next character
that is not space or comment.
> Looks like it is just the presence of the ':' that says
> the current level should be incremented then.
There a number of different constructs which are all quite different. But
the general pattern is <identifier> (<punctuation> <identifier)* where
punctuatuation is one of ':', ',', '('. A ')' implies an increase of block
level but may be followed by a '{', possibly on the following line, in some
constructs it is mandatory.
The following are all valid constructs where folding is implied by the
following line.
// the '+' is ignored (sets location as in previous object)
// , only start matching from the first identifier
+ Fixture, OpenableContainer
'huge black iron stove stove/oven/contraption/door' 'stove'
+ cottageDoorInside : Lockable, Door
-> cottageDoor 'door' 'door';
// skip modify, it is a keyword, start match on Immovable
modify Immovable
dobjFor(Purloin)
// skip class, it is a keyword
class Sweet : Dispensable, Food
desc = "It's a small, round, clear, <<sweetGroupBaseName>> boiled sweet. "
DefineTAction(Purloin)
cacheScopeList()
VerbRule(Purloin)
('purloin'|'pn') dobjList // here a '{' is not permitted
// function is a keyword so the match starts from currencyString
function currencyString(amount)
{ // explicit block, mandatory '{'
Thanks for your help, I'll send the updated files & some notes on
configuring scite to use the tads lexer later this week.
Michael
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf Of Neil Hodgson
> Sent: Tuesday, 17 May 2005 23:45
> To: [email protected]
> Subject: Re: [scintilla] TADS3 folding (was no subject)
>
> Michael Cartmell:
>
> > I want the folding to appear at the line "silverRing : Wearable"
> > whether or not the '{' is present.
>
> Looks like it is just the presence of the ':' that says
> the current level should be incremented then. So you have to
> work out the termination condition which appears to be seeing
> a ';' or '}'.
>
> Neil
>
> _______________________________________________
> Scintilla-interest mailing list
> [email protected]
> http://mailman.lyra.org/mailman/listinfo/scintilla-interest
>
_______________________________________________
Scintilla-interest mailing list
[email protected]
http://mailman.lyra.org/mailman/listinfo/scintilla-interest