ult lexer to
    your liking. Then add a <a href="https://foicica.com/textadept/api.html#textadept.file_types">file type</a> for your lexer if necessary.</p>

    <p><a id="lexer.Migrating.Legacy.Lexers"></a></p>

    <h3>Migrating Legacy Lexers</h3>

    <p>Legacy lexers are of the form:</p>

    <pre><code>
    local l = require('lexer')
    local token, word_match = l.token, l.word_match
    local P, R, S = lpeg.P, lpeg.R, lpeg.S

    local M = {_NAME = '?'}

    [... token and pattern definitions ...]

