Re: [textadept] Simple Pattern-Based Folding in Lexers

From: mitchell <c....at.caladbolg.net>
Date: Sun, 15 May 2011 13:49:16 -0400 (EDT)

On Sun, 15 May 2011, mitchell wrote:

> Hi everyone,
>
> I have commited code to Scintillua (http://scintillua.googlecode.com) that
> allows for simple pattern-based code folding to be defined in lexers instead
> of full _fold() functions. I have implemented this folding for the lua and
> cpp lexers for reference. Lexer authors, please see the appropriate
> documentation in lexer.lua (search for "Simple Code Folding"). Here is a
> snippet for folding Lua:

I forgot to mention that LexLPeg.cxx was also changed so in order to test,
you will have to recompile ta.

mitchell

>
> _foldsymbols = {
> _patterns = { '%l+', '[%({%)}%[%]]' },
> keyword = {
> ['if'] = 1, ['do'] = 1, ['function'] = 1, ['repeat'] = 1,
> ['end'] = -1, ['until'] = -1
> },
> operator = { ['('] = 1, ['{'] = 1, [')'] = -1, ['}'] = -1 },
> comment = { ['['] = 1, [']'] = -1 },
> longstring = { ['['] = 1, [']'] = -1 }
> }
>
> Note that this is an experimental feature subject to change. Comments are
> welcome.
>
> mitchell
>
> --
> You received this message because you are subscribed to the Google Groups
> "textadept" group.
> To post to this group, send email to textadept.at.googlegroups.com.
> To unsubscribe from this group, send email to
> textadept+unsubscribe.at.googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/textadept?hl=en.
>
>

mitchell
Received on Sun 15 May 2011 - 13:49:16 EDT

This archive was generated by hypermail 2.2.0 : Thu 08 Mar 2012 - 12:07:15 EST