Code Monkey home page Code Monkey logo

Comments (5)

orbitalquark avatar orbitalquark commented on June 26, 2024 1

It's kind of like regex look-behind. LPeg matches '#' (in lexer.to_eol('#')), but only if it's not preceded by a '\' character.

from textadept.

orbitalquark avatar orbitalquark commented on June 26, 2024

from textadept.

oOosys avatar oOosys commented on June 26, 2024

... Thanks for the reply. No urge in fixing ... if it were very important to me I would have sure already provided a fix myself. Just wanted to mention this issue for the sake of it.

from textadept.

orbitalquark avatar orbitalquark commented on June 26, 2024

Fixed in orbitalquark/scintillua@f971ac5

from textadept.

oOosys avatar oOosys commented on June 26, 2024

OK ... it works like a charm :) and it was so easy to fix, that it can't be called a bug or issue but a simple oversight in first place, so it appears a bit strange that it wasn't over the years yet reported.

May you please explain a bit the mechanism used in this fix? It appears to demonstrate how to include exceptions from a rule triggered by a pattern by specifying a prefix one with -B('CharacterOrStringOrAnyRegex?') to the pattern to_eol('CharacterOrStringOrAnyRegex?'):

lex:add_rule('comment', lex:tag(lexer.COMMENT, -B('\\') * lexer.to_eol('#')))

I mean learning how things work by fixing issues is a much better way to make progress in understanding the underlying mechanisms than reading the manuals ...

from textadept.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.