[code] [scintillua] Literate CoffeeScript lexer

From: Robert <rob.g.att.web.de>
Date: Wed, 20 Mar 2013 12:50:32 +0100


I have a Literate CoffeeScript [1] lexer up at my `lexers` GitHub
repository [2].
Feedback and testing welcome, this is all the code:

local l = lexer
local token = l.token
local P = lpeg.P

local M = {_NAME = 'litcoffee'}

-- Embedded in Markdown.
local markdown = l.load('markdown')
M._lexer = markdown

-- Embedded CoffeeScript.
local coffeescript = l.load('coffeescript')
local coffee_start_rule = token(l.style_embedded, (P(' ')^4 + P('\t')))
local coffee_end_rule = token(l.style_embedded, l.newline)
l.embed_lexer(markdown, coffeescript, coffee_start_rule, coffee_end_rule)

return M

I'll test this some as more Literate CoffeeScript programs come up and
then this could make it into the next release?


[1] http://coffeescript.org/#literate
[2] https://github.com/rgieseke/textadept-lexers

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 20 Mar 2013 - 07:50:32 EDT

This archive was generated by hypermail 2.2.0 : Thu 21 Mar 2013 - 06:52:16 EDT