Re: [code] Markdown lexer issue

From: Mitchell <m.att.foicica.com>
Date: Wed, 24 Oct 2018 18:50:32 -0400 (EDT)

Hi Alexander,

On Thu, 11 Oct 2018, Alexander Misel wrote:

> I did some patch to lexer.lua (newline pattern I think should only match 1 newline, but old lexer matches 1+)
> @@ -1596,9 +1596,10 @@
> M.punct = lpeg_R('!/', ':@', '[\'', '{~')
> M.space = lpeg_S('\t\v\f\n\r ')
>
> -M.newline = lpeg_S('\r\n\f')^1
> -M.nonnewline = 1 - M.newline
> -M.nonnewline_esc = 1 - (M.newline + '\\') + '\\' * M.any
> +M.newline = lpeg_P('\r')^-1 * lpeg_S('\n\f')
> +M.raw_newline = lpeg_S('\r\n\f')
> +M.nonnewline = 1 - M.raw_newline
> +M.nonnewline_esc = 1 - (M.raw_newline + '\\') + '\\' * M.any
>
> M.dec_num = M.digit^1
> M.hex_num = '0' * lpeg_S('xX') * M.xdigit^1
> and improve highlighting of markdown.lua

I've committed most of your changes[1][2][3]. Thank you. With regard to the markdown lexer changes, I am relucant to assign styles like "STYLE_CLASS" to strong tokens, "STYLE_KEYWORD" to emphasized tokens, etc., as they are not really programming language constructs, and more like plain text constructs. Textadept allows you to redefine styles for tokens when a lexer loads, so you are free to do so on your own. I'll keep the default set of styles. Also, I tweaked the "```" rule and kept "``" to be used anywhere inline, not just at the start of a line.

Thanks again for your contribution!

Cheers,
Mitchell

[1]: https://foicica.com/hg/scintilla/rev/78cf9c6abef9
[2]: https://foicica.com/hg/scintilla/rev/6d1f3fc4aa30
[3]: https://foicica.com/hg/scintilla/rev/e5a1ca5ad978

-- 
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 Wed 24 Oct 2018 - 18:50:32 EDT

This archive was generated by hypermail 2.2.0 : Thu 25 Oct 2018 - 06:54:38 EDT