Skip to content

Commit 5d9bea9

Browse files
author
Nikos M
committed
v. 2.5.0 update, Codemirror 5.8.1 update
1 parent 7476d98 commit 5d9bea9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+7278
-3952
lines changed

README.md

+7-10
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,7 @@ var xml_grammar = {
8989
,"doctype" : "meta"
9090
,"meta" : "meta"
9191
,"cdata" : "atom"
92-
,"open_tag" : "tag"
93-
,"close_tag" : "tag"
92+
,"tag" : "tag"
9493
,"attribute" : "attribute"
9594
,"string" : "string"
9695
,"atom" : "atom"
@@ -131,8 +130,8 @@ var xml_grammar = {
131130
"Syntax" : {
132131

133132
"tag_att" : "'id'.attribute unique_att '=' string unique_id | attribute unique_att '=' (string | number)"
134-
,"start_tag" : "open_tag tag_ctx tag_opened tag_att* ('>'.tag | '/>'.tag tag_autoclosed) \\tag_ctx"
135-
,"end_tag" : "close_tag tag_closed"
133+
,"start_tag" : "open_tag.tag tag_ctx tag_opened tag_att* ('>'.tag | '/>'.tag tag_autoclosed) \\tag_ctx"
134+
,"end_tag" : "close_tag.tag tag_closed"
136135
,"xml" : "(^^1 declaration? doctype?) (declaration.error out_of_place | doctype.error out_of_place | comment | meta | cdata | start_tag | end_tag | atom | text)*"
137136

138137
},
@@ -159,23 +158,21 @@ var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
159158

160159
Result:
161160

162-
![xml-grammar-1](/test/grammar-xml-annotations-1.png)
163-
![xml-grammar-2](/test/grammar-xml-annotations-2.png)
161+
![xml-grammar-1](/test/grammar-xml.png)
162+
![xml-grammar-2](/test/grammar-xml-2.png)
164163

165164

166165

167166
###Other Examples:
168167

169168

170169
![js-recursive-grammar](/test/grammar-js-recursion.png)
171-
![js-recursive-grammar](/test/grammar-js-recursion-2.png)
172-
170+
![js-recursive-grammar-autocomplete](/test/grammar-js-recursion-2.png)
173171

174172
![css-grammar](/test/grammar-css.png)
175173

176-
177174
![python-grammar](/test/grammar-python.png)
178175

179-
180176
![php-grammar](/test/grammar-php.png)
181177

178+
![scheme-grammar](/test/grammar-scheme.png)

api-reference.md

+12
Original file line numberDiff line numberDiff line change
@@ -75,4 +75,16 @@ mode = CodeMirrorGrammar.getMode( grammar [, DEFAULT] );
7575
This is the main method which transforms a `JSON grammar` into a `CodeMirror` syntax-highlight parser.
7676
`DEFAULT` is the default return value (`null` by default) for things that are skipped or not styled
7777
In general there is no need to set this value, unless you need to return something else
78+
79+
80+
81+
__Parser Class__: `Parser`
82+
83+
```javascript
84+
Parser = CodeMirrorGrammar.Parser;
85+
```
86+
87+
The Parser Class used to instantiate a highlight parser, is available.
88+
The `getMode` method will instantiate this parser class, which can be overriden/extended if needed, as needed.
89+
In general there is no need to override/extend the parser, unless you definately need to.
7890

0 commit comments

Comments
 (0)