GithubHelp home page GithubHelp logo

Should Kakoune have a parser? about kakoune HOT 8 CLOSED

mawww avatar mawww commented on August 28, 2024 1
Should Kakoune have a parser?

from kakoune.

Comments (8)

alexherbo2 avatar alexherbo2 commented on August 28, 2024

Yi (repository) has strong, incremental parsers for highlighting.

from kakoune.

mawww avatar mawww commented on August 28, 2024

Supporting grammars is seducing, however having a performant, data driven, incremental, tolerant (as most of the time you are working on an invalid program) parser seems more like a research project. It is not a goal at the moment for Kakoune.

from kakoune.

alexherbo2 avatar alexherbo2 commented on August 28, 2024

I was expecting this answer. The reason why I open this issue is because of
your TODO. Regex are simple, definitely, but perfectible to describe well a
language. Regex highlighters are just a quick and dirty helper to please our
eyes.

from kakoune.

alexherbo2 avatar alexherbo2 commented on August 28, 2024

Have you look at Yi? It is an interesting project, like Kakoune. It still needs more love.

from kakoune.

mawww avatar mawww commented on August 28, 2024

I did, parsers are coded in Haskell and compiled in, so not really data driven.

from kakoune.

haarts avatar haarts commented on August 28, 2024

I know this is an ancient issue. But recently I found this project: http://tree-sitter.github.io/tree-sitter/ (created by the Github organisation). It seems to address exactly the issues raised in #50 (comment) by @mawww. From the website:

  • General enough to parse any programming language
  • Fast enough to parse on every keystroke in a text editor
  • Robust enough to provide useful results even in the presence of syntax errors
  • Dependency-free so that the runtime library (which is written in pure C) can be embedded in any application

It has been around for a while now speaking to it's maturity.

from kakoune.

Delapouite avatar Delapouite commented on August 28, 2024

Related ongoing PR about tree-sitter: #3160
Also https://github.com/ul/kak-tree for selectors

from kakoune.

haarts avatar haarts commented on August 28, 2024

That's pretty spectacular. I hadn't even thought about selections! Syntax highlighting was my annoyance. It's just too damn hard to write regexes (think code in string interpolations, ugh).

from kakoune.

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.