[code] Re: Debugging language modules

From: Arnel <jalespring.att.gmail.com>
Date: Sun, 27 Mar 2016 01:10:22 +0800

Hey Robert,

On Sat, 26 Mar 2016 17:20:23 +0100, Robert Gieseke <rob.g.att.web.de> wrote:
> > - Is there a better way to debug lexer modules? The Racket lexer I'm working on
> > was based off the Scheme lexer file provided with TA. I've read somewhere in
> > the API manual that troubleshooting lexers can be tricky and it's recommended
> > to run TA in the terminal to get the error messages. I tried this but I didn't
> > get any. Those who have written lexers for other languages before - any
> > pointers? Anything on seeing what's actually captured by the LPEG expressions
> > would be great.
> One option is to use Scintillua as a standalone library, there is an
> example in the manual[1]. It might help to really understand and test a
> single pattern.
> [1]
> http://foicica.com/scintillua/manual.html#Using.Scintillua.as.a.Lua.Library

Heh, I hadn't expected looking into that part of Mitchell's site before. Guess
this should be a good time as any.
> > - Is it possible to change the background color of highlighted
> > brackets and parentheses when looking for their pairs? There doesn't appear to
> > be anything related mentioned in the buffer API for it.
> In your properties.lua file you can overwrite Textadept's defaults, this
> gives me a red box (with Solarized theme):
> local INDIC_BRACEMATCH = textadept.editing.INDIC_BRACEMATCH
> buffer.indic_style[INDIC_BRACEMATCH] = buffer.INDIC_FULLBOX
> buffer.indic_fore[INDIC_BRACEMATCH] = buffer.property_int['color.base08']
> buffer:brace_highlight_indicator(not CURSES, INDIC_BRACEMATCH)
> (I use a base16 theme, so you might not have other colors defined, you
> could also specify a color directly.)

Thanks. I got there by:

buffer.indic_style[INDIC_BRACEMATCH] = buffer.INDIC_ROUNDBOX
buffer.indic_fore[INDIC_BRACEMATCH] = property_int['color.cyan']
buffer.indic_alpha[INDIC_BRACEMATCH] = 100
buffer.indic_outline_alpha[INDIC_BRACEMATCH] = 50

Setting the buffer.indic_alpha and buffer.indic_outline_alpha adjust the
opacity. However, it's too bad there's no complement 'buffer:indic_back'
table to allow, for example, simply reversing the foreground/background colors
which is usually the case with other editors with similar bracket-matching
features. As it is now, both the bracket itself *and* the background color
*and* the outline are colored the same.

Perhaps a feature request sometime in the future?

Thank you,
You are subscribed to code.att.foicica.com.
To change subscription settings, send an e-mail to code+help.att.foicica.com.
To unsubscribe, send an e-mail to code+unsubscribe.att.foicica.com.
Received on Sat 26 Mar 2016 - 13:10:22 EDT

This archive was generated by hypermail 2.2.0 : Sun 27 Mar 2016 - 06:43:14 EDT