code_sync 0.6.7
Sign up to get free protection for your applications and to get access to all the features.
- data/.rvmrc +1 -0
- data/CNAME +1 -0
- data/Gemfile +24 -0
- data/Gemfile.lock +117 -0
- data/LICENSE.md +22 -0
- data/ROADMAP.md +20 -0
- data/TODO.md +14 -0
- data/bin/codesync +11 -0
- data/code_sync.gemspec +30 -0
- data/config/routes.rb +26 -0
- data/lib/assets/javascripts/canvas.coffee +12 -0
- data/lib/assets/javascripts/canvas/editors.coffee +48 -0
- data/lib/assets/javascripts/canvas/index.coffee +15 -0
- data/lib/assets/javascripts/canvas/layer_controller.coffee +47 -0
- data/lib/assets/javascripts/code_sync.coffee +3 -0
- data/lib/assets/javascripts/code_sync/backends/gist.coffee +78 -0
- data/lib/assets/javascripts/code_sync/client/index.coffee +104 -0
- data/lib/assets/javascripts/code_sync/client/util.coffee +61 -0
- data/lib/assets/javascripts/code_sync/codemirror.coffee +12 -0
- data/lib/assets/javascripts/code_sync/config.js.coffee.erb +38 -0
- data/lib/assets/javascripts/code_sync/console/index.coffee +54 -0
- data/lib/assets/javascripts/code_sync/console/templates/console.jst.skim +10 -0
- data/lib/assets/javascripts/code_sync/dependencies.coffee +6 -0
- data/lib/assets/javascripts/code_sync/editor/advanced.coffee +0 -0
- data/lib/assets/javascripts/code_sync/editor/datasources/document.coffee +212 -0
- data/lib/assets/javascripts/code_sync/editor/datasources/gist_loader.coffee +7 -0
- data/lib/assets/javascripts/code_sync/editor/datasources/modes.coffee +117 -0
- data/lib/assets/javascripts/code_sync/editor/datasources/project_assets.coffee +14 -0
- data/lib/assets/javascripts/code_sync/editor/index.coffee +415 -0
- data/lib/assets/javascripts/code_sync/editor/plugins/asset_selector.coffee +106 -0
- data/lib/assets/javascripts/code_sync/editor/plugins/color_picker.coffee +83 -0
- data/lib/assets/javascripts/code_sync/editor/plugins/document_manager.coffee +55 -0
- data/lib/assets/javascripts/code_sync/editor/plugins/document_tabs.coffee +178 -0
- data/lib/assets/javascripts/code_sync/editor/plugins/element_sync.coffee +111 -0
- data/lib/assets/javascripts/code_sync/editor/plugins/keymap_selector.coffee +44 -0
- data/lib/assets/javascripts/code_sync/editor/plugins/mode_selector.coffee +53 -0
- data/lib/assets/javascripts/code_sync/editor/plugins/name_input.coffee +44 -0
- data/lib/assets/javascripts/code_sync/editor/plugins/preferences.coffee +71 -0
- data/lib/assets/javascripts/code_sync/editor/templates/asset_editor.jst.skim +2 -0
- data/lib/assets/javascripts/code_sync/editor/templates/asset_selector.jst.skim +5 -0
- data/lib/assets/javascripts/code_sync/editor/templates/document_manager_tab.jst.skim +15 -0
- data/lib/assets/javascripts/code_sync/editor/templates/element_sync.jst.skim +19 -0
- data/lib/assets/javascripts/code_sync/editor/templates/preferences_panel.jst.skim +38 -0
- data/lib/assets/javascripts/code_sync/editor/views/asset_selector.coffee +106 -0
- data/lib/assets/javascripts/code_sync/editor/views/color_picker.coffee +76 -0
- data/lib/assets/javascripts/code_sync/editor/views/document_manager.coffee +176 -0
- data/lib/assets/javascripts/code_sync/editor/views/keymap_selector.coffee +37 -0
- data/lib/assets/javascripts/code_sync/editor/views/mode_selector.coffee +47 -0
- data/lib/assets/javascripts/code_sync/editor/views/name_input.coffee +44 -0
- data/lib/assets/javascripts/code_sync/editor/views/preferences.coffee +71 -0
- data/lib/assets/javascripts/code_sync/index.coffee +4 -0
- data/lib/assets/javascripts/code_sync/reloader.coffee +2 -0
- data/lib/assets/javascripts/code_sync_basic.coffee +1 -0
- data/lib/assets/javascripts/demos.coffee +48 -0
- data/lib/assets/javascripts/demos/default-content.coffee +72 -0
- data/lib/assets/javascripts/demos/layout_selector.coffee +19 -0
- data/lib/assets/javascripts/demos/tour.coffee +70 -0
- data/lib/assets/javascripts/demos/tour.jst.skim +29 -0
- data/lib/assets/javascripts/marketing.coffee +0 -0
- data/lib/assets/javascripts/vendor/.DS_Store +0 -0
- data/lib/assets/javascripts/vendor/backbone-events.js +160 -0
- data/lib/assets/javascripts/vendor/backbone-min.js +4 -0
- data/lib/assets/javascripts/vendor/codemirror-coffeescript.js +346 -0
- data/lib/assets/javascripts/vendor/codemirror-css.js +570 -0
- data/lib/assets/javascripts/vendor/codemirror-haml.js +153 -0
- data/lib/assets/javascripts/vendor/codemirror-htmlmixed.js +104 -0
- data/lib/assets/javascripts/vendor/codemirror-javascript.js +468 -0
- data/lib/assets/javascripts/vendor/codemirror-markdown.js +526 -0
- data/lib/assets/javascripts/vendor/codemirror-ruby.js +194 -0
- data/lib/assets/javascripts/vendor/codemirror-sass.js +330 -0
- data/lib/assets/javascripts/vendor/codemirror-skim.js +330 -0
- data/lib/assets/javascripts/vendor/codemirror-vim.js +3159 -0
- data/lib/assets/javascripts/vendor/codemirror-xml.js +328 -0
- data/lib/assets/javascripts/vendor/console.js +339 -0
- data/lib/assets/javascripts/vendor/gisted.js +27 -0
- data/lib/assets/javascripts/vendor/jquery-ui-resize-drag.min.js +6 -0
- data/lib/assets/javascripts/vendor/jquery.js +5 -0
- data/lib/assets/javascripts/vendor/keylauncher.js +4 -0
- data/lib/assets/javascripts/vendor/keymaster.min.js +4 -0
- data/lib/assets/javascripts/vendor/spectrum.js +1868 -0
- data/lib/assets/javascripts/vendor/underscore-min.js +1 -0
- data/lib/assets/javascripts/vendor/underscore.string.min.js +1 -0
- data/lib/assets/javascripts/vendor/vendored_codemirror.js +5558 -0
- data/lib/assets/javascripts/vendor/zepto.js +2 -0
- data/lib/assets/stylesheets/canvas.css.scss +101 -0
- data/lib/assets/stylesheets/code_sync.css.scss +4 -0
- data/lib/assets/stylesheets/code_sync/codemirror.css +7 -0
- data/lib/assets/stylesheets/code_sync/console.css +86 -0
- data/lib/assets/stylesheets/code_sync/editor/asset-name-input.css.scss +12 -0
- data/lib/assets/stylesheets/code_sync/editor/asset-selector.css.scss +58 -0
- data/lib/assets/stylesheets/code_sync/editor/codesync-color-picker.css.sass +5 -0
- data/lib/assets/stylesheets/code_sync/editor/document-tabs.css.scss +61 -0
- data/lib/assets/stylesheets/code_sync/editor/element-sync.css.scss +72 -0
- data/lib/assets/stylesheets/code_sync/editor/mode-selector.css.scss +0 -0
- data/lib/assets/stylesheets/code_sync/editor/preferences-panel.css.scss +26 -0
- data/lib/assets/stylesheets/code_sync/index.css.scss +141 -0
- data/lib/assets/stylesheets/demos.css.scss +96 -0
- data/lib/assets/stylesheets/marketing.css.sass +46 -0
- data/lib/assets/stylesheets/marketing/syntax.css.scss +1 -0
- data/lib/assets/stylesheets/vendor/animate.css +1 -0
- data/lib/assets/stylesheets/vendor/codemirror-ambiance.css +75 -0
- data/lib/assets/stylesheets/vendor/codemirror-lesserdark.css +44 -0
- data/lib/assets/stylesheets/vendor/codemirror-monokai.css +28 -0
- data/lib/assets/stylesheets/vendor/codemirror-xq-light.css +43 -0
- data/lib/assets/stylesheets/vendor/grid-layout.css +1406 -0
- data/lib/assets/stylesheets/vendor/spectrum.css +481 -0
- data/lib/assets/stylesheets/vendor/vendored_codemirror.css +246 -0
- data/lib/code_sync.rb +41 -0
- data/lib/code_sync/cli.rb +73 -0
- data/lib/code_sync/manager.rb +238 -0
- data/lib/code_sync/processors.rb +18 -0
- data/lib/code_sync/processors/basic.rb +9 -0
- data/lib/code_sync/processors/jst_processor.rb +17 -0
- data/lib/code_sync/pry_console.rb +132 -0
- data/lib/code_sync/rails.rb +7 -0
- data/lib/code_sync/rails/engine.rb +12 -0
- data/lib/code_sync/server.rb +225 -0
- data/lib/code_sync/sprockets_adapter.rb +145 -0
- data/lib/code_sync/temp_asset.rb +20 -0
- data/lib/code_sync/version.rb +3 -0
- data/lib/middleman_extension.rb +43 -0
- data/readme.md +26 -0
- data/site/.gitignore +14 -0
- data/site/Gemfile +13 -0
- data/site/Gemfile.lock +183 -0
- data/site/config.rb +26 -0
- data/site/source/canvas.html.slim +21 -0
- data/site/source/codepen-style-demo.html.slim +21 -0
- data/site/source/demo.html.slim +30 -0
- data/site/source/index.html.slim +128 -0
- data/site/source/layouts/layout.slim +18 -0
- data/site/source/samples/_client.html.md +13 -0
- data/site/source/samples/_editor.html.md +19 -0
- data/site/source/samples/_hooks.html.md +8 -0
- data/site/source/samples/_middleman.html.md +7 -0
- data/site/source/samples/_rails.html.md +8 -0
- data/site/source/samples/_standalone.html.md +36 -0
- data/spec/lib/code_sync/sprockets_adapter_spec.rb +44 -0
- data/spec/spec_helper.rb +21 -0
- data/spec/support/.DS_Store +0 -0
- data/spec/support/dummy_middleman/.gitignore +14 -0
- data/spec/support/dummy_middleman/Gemfile +5 -0
- data/spec/support/dummy_middleman/Gemfile.lock +100 -0
- data/spec/support/dummy_middleman/config.rb +77 -0
- data/spec/support/dummy_middleman/source/images/background.png +0 -0
- data/spec/support/dummy_middleman/source/images/middleman.png +0 -0
- data/spec/support/dummy_middleman/source/index.html.erb +10 -0
- data/spec/support/dummy_middleman/source/javascripts/all.js +1 -0
- data/spec/support/dummy_middleman/source/layouts/layout.erb +19 -0
- data/spec/support/dummy_middleman/source/stylesheets/all.css +55 -0
- data/spec/support/dummy_middleman/source/stylesheets/normalize.css +375 -0
- data/spec/support/dummy_rails/.gitignore +15 -0
- data/spec/support/dummy_rails/Gemfile +38 -0
- data/spec/support/dummy_rails/Gemfile.lock +112 -0
- data/spec/support/dummy_rails/README.rdoc +261 -0
- data/spec/support/dummy_rails/Rakefile +7 -0
- data/spec/support/dummy_rails/app/assets/images/rails.png +0 -0
- data/spec/support/dummy_rails/app/assets/javascripts/application.js +15 -0
- data/spec/support/dummy_rails/app/assets/stylesheets/application.css +13 -0
- data/spec/support/dummy_rails/app/controllers/application_controller.rb +3 -0
- data/spec/support/dummy_rails/app/helpers/application_helper.rb +2 -0
- data/spec/support/dummy_rails/app/mailers/.gitkeep +0 -0
- data/spec/support/dummy_rails/app/models/.gitkeep +0 -0
- data/spec/support/dummy_rails/app/views/layouts/application.html.erb +14 -0
- data/spec/support/dummy_rails/config.ru +4 -0
- data/spec/support/dummy_rails/config/application.rb +62 -0
- data/spec/support/dummy_rails/config/boot.rb +6 -0
- data/spec/support/dummy_rails/config/database.yml +25 -0
- data/spec/support/dummy_rails/config/environment.rb +5 -0
- data/spec/support/dummy_rails/config/environments/development.rb +37 -0
- data/spec/support/dummy_rails/config/environments/production.rb +67 -0
- data/spec/support/dummy_rails/config/environments/test.rb +37 -0
- data/spec/support/dummy_rails/config/initializers/backtrace_silencers.rb +7 -0
- data/spec/support/dummy_rails/config/initializers/inflections.rb +15 -0
- data/spec/support/dummy_rails/config/initializers/mime_types.rb +5 -0
- data/spec/support/dummy_rails/config/initializers/secret_token.rb +7 -0
- data/spec/support/dummy_rails/config/initializers/session_store.rb +8 -0
- data/spec/support/dummy_rails/config/initializers/wrap_parameters.rb +14 -0
- data/spec/support/dummy_rails/config/locales/en.yml +5 -0
- data/spec/support/dummy_rails/config/routes.rb +58 -0
- data/spec/support/dummy_rails/db/seeds.rb +7 -0
- data/spec/support/dummy_rails/doc/README_FOR_APP +2 -0
- data/spec/support/dummy_rails/lib/assets/.gitkeep +0 -0
- data/spec/support/dummy_rails/lib/tasks/.gitkeep +0 -0
- data/spec/support/dummy_rails/log/.gitkeep +0 -0
- data/spec/support/dummy_rails/public/404.html +26 -0
- data/spec/support/dummy_rails/public/422.html +26 -0
- data/spec/support/dummy_rails/public/500.html +25 -0
- data/spec/support/dummy_rails/public/favicon.ico +0 -0
- data/spec/support/dummy_rails/public/index.html +241 -0
- data/spec/support/dummy_rails/public/robots.txt +5 -0
- data/spec/support/dummy_rails/script/rails +6 -0
- data/spec/support/dummy_rails/test/fixtures/.gitkeep +0 -0
- data/spec/support/dummy_rails/test/functional/.gitkeep +0 -0
- data/spec/support/dummy_rails/test/integration/.gitkeep +0 -0
- data/spec/support/dummy_rails/test/performance/browsing_test.rb +12 -0
- data/spec/support/dummy_rails/test/test_helper.rb +13 -0
- data/spec/support/dummy_rails/test/unit/.gitkeep +0 -0
- data/spec/support/dummy_rails/vendor/assets/javascripts/.gitkeep +0 -0
- data/spec/support/dummy_rails/vendor/assets/stylesheets/.gitkeep +0 -0
- data/spec/support/dummy_rails/vendor/plugins/.gitkeep +0 -0
- data/spec/support/dummy_static/.DS_Store +0 -0
- data/spec/support/dummy_static/app/.DS_Store +0 -0
- data/spec/support/dummy_static/app/assets/.DS_Store +0 -0
- data/spec/support/dummy_static/app/assets/javascripts/manifest.coffee +4 -0
- data/spec/support/dummy_static/app/assets/javascripts/spec_application_javascript.coffee +4 -0
- data/spec/support/dummy_static/app/assets/stylesheets/spec_application_stylesheet.css.scss +5 -0
- data/spec/support/dummy_static/lib/assets/javascripts/spec_library_javascript.coffee +3 -0
- data/spec/support/dummy_static/lib/assets/stylesheets/spec_library_stylesheet.css.scss +5 -0
- data/spec/support/dummy_static/vendor/assets/javascripts/spec_vendor_javascript.js +5 -0
- data/spec/support/dummy_static/vendor/assets/stylesheets/spec_vendor_stylesheets.css +3 -0
- data/vendor/assets/stylesheets/code_sync.css +1 -0
- metadata +492 -0
@@ -0,0 +1,570 @@
|
|
1
|
+
CodeMirror.defineMode("css", function(config) {
|
2
|
+
return CodeMirror.getMode(config, "text/css");
|
3
|
+
});
|
4
|
+
|
5
|
+
CodeMirror.defineMode("css-base", function(config, parserConfig) {
|
6
|
+
"use strict";
|
7
|
+
|
8
|
+
var indentUnit = config.indentUnit,
|
9
|
+
hooks = parserConfig.hooks || {},
|
10
|
+
atMediaTypes = parserConfig.atMediaTypes || {},
|
11
|
+
atMediaFeatures = parserConfig.atMediaFeatures || {},
|
12
|
+
propertyKeywords = parserConfig.propertyKeywords || {},
|
13
|
+
colorKeywords = parserConfig.colorKeywords || {},
|
14
|
+
valueKeywords = parserConfig.valueKeywords || {},
|
15
|
+
allowNested = !!parserConfig.allowNested,
|
16
|
+
type = null;
|
17
|
+
|
18
|
+
function ret(style, tp) { type = tp; return style; }
|
19
|
+
|
20
|
+
function tokenBase(stream, state) {
|
21
|
+
var ch = stream.next();
|
22
|
+
if (hooks[ch]) {
|
23
|
+
// result[0] is style and result[1] is type
|
24
|
+
var result = hooks[ch](stream, state);
|
25
|
+
if (result !== false) return result;
|
26
|
+
}
|
27
|
+
if (ch == "@") {stream.eatWhile(/[\w\\\-]/); return ret("def", stream.current());}
|
28
|
+
else if (ch == "=") ret(null, "compare");
|
29
|
+
else if ((ch == "~" || ch == "|") && stream.eat("=")) return ret(null, "compare");
|
30
|
+
else if (ch == "\"" || ch == "'") {
|
31
|
+
state.tokenize = tokenString(ch);
|
32
|
+
return state.tokenize(stream, state);
|
33
|
+
}
|
34
|
+
else if (ch == "#") {
|
35
|
+
stream.eatWhile(/[\w\\\-]/);
|
36
|
+
return ret("atom", "hash");
|
37
|
+
}
|
38
|
+
else if (ch == "!") {
|
39
|
+
stream.match(/^\s*\w*/);
|
40
|
+
return ret("keyword", "important");
|
41
|
+
}
|
42
|
+
else if (/\d/.test(ch)) {
|
43
|
+
stream.eatWhile(/[\w.%]/);
|
44
|
+
return ret("number", "unit");
|
45
|
+
}
|
46
|
+
else if (ch === "-") {
|
47
|
+
if (/\d/.test(stream.peek())) {
|
48
|
+
stream.eatWhile(/[\w.%]/);
|
49
|
+
return ret("number", "unit");
|
50
|
+
} else if (stream.match(/^[^-]+-/)) {
|
51
|
+
return ret("meta", "meta");
|
52
|
+
}
|
53
|
+
}
|
54
|
+
else if (/[,+>*\/]/.test(ch)) {
|
55
|
+
return ret(null, "select-op");
|
56
|
+
}
|
57
|
+
else if (ch == "." && stream.match(/^-?[_a-z][_a-z0-9-]*/i)) {
|
58
|
+
return ret("qualifier", "qualifier");
|
59
|
+
}
|
60
|
+
else if (ch == ":") {
|
61
|
+
return ret("operator", ch);
|
62
|
+
}
|
63
|
+
else if (/[;{}\[\]\(\)]/.test(ch)) {
|
64
|
+
return ret(null, ch);
|
65
|
+
}
|
66
|
+
else if (ch == "u" && stream.match("rl(")) {
|
67
|
+
stream.backUp(1);
|
68
|
+
state.tokenize = tokenParenthesized;
|
69
|
+
return ret("property", "variable");
|
70
|
+
}
|
71
|
+
else {
|
72
|
+
stream.eatWhile(/[\w\\\-]/);
|
73
|
+
return ret("property", "variable");
|
74
|
+
}
|
75
|
+
}
|
76
|
+
|
77
|
+
function tokenString(quote, nonInclusive) {
|
78
|
+
return function(stream, state) {
|
79
|
+
var escaped = false, ch;
|
80
|
+
while ((ch = stream.next()) != null) {
|
81
|
+
if (ch == quote && !escaped)
|
82
|
+
break;
|
83
|
+
escaped = !escaped && ch == "\\";
|
84
|
+
}
|
85
|
+
if (!escaped) {
|
86
|
+
if (nonInclusive) stream.backUp(1);
|
87
|
+
state.tokenize = tokenBase;
|
88
|
+
}
|
89
|
+
return ret("string", "string");
|
90
|
+
};
|
91
|
+
}
|
92
|
+
|
93
|
+
function tokenParenthesized(stream, state) {
|
94
|
+
stream.next(); // Must be '('
|
95
|
+
if (!stream.match(/\s*[\"\']/, false))
|
96
|
+
state.tokenize = tokenString(")", true);
|
97
|
+
else
|
98
|
+
state.tokenize = tokenBase;
|
99
|
+
return ret(null, "(");
|
100
|
+
}
|
101
|
+
|
102
|
+
return {
|
103
|
+
startState: function(base) {
|
104
|
+
return {tokenize: tokenBase,
|
105
|
+
baseIndent: base || 0,
|
106
|
+
stack: []};
|
107
|
+
},
|
108
|
+
|
109
|
+
token: function(stream, state) {
|
110
|
+
|
111
|
+
// Use these terms when applicable (see http://www.xanthir.com/blog/b4E50)
|
112
|
+
//
|
113
|
+
// rule** or **ruleset:
|
114
|
+
// A selector + braces combo, or an at-rule.
|
115
|
+
//
|
116
|
+
// declaration block:
|
117
|
+
// A sequence of declarations.
|
118
|
+
//
|
119
|
+
// declaration:
|
120
|
+
// A property + colon + value combo.
|
121
|
+
//
|
122
|
+
// property value:
|
123
|
+
// The entire value of a property.
|
124
|
+
//
|
125
|
+
// component value:
|
126
|
+
// A single piece of a property value. Like the 5px in
|
127
|
+
// text-shadow: 0 0 5px blue;. Can also refer to things that are
|
128
|
+
// multiple terms, like the 1-4 terms that make up the background-size
|
129
|
+
// portion of the background shorthand.
|
130
|
+
//
|
131
|
+
// term:
|
132
|
+
// The basic unit of author-facing CSS, like a single number (5),
|
133
|
+
// dimension (5px), string ("foo"), or function. Officially defined
|
134
|
+
// by the CSS 2.1 grammar (look for the 'term' production)
|
135
|
+
//
|
136
|
+
//
|
137
|
+
// simple selector:
|
138
|
+
// A single atomic selector, like a type selector, an attr selector, a
|
139
|
+
// class selector, etc.
|
140
|
+
//
|
141
|
+
// compound selector:
|
142
|
+
// One or more simple selectors without a combinator. div.example is
|
143
|
+
// compound, div > .example is not.
|
144
|
+
//
|
145
|
+
// complex selector:
|
146
|
+
// One or more compound selectors chained with combinators.
|
147
|
+
//
|
148
|
+
// combinator:
|
149
|
+
// The parts of selectors that express relationships. There are four
|
150
|
+
// currently - the space (descendant combinator), the greater-than
|
151
|
+
// bracket (child combinator), the plus sign (next sibling combinator),
|
152
|
+
// and the tilda (following sibling combinator).
|
153
|
+
//
|
154
|
+
// sequence of selectors:
|
155
|
+
// One or more of the named type of selector chained with commas.
|
156
|
+
|
157
|
+
state.tokenize = state.tokenize || tokenBase;
|
158
|
+
if (state.tokenize == tokenBase && stream.eatSpace()) return null;
|
159
|
+
var style = state.tokenize(stream, state);
|
160
|
+
if (style && typeof style != "string") style = ret(style[0], style[1]);
|
161
|
+
|
162
|
+
// Changing style returned based on context
|
163
|
+
var context = state.stack[state.stack.length-1];
|
164
|
+
if (style == "variable") {
|
165
|
+
if (type == "variable-definition") state.stack.push("propertyValue");
|
166
|
+
return "variable-2";
|
167
|
+
} else if (style == "property") {
|
168
|
+
var word = stream.current().toLowerCase();
|
169
|
+
if (context == "propertyValue") {
|
170
|
+
if (valueKeywords.hasOwnProperty(word)) {
|
171
|
+
style = "string-2";
|
172
|
+
} else if (colorKeywords.hasOwnProperty(word)) {
|
173
|
+
style = "keyword";
|
174
|
+
} else {
|
175
|
+
style = "variable-2";
|
176
|
+
}
|
177
|
+
} else if (context == "rule") {
|
178
|
+
if (!propertyKeywords.hasOwnProperty(word)) {
|
179
|
+
style += " error";
|
180
|
+
}
|
181
|
+
} else if (context == "block") {
|
182
|
+
// if a value is present in both property, value, or color, the order
|
183
|
+
// of preference is property -> color -> value
|
184
|
+
if (propertyKeywords.hasOwnProperty(word)) {
|
185
|
+
style = "property";
|
186
|
+
} else if (colorKeywords.hasOwnProperty(word)) {
|
187
|
+
style = "keyword";
|
188
|
+
} else if (valueKeywords.hasOwnProperty(word)) {
|
189
|
+
style = "string-2";
|
190
|
+
} else {
|
191
|
+
style = "tag";
|
192
|
+
}
|
193
|
+
} else if (!context || context == "@media{") {
|
194
|
+
style = "tag";
|
195
|
+
} else if (context == "@media") {
|
196
|
+
if (atMediaTypes[stream.current()]) {
|
197
|
+
style = "attribute"; // Known attribute
|
198
|
+
} else if (/^(only|not)$/.test(word)) {
|
199
|
+
style = "keyword";
|
200
|
+
} else if (word == "and") {
|
201
|
+
style = "error"; // "and" is only allowed in @mediaType
|
202
|
+
} else if (atMediaFeatures.hasOwnProperty(word)) {
|
203
|
+
style = "error"; // Known property, should be in @mediaType(
|
204
|
+
} else {
|
205
|
+
// Unknown, expecting keyword or attribute, assuming attribute
|
206
|
+
style = "attribute error";
|
207
|
+
}
|
208
|
+
} else if (context == "@mediaType") {
|
209
|
+
if (atMediaTypes.hasOwnProperty(word)) {
|
210
|
+
style = "attribute";
|
211
|
+
} else if (word == "and") {
|
212
|
+
style = "operator";
|
213
|
+
} else if (/^(only|not)$/.test(word)) {
|
214
|
+
style = "error"; // Only allowed in @media
|
215
|
+
} else {
|
216
|
+
// Unknown attribute or property, but expecting property (preceded
|
217
|
+
// by "and"). Should be in parentheses
|
218
|
+
style = "error";
|
219
|
+
}
|
220
|
+
} else if (context == "@mediaType(") {
|
221
|
+
if (propertyKeywords.hasOwnProperty(word)) {
|
222
|
+
// do nothing, remains "property"
|
223
|
+
} else if (atMediaTypes.hasOwnProperty(word)) {
|
224
|
+
style = "error"; // Known property, should be in parentheses
|
225
|
+
} else if (word == "and") {
|
226
|
+
style = "operator";
|
227
|
+
} else if (/^(only|not)$/.test(word)) {
|
228
|
+
style = "error"; // Only allowed in @media
|
229
|
+
} else {
|
230
|
+
style += " error";
|
231
|
+
}
|
232
|
+
} else if (context == "@import") {
|
233
|
+
style = "tag";
|
234
|
+
} else {
|
235
|
+
style = "error";
|
236
|
+
}
|
237
|
+
} else if (style == "atom") {
|
238
|
+
if(!context || context == "@media{" || context == "block") {
|
239
|
+
style = "builtin";
|
240
|
+
} else if (context == "propertyValue") {
|
241
|
+
if (!/^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/.test(stream.current())) {
|
242
|
+
style += " error";
|
243
|
+
}
|
244
|
+
} else {
|
245
|
+
style = "error";
|
246
|
+
}
|
247
|
+
} else if (context == "@media" && type == "{") {
|
248
|
+
style = "error";
|
249
|
+
}
|
250
|
+
|
251
|
+
// Push/pop context stack
|
252
|
+
if (type == "{") {
|
253
|
+
if (context == "@media" || context == "@mediaType") {
|
254
|
+
state.stack.pop();
|
255
|
+
state.stack[state.stack.length-1] = "@media{";
|
256
|
+
}
|
257
|
+
else {
|
258
|
+
var newContext = allowNested ? "block" : "rule";
|
259
|
+
state.stack.push(newContext);
|
260
|
+
}
|
261
|
+
}
|
262
|
+
else if (type == "}") {
|
263
|
+
var lastState = state.stack[state.stack.length - 1];
|
264
|
+
if (lastState == "interpolation") style = "operator";
|
265
|
+
state.stack.pop();
|
266
|
+
if (context == "propertyValue") state.stack.pop();
|
267
|
+
}
|
268
|
+
else if (type == "interpolation") state.stack.push("interpolation");
|
269
|
+
else if (type == "@media") state.stack.push("@media");
|
270
|
+
else if (type == "@import") state.stack.push("@import");
|
271
|
+
else if (context == "@media" && /\b(keyword|attribute)\b/.test(style))
|
272
|
+
state.stack.push("@mediaType");
|
273
|
+
else if (context == "@mediaType" && stream.current() == ",") state.stack.pop();
|
274
|
+
else if (context == "@mediaType" && type == "(") state.stack.push("@mediaType(");
|
275
|
+
else if (context == "@mediaType(" && type == ")") state.stack.pop();
|
276
|
+
else if ((context == "rule" || context == "block") && type == ":") state.stack.push("propertyValue");
|
277
|
+
else if (context == "propertyValue" && type == ";") state.stack.pop();
|
278
|
+
else if (context == "@import" && type == ";") state.stack.pop();
|
279
|
+
return style;
|
280
|
+
},
|
281
|
+
|
282
|
+
indent: function(state, textAfter) {
|
283
|
+
var n = state.stack.length;
|
284
|
+
if (/^\}/.test(textAfter))
|
285
|
+
n -= state.stack[state.stack.length-1] == "propertyValue" ? 2 : 1;
|
286
|
+
return state.baseIndent + n * indentUnit;
|
287
|
+
},
|
288
|
+
|
289
|
+
electricChars: "}"
|
290
|
+
};
|
291
|
+
});
|
292
|
+
|
293
|
+
(function() {
|
294
|
+
function keySet(array) {
|
295
|
+
var keys = {};
|
296
|
+
for (var i = 0; i < array.length; ++i) {
|
297
|
+
keys[array[i]] = true;
|
298
|
+
}
|
299
|
+
return keys;
|
300
|
+
}
|
301
|
+
|
302
|
+
var atMediaTypes = keySet([
|
303
|
+
"all", "aural", "braille", "handheld", "print", "projection", "screen",
|
304
|
+
"tty", "tv", "embossed"
|
305
|
+
]);
|
306
|
+
|
307
|
+
var atMediaFeatures = keySet([
|
308
|
+
"width", "min-width", "max-width", "height", "min-height", "max-height",
|
309
|
+
"device-width", "min-device-width", "max-device-width", "device-height",
|
310
|
+
"min-device-height", "max-device-height", "aspect-ratio",
|
311
|
+
"min-aspect-ratio", "max-aspect-ratio", "device-aspect-ratio",
|
312
|
+
"min-device-aspect-ratio", "max-device-aspect-ratio", "color", "min-color",
|
313
|
+
"max-color", "color-index", "min-color-index", "max-color-index",
|
314
|
+
"monochrome", "min-monochrome", "max-monochrome", "resolution",
|
315
|
+
"min-resolution", "max-resolution", "scan", "grid"
|
316
|
+
]);
|
317
|
+
|
318
|
+
var propertyKeywords = keySet([
|
319
|
+
"align-content", "align-items", "align-self", "alignment-adjust",
|
320
|
+
"alignment-baseline", "anchor-point", "animation", "animation-delay",
|
321
|
+
"animation-direction", "animation-duration", "animation-iteration-count",
|
322
|
+
"animation-name", "animation-play-state", "animation-timing-function",
|
323
|
+
"appearance", "azimuth", "backface-visibility", "background",
|
324
|
+
"background-attachment", "background-clip", "background-color",
|
325
|
+
"background-image", "background-origin", "background-position",
|
326
|
+
"background-repeat", "background-size", "baseline-shift", "binding",
|
327
|
+
"bleed", "bookmark-label", "bookmark-level", "bookmark-state",
|
328
|
+
"bookmark-target", "border", "border-bottom", "border-bottom-color",
|
329
|
+
"border-bottom-left-radius", "border-bottom-right-radius",
|
330
|
+
"border-bottom-style", "border-bottom-width", "border-collapse",
|
331
|
+
"border-color", "border-image", "border-image-outset",
|
332
|
+
"border-image-repeat", "border-image-slice", "border-image-source",
|
333
|
+
"border-image-width", "border-left", "border-left-color",
|
334
|
+
"border-left-style", "border-left-width", "border-radius", "border-right",
|
335
|
+
"border-right-color", "border-right-style", "border-right-width",
|
336
|
+
"border-spacing", "border-style", "border-top", "border-top-color",
|
337
|
+
"border-top-left-radius", "border-top-right-radius", "border-top-style",
|
338
|
+
"border-top-width", "border-width", "bottom", "box-decoration-break",
|
339
|
+
"box-shadow", "box-sizing", "break-after", "break-before", "break-inside",
|
340
|
+
"caption-side", "clear", "clip", "color", "color-profile", "column-count",
|
341
|
+
"column-fill", "column-gap", "column-rule", "column-rule-color",
|
342
|
+
"column-rule-style", "column-rule-width", "column-span", "column-width",
|
343
|
+
"columns", "content", "counter-increment", "counter-reset", "crop", "cue",
|
344
|
+
"cue-after", "cue-before", "cursor", "direction", "display",
|
345
|
+
"dominant-baseline", "drop-initial-after-adjust",
|
346
|
+
"drop-initial-after-align", "drop-initial-before-adjust",
|
347
|
+
"drop-initial-before-align", "drop-initial-size", "drop-initial-value",
|
348
|
+
"elevation", "empty-cells", "fit", "fit-position", "flex", "flex-basis",
|
349
|
+
"flex-direction", "flex-flow", "flex-grow", "flex-shrink", "flex-wrap",
|
350
|
+
"float", "float-offset", "font", "font-feature-settings", "font-family",
|
351
|
+
"font-kerning", "font-language-override", "font-size", "font-size-adjust",
|
352
|
+
"font-stretch", "font-style", "font-synthesis", "font-variant",
|
353
|
+
"font-variant-alternates", "font-variant-caps", "font-variant-east-asian",
|
354
|
+
"font-variant-ligatures", "font-variant-numeric", "font-variant-position",
|
355
|
+
"font-weight", "grid-cell", "grid-column", "grid-column-align",
|
356
|
+
"grid-column-sizing", "grid-column-span", "grid-columns", "grid-flow",
|
357
|
+
"grid-row", "grid-row-align", "grid-row-sizing", "grid-row-span",
|
358
|
+
"grid-rows", "grid-template", "hanging-punctuation", "height", "hyphens",
|
359
|
+
"icon", "image-orientation", "image-rendering", "image-resolution",
|
360
|
+
"inline-box-align", "justify-content", "left", "letter-spacing",
|
361
|
+
"line-break", "line-height", "line-stacking", "line-stacking-ruby",
|
362
|
+
"line-stacking-shift", "line-stacking-strategy", "list-style",
|
363
|
+
"list-style-image", "list-style-position", "list-style-type", "margin",
|
364
|
+
"margin-bottom", "margin-left", "margin-right", "margin-top",
|
365
|
+
"marker-offset", "marks", "marquee-direction", "marquee-loop",
|
366
|
+
"marquee-play-count", "marquee-speed", "marquee-style", "max-height",
|
367
|
+
"max-width", "min-height", "min-width", "move-to", "nav-down", "nav-index",
|
368
|
+
"nav-left", "nav-right", "nav-up", "opacity", "order", "orphans", "outline",
|
369
|
+
"outline-color", "outline-offset", "outline-style", "outline-width",
|
370
|
+
"overflow", "overflow-style", "overflow-wrap", "overflow-x", "overflow-y",
|
371
|
+
"padding", "padding-bottom", "padding-left", "padding-right", "padding-top",
|
372
|
+
"page", "page-break-after", "page-break-before", "page-break-inside",
|
373
|
+
"page-policy", "pause", "pause-after", "pause-before", "perspective",
|
374
|
+
"perspective-origin", "pitch", "pitch-range", "play-during", "position",
|
375
|
+
"presentation-level", "punctuation-trim", "quotes", "rendering-intent",
|
376
|
+
"resize", "rest", "rest-after", "rest-before", "richness", "right",
|
377
|
+
"rotation", "rotation-point", "ruby-align", "ruby-overhang",
|
378
|
+
"ruby-position", "ruby-span", "size", "speak", "speak-as", "speak-header",
|
379
|
+
"speak-numeral", "speak-punctuation", "speech-rate", "stress", "string-set",
|
380
|
+
"tab-size", "table-layout", "target", "target-name", "target-new",
|
381
|
+
"target-position", "text-align", "text-align-last", "text-decoration",
|
382
|
+
"text-decoration-color", "text-decoration-line", "text-decoration-skip",
|
383
|
+
"text-decoration-style", "text-emphasis", "text-emphasis-color",
|
384
|
+
"text-emphasis-position", "text-emphasis-style", "text-height",
|
385
|
+
"text-indent", "text-justify", "text-outline", "text-shadow",
|
386
|
+
"text-space-collapse", "text-transform", "text-underline-position",
|
387
|
+
"text-wrap", "top", "transform", "transform-origin", "transform-style",
|
388
|
+
"transition", "transition-delay", "transition-duration",
|
389
|
+
"transition-property", "transition-timing-function", "unicode-bidi",
|
390
|
+
"vertical-align", "visibility", "voice-balance", "voice-duration",
|
391
|
+
"voice-family", "voice-pitch", "voice-range", "voice-rate", "voice-stress",
|
392
|
+
"voice-volume", "volume", "white-space", "widows", "width", "word-break",
|
393
|
+
"word-spacing", "word-wrap", "z-index"
|
394
|
+
]);
|
395
|
+
|
396
|
+
var colorKeywords = keySet([
|
397
|
+
"black", "silver", "gray", "white", "maroon", "red", "purple", "fuchsia",
|
398
|
+
"green", "lime", "olive", "yellow", "navy", "blue", "teal", "aqua"
|
399
|
+
]);
|
400
|
+
|
401
|
+
var valueKeywords = keySet([
|
402
|
+
"above", "absolute", "activeborder", "activecaption", "afar",
|
403
|
+
"after-white-space", "ahead", "alias", "all", "all-scroll", "alternate",
|
404
|
+
"always", "amharic", "amharic-abegede", "antialiased", "appworkspace",
|
405
|
+
"arabic-indic", "armenian", "asterisks", "auto", "avoid", "background",
|
406
|
+
"backwards", "baseline", "below", "bidi-override", "binary", "bengali",
|
407
|
+
"blink", "block", "block-axis", "bold", "bolder", "border", "border-box",
|
408
|
+
"both", "bottom", "break-all", "break-word", "button", "button-bevel",
|
409
|
+
"buttonface", "buttonhighlight", "buttonshadow", "buttontext", "cambodian",
|
410
|
+
"capitalize", "caps-lock-indicator", "caption", "captiontext", "caret",
|
411
|
+
"cell", "center", "checkbox", "circle", "cjk-earthly-branch",
|
412
|
+
"cjk-heavenly-stem", "cjk-ideographic", "clear", "clip", "close-quote",
|
413
|
+
"col-resize", "collapse", "compact", "condensed", "contain", "content",
|
414
|
+
"content-box", "context-menu", "continuous", "copy", "cover", "crop",
|
415
|
+
"cross", "crosshair", "currentcolor", "cursive", "dashed", "decimal",
|
416
|
+
"decimal-leading-zero", "default", "default-button", "destination-atop",
|
417
|
+
"destination-in", "destination-out", "destination-over", "devanagari",
|
418
|
+
"disc", "discard", "document", "dot-dash", "dot-dot-dash", "dotted",
|
419
|
+
"double", "down", "e-resize", "ease", "ease-in", "ease-in-out", "ease-out",
|
420
|
+
"element", "ellipsis", "embed", "end", "ethiopic", "ethiopic-abegede",
|
421
|
+
"ethiopic-abegede-am-et", "ethiopic-abegede-gez", "ethiopic-abegede-ti-er",
|
422
|
+
"ethiopic-abegede-ti-et", "ethiopic-halehame-aa-er",
|
423
|
+
"ethiopic-halehame-aa-et", "ethiopic-halehame-am-et",
|
424
|
+
"ethiopic-halehame-gez", "ethiopic-halehame-om-et",
|
425
|
+
"ethiopic-halehame-sid-et", "ethiopic-halehame-so-et",
|
426
|
+
"ethiopic-halehame-ti-er", "ethiopic-halehame-ti-et",
|
427
|
+
"ethiopic-halehame-tig", "ew-resize", "expanded", "extra-condensed",
|
428
|
+
"extra-expanded", "fantasy", "fast", "fill", "fixed", "flat", "footnotes",
|
429
|
+
"forwards", "from", "geometricPrecision", "georgian", "graytext", "groove",
|
430
|
+
"gujarati", "gurmukhi", "hand", "hangul", "hangul-consonant", "hebrew",
|
431
|
+
"help", "hidden", "hide", "higher", "highlight", "highlighttext",
|
432
|
+
"hiragana", "hiragana-iroha", "horizontal", "hsl", "hsla", "icon", "ignore",
|
433
|
+
"inactiveborder", "inactivecaption", "inactivecaptiontext", "infinite",
|
434
|
+
"infobackground", "infotext", "inherit", "initial", "inline", "inline-axis",
|
435
|
+
"inline-block", "inline-table", "inset", "inside", "intrinsic", "invert",
|
436
|
+
"italic", "justify", "kannada", "katakana", "katakana-iroha", "khmer",
|
437
|
+
"landscape", "lao", "large", "larger", "left", "level", "lighter",
|
438
|
+
"line-through", "linear", "lines", "list-item", "listbox", "listitem",
|
439
|
+
"local", "logical", "loud", "lower", "lower-alpha", "lower-armenian",
|
440
|
+
"lower-greek", "lower-hexadecimal", "lower-latin", "lower-norwegian",
|
441
|
+
"lower-roman", "lowercase", "ltr", "malayalam", "match",
|
442
|
+
"media-controls-background", "media-current-time-display",
|
443
|
+
"media-fullscreen-button", "media-mute-button", "media-play-button",
|
444
|
+
"media-return-to-realtime-button", "media-rewind-button",
|
445
|
+
"media-seek-back-button", "media-seek-forward-button", "media-slider",
|
446
|
+
"media-sliderthumb", "media-time-remaining-display", "media-volume-slider",
|
447
|
+
"media-volume-slider-container", "media-volume-sliderthumb", "medium",
|
448
|
+
"menu", "menulist", "menulist-button", "menulist-text",
|
449
|
+
"menulist-textfield", "menutext", "message-box", "middle", "min-intrinsic",
|
450
|
+
"mix", "mongolian", "monospace", "move", "multiple", "myanmar", "n-resize",
|
451
|
+
"narrower", "ne-resize", "nesw-resize", "no-close-quote", "no-drop",
|
452
|
+
"no-open-quote", "no-repeat", "none", "normal", "not-allowed", "nowrap",
|
453
|
+
"ns-resize", "nw-resize", "nwse-resize", "oblique", "octal", "open-quote",
|
454
|
+
"optimizeLegibility", "optimizeSpeed", "oriya", "oromo", "outset",
|
455
|
+
"outside", "overlay", "overline", "padding", "padding-box", "painted",
|
456
|
+
"paused", "persian", "plus-darker", "plus-lighter", "pointer", "portrait",
|
457
|
+
"pre", "pre-line", "pre-wrap", "preserve-3d", "progress", "push-button",
|
458
|
+
"radio", "read-only", "read-write", "read-write-plaintext-only", "relative",
|
459
|
+
"repeat", "repeat-x", "repeat-y", "reset", "reverse", "rgb", "rgba",
|
460
|
+
"ridge", "right", "round", "row-resize", "rtl", "run-in", "running",
|
461
|
+
"s-resize", "sans-serif", "scroll", "scrollbar", "se-resize", "searchfield",
|
462
|
+
"searchfield-cancel-button", "searchfield-decoration",
|
463
|
+
"searchfield-results-button", "searchfield-results-decoration",
|
464
|
+
"semi-condensed", "semi-expanded", "separate", "serif", "show", "sidama",
|
465
|
+
"single", "skip-white-space", "slide", "slider-horizontal",
|
466
|
+
"slider-vertical", "sliderthumb-horizontal", "sliderthumb-vertical", "slow",
|
467
|
+
"small", "small-caps", "small-caption", "smaller", "solid", "somali",
|
468
|
+
"source-atop", "source-in", "source-out", "source-over", "space", "square",
|
469
|
+
"square-button", "start", "static", "status-bar", "stretch", "stroke",
|
470
|
+
"sub", "subpixel-antialiased", "super", "sw-resize", "table",
|
471
|
+
"table-caption", "table-cell", "table-column", "table-column-group",
|
472
|
+
"table-footer-group", "table-header-group", "table-row", "table-row-group",
|
473
|
+
"telugu", "text", "text-bottom", "text-top", "textarea", "textfield", "thai",
|
474
|
+
"thick", "thin", "threeddarkshadow", "threedface", "threedhighlight",
|
475
|
+
"threedlightshadow", "threedshadow", "tibetan", "tigre", "tigrinya-er",
|
476
|
+
"tigrinya-er-abegede", "tigrinya-et", "tigrinya-et-abegede", "to", "top",
|
477
|
+
"transparent", "ultra-condensed", "ultra-expanded", "underline", "up",
|
478
|
+
"upper-alpha", "upper-armenian", "upper-greek", "upper-hexadecimal",
|
479
|
+
"upper-latin", "upper-norwegian", "upper-roman", "uppercase", "urdu", "url",
|
480
|
+
"vertical", "vertical-text", "visible", "visibleFill", "visiblePainted",
|
481
|
+
"visibleStroke", "visual", "w-resize", "wait", "wave", "white", "wider",
|
482
|
+
"window", "windowframe", "windowtext", "x-large", "x-small", "xor",
|
483
|
+
"xx-large", "xx-small"
|
484
|
+
]);
|
485
|
+
|
486
|
+
function tokenCComment(stream, state) {
|
487
|
+
var maybeEnd = false, ch;
|
488
|
+
while ((ch = stream.next()) != null) {
|
489
|
+
if (maybeEnd && ch == "/") {
|
490
|
+
state.tokenize = null;
|
491
|
+
break;
|
492
|
+
}
|
493
|
+
maybeEnd = (ch == "*");
|
494
|
+
}
|
495
|
+
return ["comment", "comment"];
|
496
|
+
}
|
497
|
+
|
498
|
+
CodeMirror.defineMIME("text/css", {
|
499
|
+
atMediaTypes: atMediaTypes,
|
500
|
+
atMediaFeatures: atMediaFeatures,
|
501
|
+
propertyKeywords: propertyKeywords,
|
502
|
+
colorKeywords: colorKeywords,
|
503
|
+
valueKeywords: valueKeywords,
|
504
|
+
hooks: {
|
505
|
+
"<": function(stream, state) {
|
506
|
+
function tokenSGMLComment(stream, state) {
|
507
|
+
var dashes = 0, ch;
|
508
|
+
while ((ch = stream.next()) != null) {
|
509
|
+
if (dashes >= 2 && ch == ">") {
|
510
|
+
state.tokenize = null;
|
511
|
+
break;
|
512
|
+
}
|
513
|
+
dashes = (ch == "-") ? dashes + 1 : 0;
|
514
|
+
}
|
515
|
+
return ["comment", "comment"];
|
516
|
+
}
|
517
|
+
if (stream.eat("!")) {
|
518
|
+
state.tokenize = tokenSGMLComment;
|
519
|
+
return tokenSGMLComment(stream, state);
|
520
|
+
}
|
521
|
+
},
|
522
|
+
"/": function(stream, state) {
|
523
|
+
if (stream.eat("*")) {
|
524
|
+
state.tokenize = tokenCComment;
|
525
|
+
return tokenCComment(stream, state);
|
526
|
+
}
|
527
|
+
return false;
|
528
|
+
}
|
529
|
+
},
|
530
|
+
name: "css-base"
|
531
|
+
});
|
532
|
+
|
533
|
+
CodeMirror.defineMIME("text/x-scss", {
|
534
|
+
atMediaTypes: atMediaTypes,
|
535
|
+
atMediaFeatures: atMediaFeatures,
|
536
|
+
propertyKeywords: propertyKeywords,
|
537
|
+
colorKeywords: colorKeywords,
|
538
|
+
valueKeywords: valueKeywords,
|
539
|
+
allowNested: true,
|
540
|
+
hooks: {
|
541
|
+
"$": function(stream) {
|
542
|
+
stream.match(/^[\w-]+/);
|
543
|
+
if (stream.peek() == ":") {
|
544
|
+
return ["variable", "variable-definition"];
|
545
|
+
}
|
546
|
+
return ["variable", "variable"];
|
547
|
+
},
|
548
|
+
"/": function(stream, state) {
|
549
|
+
if (stream.eat("/")) {
|
550
|
+
stream.skipToEnd();
|
551
|
+
return ["comment", "comment"];
|
552
|
+
} else if (stream.eat("*")) {
|
553
|
+
state.tokenize = tokenCComment;
|
554
|
+
return tokenCComment(stream, state);
|
555
|
+
} else {
|
556
|
+
return ["operator", "operator"];
|
557
|
+
}
|
558
|
+
},
|
559
|
+
"#": function(stream) {
|
560
|
+
if (stream.eat("{")) {
|
561
|
+
return ["operator", "interpolation"];
|
562
|
+
} else {
|
563
|
+
stream.eatWhile(/[\w\\\-]/);
|
564
|
+
return ["atom", "hash"];
|
565
|
+
}
|
566
|
+
}
|
567
|
+
},
|
568
|
+
name: "css-base"
|
569
|
+
});
|
570
|
+
})();
|