[code] Debugging language modules

From: Arnel <jalespring.att.gmail.com>
Date: Sat, 26 Mar 2016 23:22:47 +0800


I am currently working on a language module for Racket (formerly PLT Scheme).
Here are the questions I have:

- I have the following lines in the 'init.lua' file for the Racket module:

textadept.file_types.extensions.rkt = 'racket'
textadept.run.run_commands.racket = 'racket "%f"'
textadept.run.error_patterns[#textadept.run.error_patterns + 1] = '^(.-):(%d+):%
d+: (.+)$' textadept.run.syntax_commands.racket = 'racket -f "%f"'
textadept.run.syntax_error_patterns.racket = ':(%d+):%d+: (.+)'
textadept.editing.comment_string.racket = ";"

However, if I open a Racket script and try testing the syntax checking, nothing
happens. The 'init.lua' file is located inside the 'racket' directory inside
'~/.textadept/modules'. If I run


from the command entry, I come up with plain 'nil'. Why is that?

If I place these lines in my regular '~/.textadept/init.lua', the syntax
checking works fine.

- 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.

(There's a PEG trace module available at Github[0], but I'm not sure how to
integrate it into troubleshooting lexers with TA.)

- 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.

Thanks in advance.

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 - 11:22:47 EDT

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