Nested outline elem error

13 views
Skip to first unread message

Jens

unread,
Nov 24, 2012, 8:06:08 PM11/24/12
to Colorer
Im modifing the SML coloring to work for Haskell.

I what to create a outline element for each line where text starts at
the first line, and capture the first word. I use the following regex
to do this:

<regexp match="/^(?{def:Outlined}[_\w]+)/ix"/>

This seems to work reasonably. Except that most of the time one
function gets nested into the previous in the outline.

Like this:

fn1 :: a -> a
fn1 a = ...
fn1 b = ...

fn2 :: a -> a
fn2 a = ...
fn2 b = ...

Outline:

fn1
fn1
f1
f2
f2
f2

I would expect to have them on the same level. I can for my life
figure out why. Can anyone help me?

Here is the complete hrc file:
http://pastebin.com/d882TnPh

The outline thing is near the end.

Thanks!

Jens

unread,
Nov 24, 2012, 8:22:05 PM11/24/12
to Colorer
Sorry, the last message had confusing errors and many language
mistakes. I repost the entire thing.

I'm modifying the SML coloring to work for Haskell.

I want to create an outline element for each line on which the text
starts at
the first column, and capture the first word. I use the following
regex
to do this:

<regexp match="/^(?{def:Outlined}[_\w]+)/ix"/>

This seems to work reasonably well. Except that most of the time one
function gets nested inside the previous in the outline.

Like this:

fn1 :: a -> a
fn1 a = ...
fn1 b = ...

fn2 :: a -> a
fn2 a = ...
fn2 b = ...

Outline:

fn1
fn1
f1
f2
f2
f2

I would expect to have them on the same level. I can't for my life

Igor Russkih

unread,
Nov 24, 2012, 8:28:41 PM11/24/12
to colorer
Hi.

Incremented levels are due to the fact that colorer sees more and more deep nesting of constructions.

This could be due to some bug in SML coloring, which uncloses some of function description blocks. Try to find what is unclosed and fix that.

  Igor

Jens

unread,
Nov 25, 2012, 8:26:36 AM11/25/12
to Colorer
Thanks for your help.

> Incremented levels are due to the fact that colorer sees more and more deep nesting of constructions.

That was what I figured also, but it was hard to understand why.

I still don't understand, but when I randomly removed the code bellow
the problem went away. :)

<block start="/\b(let|local|with|struct|sig)\b/" end="/\b(end)\b/"
scheme="sml"
region01="Keyword" region00="PairStart"
region10="Keyword" region11="PairEnd"/>

Igor Russkih

unread,
Dec 2, 2012, 8:03:31 PM12/2/12
to colorer
Jens, think the issue is that the mentioned block is too generic and sometimes is not closed..

  Igor
Reply all
Reply to author
Forward
0 new messages