Re: [code] Odd behaviour in v9.1 split views

From: Mitchell <m.att.foicica.com>
Date: Fri, 3 Feb 2017 09:59:20 -0500 (EST)

Hi Michael,

On Fri, 3 Feb 2017, Michael Richter wrote:

> OK, solved my particular issue, but it brings up the old problem of error
> reporting in lexers.
>
> Basically if the lexer is invalid for any reason, Textadept just throws up
> its hands and gives up. In this specific case, though, it throws up its
> hands and gives up in a hissy fit that screws with the formatting of all
> subsequent view splits, etc. in perpetuity. And the reason I didn't notice
> this is because Textadept doesn't deign to inform me when a lexer is bad.
>
> My gas lexer was an old one (pre-8.0, IIRC) that I hadn't updated to take
> into account some of the changes to the lexer support. To wit, I had a
> module (lexer_tools) that I used to provide me with some decently-named
> functions in place of the complicated and vaguely incoherent LPEG naming
> conventions. (E.g. local maybe = function(p) return p^-1 end). As of 8.0
> these stopped working ... when in separate modules. So this code sequence
> always failed:
>
> local lt = require 'lexer_tools'
> local maybe = lt.maybe
>
> ...
>
> --[[do something with]] maybe(P':') -- and so on
>
> But if I take the maybe function from lexer_tools and put it into the
> lexer's source file it all works as expected.
>
> Now I hadn't touched gas code in a while, so I didn't update the gas lexer
> -- and I forgot about that issue. The malfunction was triggered by
> invoking the (broken) gas lexer. The solution was to manually bring in
> those lexer_tools functions.
>
> Would it be possible to get some kind of error reporting from the lexer
> instead of the current silent failure? It would make debugging these kinds
> of problems much simpler.

Yes, that is a good idea. Sorry for all the trouble :( I do very much
appreciate the time you've taken to identify the issue. I will look into a
better way to report lexer errors and prevent downstream issues.

Cheers,
Mitchell

-- 
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 Fri 03 Feb 2017 - 09:59:20 EST

This archive was generated by hypermail 2.2.0 : Sat 04 Feb 2017 - 06:51:04 EST