1local info = { 2 version = 1.002, 3 comment = "scintilla lpeg lexer for lua longstrings", 4 author = "Hans Hagen, PRAGMA-ADE, Hasselt NL", 5 copyright = "PRAGMA ADE / ConTeXt Development Team", 6 license = "see context related readme files", 7} 8 9local lexer = require("scite-context-lexer") 10local context = lexer.context 11local patterns = context.patterns 12 13local token = lexer.token 14 15local stringlexer = lexer.new("lua-longstring","scite-context-lexer-lua-longstring") 16local whitespace = stringlexer.whitespace 17 18local space = patterns.space 19local nospace = 1 - space 20 21local p_spaces = token(whitespace, space ^1) 22local p_string = token("string", nospace^1) 23 24stringlexer._rules = { 25 { "whitespace", p_spaces }, 26 { "string", p_string }, 27} 28 29stringlexer._tokenstyles = context.styleset 30 31return stringlexer 32 |