GithubHelp home page GithubHelp logo

Comments (5)

marijnh avatar marijnh commented on May 29, 2024

I was hoping to ask for help? I can't find a discord or an irc channel, and I'm not sure what to do next.

There's a forum for this kind of thing.

Language tests tend to test for parse structure. In-editor highlighting also requires highlight tags to be set up correctly. Do the names in your styleTags call match the node names in the syntax tree? Are you actually using any of those styled nodes in your test editor?

from lang-example.

StoneCypher avatar StoneCypher commented on May 29, 2024

Do the names in your styleTags call match the node names in the syntax tree?

They do.

Are you actually using any of those styled nodes in your test editor?

Yes.

from lang-example.

StoneCypher avatar StoneCypher commented on May 29, 2024

In case someone else finds this, the problem was simple. CodeMirror only highlights the topmost, exposed rule.

Unfortunately, my language needs a superior rule to disambiguate between barewords and keywords, which in my highlighter is called "Chain," so I don't know how to highlight the things it's made from. If I assign a color to Chain it works as expected. The problem was that I was trying to highlight String, Atom, Arrow, and so on, and the editor isn't distinguishing those.

As far as I can tell, the things beneath the top level production aren't actually exposed, even if they're capitalized. I don't really understand how that can be the case; I would have expected it to highlight all the way down through the rule to its subordinate pieces, so that an expr could have strings and numbers inside, or what have you.

from lang-example.

marijnh avatar marijnh commented on May 29, 2024

Maybe the /... notation in styleTags is what you're looking for?

from lang-example.

StoneCypher avatar StoneCypher commented on May 29, 2024

Hm. It seems like it ought to be, but also, I'm not able to make that work out.

I did as you asked, and made a forum thread (although I see you responded there as well.) I'll consolidate there.

https://discuss.codemirror.net/t/novice-trying-to-write-a-highlighter-stuck-on-disambiguation-and-token-depth-possibly-misunderstanding/5044/2

from lang-example.

Related Issues (10)

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.