Fork me on GitHub
#editors
<
2015-12-01
>
selfsame00:12:40

anybody good with .tmLanguage parsers? I'm trying to figure out if I can capture a regex followed by a single #include

selfsame00:12:38

sort of like this without an end pattern

special_form:
    name: meta.special_form.clojure
    begin: ([\`\~\'\@]+)
    end: ()
    contentName: meta.specialized.clojure
    patterns:
    - include: '#sexpr'

eraserhd05:12:41

I’m prioritizing what the next most important feature is for #C0F4MB8AY - a lively vi written in clojure and (eventually) to be good at editing clojure. Votes would be welcome: https://trello.com/b/E2LFvVLy/avi

eraserhd16:12:28

@selfsame: What are .tmLanguage parsers? (I’ve been thinking about syntax highlighting for a bit.)

timgilbert16:12:11

That's the format TextMate uses, also importable to Sublime Text

selfsame16:12:50

@eraserhd yeah it's an xml format for defining oniguruma regex patterns to assign scope tags to text, but if you're rolling your own editor I'm sure there are way better parsing ideas to choose from

eraserhd16:12:54

Maybe… but I’m not sure I want to have to define every single language simple_smile The YAML format looks kind of clean.

eraserhd16:12:21

Ugh, the XML version is pretty gross 😕

selfsame16:12:45

AAAPackageDev plugin for sublimeText can convert between xml, YAML, and JSON.

selfsame16:12:15

I was under the impression there were other standard syntax formats but not seeing any

eraserhd16:12:42

github’s “linguist” uses these tmLanguage files, but pygments does not.

selfsame17:12:11

Hmm emacs and vim seem to have their own internal thing, maybe tmLanguage is a good spec

selfsame17:12:03

(for converting to edn and adapting for the parsing lib of your choice)

eraserhd17:12:11

I think so, more and more. It seems to be organized well enough to support the kind of region-identifying stuff I’ll need.

eraserhd17:12:31

And it seems like I can make a more general version of the “rewrite-clj” lib that’s based on these.

eraserhd17:12:06

(and I don’t have to make them all!)

selfsame17:12:43

@eraserhd cool ping me if you start putting something together simple_smile