Re: [code] [scintillua] New lexers from vis editor community

From: Marc André Tanner <mat.att.brain-dump.org>
Date: Wed, 5 Oct 2016 15:42:45 +0200

On Wed, Oct 05, 2016 at 08:44:00AM -0400, Mitchell wrote:
> Hi Marc,
>
> On Wed, 5 Oct 2016, Marc André Tanner wrote:
>
> >Hi,
> >
> >I would like to propose a few new LPeg lexers which were contributed
> >for my vis editor:
> >
> >* protobuf by David B. Lamkins
> >* crystal by Michel Martens
> >* fstab, networkd, systemd, dsv and an improved pkgbuild by Christian Hesse
> >
> >They can be picked up from:
> >
> >https://github.com/martanne/vis/tree/master/lexers
> >
> >and should hopefully work as is with textadept.
>
> Thanks. Do you happen to know the file extensions used by those lexers?

The associations currently used in vis can be found here:

 https://github.com/martanne/vis/blob/master/vis.lua#L76

 protobuf: .proto
 crystal: .cr
 networkd: .link, .network, .netdev
 systemd: .automount, .device, .mount, .path, .scope, .service, .slice, .socket, .swap, .target, .timer
 fstab: fstab
 dsv: group, gshadow, passwd, shadow

The last couple are fairly *nix specific but I wanted to mention them
anyway in case you (or anyone else) find them useful.

> >Also one of the users noticed that the "text" lexer (supposedly to
> >disable syntax highlighting completely?) does not work in vis. Is
> >it functional in textadept?
>
> Yes, "text" is the default lexer for plain text in Textadept, and an
> identical one, "container", is the default lexer for plain text in SciTE or
> other Scintillua-based editors. What do you mean by "does not work"? Do you
> get an error?

Yes when attempting to lex something:

 $ lua5.2
 Lua 5.2.3 Copyright (C) 1994-2013 Lua.org, PUC-Rio
> lexers = require('lexer')
> lang = lexers.load('text')
> lang:lex('foo')
 ./lexer.lua:1131: bad argument #1 to 'lpeg_match' (lpeg-pattern expected, got nil)
 stack traceback:
         [C]: in function 'lpeg_match'
         ./lexer.lua:1131: in function 'lex'

This is with the lexer.lua from the vis repository which has a few
changes compared to the one used in scintillua (though they shouldn't
matter). Actually I just tried with the scintillua one and other than
the line numbers, the error is the same.

Thanks,
Marc

-- 
 Marc André Tanner >< http://www.brain-dump.org/ >< GPG key: 10C93617
-- 
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 05 Oct 2016 - 09:42:45 EDT

This archive was generated by hypermail 2.2.0 : Thu 06 Oct 2016 - 06:45:23 EDT