[code][textadept] Lexer/LPeg rules to handle first line and lines obtaining a specific text

From: Procházka Lukáš Ing. <LPr.att.pontex.cz>
Date: Fri, 07 Jun 2019 08:42:40 +0200


suppose having the following text (be it in a [Message Box] or similar buffer):

This is LuaTeX 1.10 (build 1654).
Warning: line 55: cannot locate file.
Error: line 160: unrecognized sequence "\bobo" - exiting now.
I'm trying to define lexer PEG/styling rules so that (see the pic attached):
- First line be styled with "FIRST_LINE" style (here: to have yellow back)
- Line(s) containing word "Warning" to be styled with "WARNING_STYLE" style (here: to have turquoise back),
	and the word "Warning" to be styled with "WARNING_WORD" style (here: to have red black);
(Similarly for "Error" line.)
- All backgrounds to be used on the whole line (i.e. to be not stopped by last char on the line).
How to define such lexer rules? Or a lexer for inspiration?
(I succeeded with some lexer which recognize tokens and its categories, but they don't affect styling of the WHOLE LINE where the token appears.)
Any help would be appreciated.
Best regards,
Ing. Lukáš Procházka | mailto:LPr.att.pontex.cz
Pontex s. r. o.      | mailto:pontex@pontex.cz | http://www.pontex.cz | IDDS: nrpt3sn | IČO: 40763439
Bezová 1658
147 14 Praha 4
Mob.: +420 702 033 396

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 07 Jun 2019 - 02:42:40 EDT

This archive was generated by hypermail 2.2.0 : Fri 07 Jun 2019 - 06:30:39 EDT