You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: README.md
+8-9
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@ __Transform a JSON grammar into a CodeMirror syntax-highlight parser__
5
5
6
6
7
7
8
-
A simple and light-weight (~30kB minified, ~ 11kB zipped) [CodeMirror](https://github.com/marijnh/codemirror) add-on
8
+
A simple and light-weight (~37kB minified, ~ 13kB zipped) [CodeMirror](https://github.com/marijnh/codemirror) add-on
9
9
10
10
to generate syntax-highlight parsers (codemirror modes) from a grammar specification in JSON format.
11
11
@@ -30,13 +30,9 @@ See also: [ace-grammar](https://github.com/foo123/ace-grammar) , [prism-grammar]
30
30
31
31
###Todo
32
32
33
-
Code Indentation is (Codemirror default) <del>and Code Folding is based on existing Codemirror folders (if available)</del>
33
+
Code Indentation is Codemirror default, see [Modularity and Future Directions](https://github.com/foo123/editor-grammar/blob/master/grammar-reference.md#modularity-and-future-directions)
34
34
35
-
*generic code-folders implementations have been added, specified in grammar.Extra.fold option*
36
35
37
-
see [Modularity and Future Directions](https://github.com/foo123/editor-grammar/blob/master/grammar-reference.md#modularity-and-future-directions)
38
-
39
-
* handle arbitrary, user-defined, code `folding` in the `grammar` specification (e.g via `fold action` tokens)
40
36
* handle arbitrary, user-defined, code `(de-)indentation` in the `grammar` specification (e.g via `indent action` tokens)
41
37
* handle arbitrary, user-defined, code `matching` (e.g `brackets`, `tags`, etc..) in the `grammar` specification (e.g via `match action` tokens)
42
38
* handle arbitrary, user-defined, `(operator) precedence` relations in the `grammar` specification (e.g via `precedence action` tokens)
@@ -45,6 +41,7 @@ see [Modularity and Future Directions](https://github.com/foo123/editor-grammar/
45
41
* enable grammar add-on to pre-compile a grammar specification directly into mode source code, so it can be used without the add-on as standalone mode [TODO, maybe]
46
42
47
43
44
+
48
45
###Features
49
46
50
47
* A [`Grammar`](https://github.com/foo123/editor-grammar/blob/master/grammar-reference.md) can **extend other `Grammars`** (so arbitrary `variations` and `dialects` can be handled more easily)
@@ -56,6 +53,7 @@ see [Modularity and Future Directions](https://github.com/foo123/editor-grammar/
56
53
*`Grammar` can define [*action* tokens](https://github.com/foo123/editor-grammar/blob/master/grammar-reference.md#action-tokens) to perform *complex context-specific* parsing functionality, including **associated tag matching** and **duplicate identifiers** (see for example `xml.grammar` example) (**NEW feature**)
57
54
* Generated highlight modes can support **toggle comments** and **keyword autocompletion** functionality if defined in the grammar
58
55
* Generated highlight modes can support **lint-like syntax-annotation** functionality generated from the grammar
56
+
* Generated highlight modes can support custom, user-defined, **code folding** functionality from the [grammar `fold` model](https://github.com/foo123/editor-grammar/blob/master/grammar-reference.md#code-folding) (**NEW feature**)
59
57
* Generated parsers are **optimized for speed and size**
60
58
* Can generate a syntax-highlight parser from a grammar **interactively and on-the-fly** ( see example, http://foo123.github.io/examples/codemirror-grammar )
61
59
* see also [Modularity and Future Directions](https://github.com/foo123/editor-grammar/blob/master/grammar-reference.md#modularity-and-future-directions)
@@ -144,7 +142,7 @@ var xml_grammar = {
144
142
};
145
143
146
144
// 2. parse the grammar into a Codemirror syntax-highlight mode
147
-
var xml_mode =CodeMirrorGrammar.getMode(xml_grammar);
145
+
var xml_mode =CodeMirrorGrammar.getMode(xml_grammar);
0 commit comments