UDL for embedding LiveScript and SASS in Pug (instead of JS/CSS in HTML)


#1

I use Pug a lot for templating, as well as LiveScript and SASS (sass-lang.com), so I’m trying to write a language extension that will provide the proper syntax highlighting for e.g. LiveScript within a Pug script tag (example gist).

Since all these languages are indentation-sensitive, I’m thinking that the UDL needs to recognise indents and dedents as the transition points between states. I have read through the docs at docs.komodoide.com/SDK/luddite and can’t find anything related to indentation.

Do the LiveScript and SASS languages need to be modified to:

  1. keep track of indentation [how?]
  2. be aware of embedding and language families (CSL, M, STYLE etc) and transition between them based on indentation?

Also is there an easy workflow for testing iterations as I develop the solution? E.g. modifying installed files in-place instead of packaging and re-installing a .XPI every time?


#2

Hi, if keeping track of indentation in UDL is even possible, this would be extremely difficult to pull off. Komodo’s SASS lexer is written in C++ and thus suited for such a task. I don’t think UDL was designed to keep track of persistent states (like indentation levels). I’m sorry, but I cannot be of assistance here.