Git Product home page Git Product logo

Comments (6)

jevogel avatar jevogel commented on July 26, 2024

I added this fix into this file to test for myself, and it seems to mess up the formatting of float literals, (e.g., with 100.5, the "100" part will be Normal and the ".5" part will be Number). Any thoughts on how to fix this? I'm not that great with regex.

from python-syntax.

jevogel avatar jevogel commented on July 26, 2024

Actually managed to fix it by changing it to
syn match pythonBtInIsolator "\(\.\)\@<!\<\k\+\D\>" contains=pythonBuiltinFunc,pythonStatement
(added \D to the keyword search)

from python-syntax.

hdima avatar hdima commented on July 26, 2024

@jevogel Can you create a pull request?

However it seems containedin=pythonBtInIsolator is redundant and can be removed. And the regexp probably also can be simplified.

from python-syntax.

hdima avatar hdima commented on July 26, 2024

So I've tried a simplified version of the patch. It works but it breaks highlighting for numbers even with the fix from @jevogel. For example complex numbers, hexadecimal numbers and error checking for numbers don't work. Also I don't really like to use \@<! which can be really slow. So I think it's a bad idea to apply the patch.

from python-syntax.

anntzer avatar anntzer commented on July 26, 2024

Can you detail in which aspects complex, hexadecimals and number error checking are broken? They seem to work fine for me with @jevogel's patch. Performance can be improved by only doing 1-character lookbehind, "\(\.\)\@1<!\<\K\+\>". (\K = \k but excluding digits)

from python-syntax.

purpleP avatar purpleP commented on July 26, 2024

@anntzer try my fork https://github.com/purpleP/python-syntax.git

from python-syntax.

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.