Language editor (was: [SVN] Revision 1189 (Latex))

Chris Thomas chris at cjack.com
Thu Jun 16 02:39:04 UTC 2005


> I've been looking at YAML

1. +1. Much easier to read than plists.

2. But I despair of getting indentation right without TM's editing  
features. Unadorned, NSTextView does not seem adequate for a language  
where indentation implies syntax.

3. One thing I'd very much like to see is YAML's reference mechanism  
for reuse of nodes. This would simplify many existing syntaxes. For  
example:

>   - name: declaration.begin-list.latex
>     match: (\\begin\{)(enumerate|itemize|description|list)(\})
>     captures:
>       1: name: support.function.be.latex
>       2: name: variable.parameter.latex
>       3: name: support.function.be.latex
>   - name: declaration.end-list.latex
>     match: (\\end\{)(enumerate|itemize|description|list)(\})
>     captures:
>       1: name: support.function.be.latex
>       2: name: variable.parameter.latex
>       3: name: support.function.be.latex
>   - name: declaration.begin.latex
>     # Ideally these two commands should be changed to a single  
> begin-end match, once Allan has gotten recursion working.
>     match: (\\begin\{)(.*?)(\})
>     captures:
>       1: name: support.function.be.latex
>       2: name: variable.parameter.latex
>       3: name: support.function.be.latex
>   - name: declaration.end.latex
>     match: (\\end\{)(.*?)(\})
>     captures:
>       1: name: support.function.be.latex
>       2: name: variable.parameter.latex
>       3: name: support.function.be.latex

becomes:

>   - name: declaration.begin-list.latex
>     match: (\\begin\{)(enumerate|itemize|description|list)(\})
>     captures: &support.function.be.captures
>       1: name: support.function.be.latex
>       2: name: variable.parameter.latex
>       3: name: support.function.be.latex
>   - name: declaration.end-list.latex
>     match: (\\end\{)(enumerate|itemize|description|list)(\})
>     *support.function.be.captures
>   - name: declaration.begin.latex
>     # Ideally these two commands should be changed to a single  
> begin-end match, once Allan has gotten recursion working.
>     match: (\\begin\{)(.*?)(\})
>     *support.function.be.captures
>   - name: declaration.end.latex
>     match: (\\end\{)(.*?)(\})
>     *support.function.be.captures

... if I correctly understand how the YAML reference mechanism works.  
There are many such opportunities in the Ruby syntax.

Chris





More information about the textmate-dev mailing list