-
Notifications
You must be signed in to change notification settings - Fork 1
/
ext_sass.cpp
624 lines (518 loc) · 22.1 KB
/
ext_sass.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
/*
+----------------------------------------------------------------------+
| Integration of libsass for HHVM |
+----------------------------------------------------------------------+
| Copyright (c) 2015 - 2017 Alexander Papst |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
| http://www.php.net/license/3_01.txt |
| If you did not receive a copy of the PHP license and are unable to |
| obtain it through the world-wide-web, please send a note to |
| license@php.net so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
*/
#include "hphp/runtime/ext/extension.h"
#include "hphp/runtime/base/array-init.h"
#include "hphp/runtime/base/string-util.h"
#include "hphp/runtime/base/builtin-functions.h"
#include "hphp/runtime/ext/std/ext_std_variable.h"
#include "hphp/runtime/vm/vm-regs.h"
#include "hphp/runtime/vm/native-data.h"
#include "lib/libsass/include/sass.h"
#include "src/SassTypesFactory.h"
#include "src/ExceptionManager.h"
#include "src/CallbackBridge.h"
#include "src/CustomFunctionBridge.h"
#include "src/CustomImporterBridge.h"
namespace HPHP {
const StaticString s_Sass("Sass\\Sass");
const StaticString s_STYLE_NESTED("STYLE_NESTED");
const StaticString s_STYLE_EXPANDED("STYLE_EXPANDED");
const StaticString s_STYLE_COMPACT("STYLE_COMPACT");
const StaticString s_STYLE_COMPRESSED("STYLE_COMPRESSED");
const StaticString s_SYNTAX_SCSS("SYNTAX_SCSS");
const StaticString s_SYNTAX_SASS("SYNTAX_SASS");
const int64_t i_SYNTAX_SCSS = 1;
const int64_t i_SYNTAX_SASS = 2;
const StaticString s_SASS2SCSS_PRETTIFY_0("SASS2SCSS_PRETTIFY_0");
const StaticString s_SASS2SCSS_PRETTIFY_1("SASS2SCSS_PRETTIFY_1");
const StaticString s_SASS2SCSS_PRETTIFY_2("SASS2SCSS_PRETTIFY_2");
const StaticString s_SASS2SCSS_PRETTIFY_3("SASS2SCSS_PRETTIFY_3");
const StaticString s_SASS2SCSS_KEEP_COMMENT("SASS2SCSS_KEEP_COMMENT");
const StaticString s_SASS2SCSS_STRIP_COMMENT("SASS2SCSS_STRIP_COMMENT");
const StaticString s_SASS2SCSS_CONVERT_COMMENT("SASS2SCSS_CONVERT_COMMENT");
const StaticString s_SassResponse_css("css");
const StaticString s_SassResponse_map("map");
const StaticString s_SassImporter_callback("callback");
const StaticString s_SassImporter_priority("priority");
const StaticString s_SassHeader_content("content");
const StaticString s_SassTypesSassValue("Sass\\Types\\SassValue");
const StaticString s_OP_AND("OP_AND");
const StaticString s_OP_OR("OP_OR");
const StaticString s_OP_EQ("OP_EQ");
const StaticString s_OP_NEQ("OP_NEQ");
const StaticString s_OP_GT("OP_GT");
const StaticString s_OP_GTE("OP_GTE");
const StaticString s_OP_LT("OP_LT");
const StaticString s_OP_LTE("OP_LTE");
const StaticString s_OP_ADD("OP_ADD");
const StaticString s_OP_SUB("OP_SUB");
const StaticString s_OP_MUL("OP_MUL");
const StaticString s_OP_DIV("OP_DIV");
const StaticString s_OP_MOD("OP_MOD");
const StaticString s_RuntimeExceptionClass("RuntimeException");
#ifdef __WIN__
const StaticString s_Glue(";");
#else
const StaticString s_Glue(",");
#endif
struct Sass_Context_Wrapper {
Sass_Data_Context* dctx;
Sass_File_Context* fctx;
Sass_Context* ctx;
};
struct Sass_Context_Wrapper* sass_make_context_wrapper() {
return (Sass_Context_Wrapper*)safe_calloc(1, sizeof(Sass_Context_Wrapper));
}
struct Sass_Context_Wrapper* sass_make_data_context_wrapper(const String& source) {
struct Sass_Context_Wrapper* ctx_w = sass_make_context_wrapper();
ctx_w->dctx = sass_make_data_context(sass_copy_c_string(source.c_str()));
ctx_w->ctx = sass_data_context_get_context(ctx_w->dctx);
return ctx_w;
}
struct Sass_Context_Wrapper* sass_make_file_context_wrapper(const char* input_path) {
struct Sass_Context_Wrapper* ctx_w = sass_make_context_wrapper();
ctx_w->fctx = sass_make_file_context(input_path);
ctx_w->ctx = sass_file_context_get_context(ctx_w->fctx);
return ctx_w;
}
union Sass_Value* sass_custom_function(const union Sass_Value* s_args,
Sass_Function_Entry cb,
struct Sass_Compiler* comp) {
void* cookie = sass_function_get_cookie(cb);
CustomFunctionBridge& bridge = *(static_cast<CustomFunctionBridge*>(cookie));
std::vector<void*> argv;
for (unsigned l = sass_list_get_length(s_args), i = 0; i < l; i++) {
argv.push_back((void*)sass_list_get_value(s_args, i));
}
return bridge(argv);
}
Sass_Import_List sass_custom_importer(const char* cur_path,
Sass_Importer_Entry cb,
struct Sass_Compiler* comp) {
void* cookie = sass_importer_get_cookie(cb);
struct Sass_Import* previous = sass_compiler_get_last_import(comp);
const char* prev_path = sass_import_get_abs_path(previous);
CustomImporterBridge& bridge = *(static_cast<CustomImporterBridge*>(cookie));
std::vector<void*> argv;
argv.push_back((void*)cur_path);
argv.push_back((void*)prev_path);
return bridge(argv);
}
// create a custom header to define to variables
Sass_Import_List custom_header(const char* cur_path, Sass_Importer_Entry cb, struct Sass_Compiler* comp)
{
const char* header = static_cast<const char*>(sass_importer_get_cookie(cb));
// create a list to hold our import entries
Sass_Import_List incs = sass_make_import_list(1);
// create our only import entry (must make copy)
incs[0] = sass_make_import_entry("[header]", strdup(header), 0);
// return imports
return incs;
}
static void set_sass_options(ObjectData* obj, struct Sass_Options* opts) {
Array fnCallbacks = obj->o_get("userFunctions", true, s_Sass).toArray();
if (!fnCallbacks.empty()) {
Sass_Function_List fn_list = sass_make_function_list(fnCallbacks.length());
int64_t i = 0;
for (ArrayIter fn_iter(fnCallbacks); fn_iter; ++fn_iter, ++i) {
String signature(fn_iter.first().toString());
Variant callback = fn_iter.second();
CustomFunctionBridge *bridge = new CustomFunctionBridge(callback);
sass_function_set_list_entry(
fn_list,
i,
sass_make_function(signature.c_str(), sass_custom_function, bridge)
);
}
sass_option_set_c_functions(opts, fn_list);
}
Array fnImportCallbacks = obj->o_get("userImporters", true, s_Sass).toArray();
if (!fnImportCallbacks.empty()) {
auto callback_length = fnImportCallbacks.length();
Sass_Importer_List fn_importer_list = sass_make_importer_list(callback_length);
int64_t i = 0;
for (ArrayIter fn_iter(fnImportCallbacks); fn_iter; ++fn_iter, ++i) {
Variant v = fn_iter.second();
if (!v.isArray()) {
continue;
}
Array a = v.toArray();
if (!a.exists(s_SassImporter_callback)
|| !a.exists(s_SassImporter_priority)
) {
continue;
}
CustomImporterBridge *bridge = new CustomImporterBridge(
a[s_SassImporter_callback]
);
fn_importer_list[i] = sass_make_importer(
sass_custom_importer,
a[s_SassImporter_priority].toDouble(),
bridge
);
}
sass_option_set_c_importers(opts, fn_importer_list);
}
Array headers = obj->o_get("headers", true, s_Sass).toArray();
if (!headers.empty()) {
headers.sort([](const Variant& v1, const Variant& v2, const void *data) -> int {
int64_t vi1 = v1.toArray()[s_SassImporter_priority].toInt64();
int64_t vi2 = v2.toArray()[s_SassImporter_priority].toInt64();
return (vi1 == vi2) ? 0 : ((vi1 < vi2) ? 1 : -1);
}, false, false, nullptr);
String header;
for (ArrayIter iter(headers); iter; ++iter) {
header += iter.secondRef().toArray()[s_SassHeader_content].toString()+"\n";
}
// allocate a custom function caller
Sass_Importer_Entry c_header = sass_make_importer(
custom_header,
5000, // There is just one, so meh.
(void*)header.c_str()
);
// create list of all custom functions
Sass_Importer_List c_headers = sass_make_importer_list(1);
if (!c_headers) {
throw_object(
ExceptionManager::createSassException(
String::FromCStr("Couldn't allocate enough memory for the custom header."),
String::FromCStr(""),
54550001
)
);
}
// put the only function in this plugin to the list
sass_importer_set_list_entry(c_headers, 0, c_header);
// return the list
sass_option_set_c_headers(opts, c_headers);
}
// All options have been validated in ext_sass.php
sass_option_set_precision(opts, obj->o_get("precision", true, s_Sass).toInt64Val());
sass_option_set_output_style(
opts,
(Sass_Output_Style)obj->o_get("style", true, s_Sass).toInt64Val()
);
Array includePaths = obj->o_get("includePaths", true, s_Sass).toCArrRef();
if (!includePaths.empty()) {
sass_option_set_include_path(
opts,
StringUtil::Implode(includePaths, s_Glue).c_str()
);
}
bool includeSourceComments = obj->o_get("sourceComments", true, s_Sass).toBooleanVal();
sass_option_set_source_comments(opts, includeSourceComments);
if (includeSourceComments) {
sass_option_set_omit_source_map_url(opts, false);
}
sass_option_set_is_indented_syntax_src(
opts,
obj->o_get("syntax", true, s_Sass).toInt64Val() == i_SYNTAX_SASS
);
if (!obj->o_get("linefeed", true, s_Sass).isNull()) {
sass_option_set_linefeed(
opts,
obj->o_get("linefeed", true, s_Sass).toString().c_str()
);
}
if (!obj->o_get("indent", true, s_Sass).isNull()) {
sass_option_set_indent(
opts,
obj->o_get("indent", true, s_Sass).toString().c_str()
);
}
sass_option_set_source_map_embed(
opts,
obj->o_get("embedMap", true, s_Sass).toBooleanVal()
);
if (!obj->o_get("sourceRoot", true, s_Sass).isNull()) {
sass_option_set_source_map_root(
opts,
obj->o_get("sourceRoot", true, s_Sass).toString().c_str()
);
}
}
void sass_free_context_wrapper(struct Sass_Context_Wrapper* ctx_w) {
if (ctx_w->ctx) {
struct Sass_Options* opts = sass_context_get_options(ctx_w->ctx);
Sass_Function_List fnlist = sass_option_get_c_functions(opts);
if (fnlist) {
while (fnlist && *fnlist) {
void* cookie = sass_function_get_cookie(*fnlist);
CustomFunctionBridge* bridge = (static_cast<CustomFunctionBridge*>(cookie));
delete bridge;
++fnlist;
}
}
Sass_Importer_List importers = sass_option_get_c_importers(opts);
if (importers) {
while (importers && *importers) {
void* cookie = sass_importer_get_cookie(*importers);
CustomImporterBridge* bridge = (static_cast<CustomImporterBridge*>(cookie));
delete bridge;
++importers;
}
}
}
if (ctx_w->dctx) {
sass_delete_data_context(ctx_w->dctx);
} else if (ctx_w->fctx) {
sass_delete_file_context(ctx_w->fctx);
}
free(ctx_w);
}
static Array compileScss(ObjectData* obj, struct Sass_Context_Wrapper* ctx_w) {
struct Sass_Options* opts;
int64_t status;
if (ctx_w->fctx) {
ctx_w->ctx = sass_file_context_get_context(ctx_w->fctx);
} else {
ctx_w->ctx = sass_data_context_get_context(ctx_w->dctx);
}
opts = sass_context_get_options(ctx_w->ctx);
set_sass_options(obj, opts);
if (sass_option_get_source_map_file(opts) != 0) {
sass_option_set_omit_source_map_url(opts, false);
sass_option_set_source_map_contents(opts, true);
}
if (ctx_w->fctx) {
status = sass_compile_file_context(ctx_w->fctx);
} else {
status = sass_compile_data_context(ctx_w->dctx);
}
// Check the context for any errors...
if (status != 0) {
String exMsg = String::FromCStr(sass_context_get_error_message(ctx_w->ctx));
String exJson = String::FromCStr(sass_context_get_error_json(ctx_w->ctx));
sass_free_context_wrapper(ctx_w);
throw_object(ExceptionManager::createSassException(exMsg, exJson, status));
}
Array response = Array::Create();
response.set(
s_SassResponse_css,
String::FromCStr(sass_context_get_output_string(ctx_w->ctx))
);
if (sass_option_get_source_map_file(opts) != 0) {
response.set(
s_SassResponse_map,
String::FromCStr(sass_context_get_source_map_string(ctx_w->ctx))
);
}
sass_free_context_wrapper(ctx_w);
return response;
}
static String HHVM_METHOD(Sass, compile, const String& source) {
VMRegAnchor _;
struct Sass_Context_Wrapper* ctx_w = sass_make_data_context_wrapper(source);
Array response = compileScss(this_, ctx_w);
return response[s_SassResponse_css].toString();
}
static Array HHVM_METHOD(Sass, compileWithMap, const String& source, const String& mapfile) {
VMRegAnchor _;
struct Sass_Context_Wrapper* ctx_w = sass_make_data_context_wrapper(source);
struct Sass_Options* opts = sass_context_get_options(ctx_w->ctx);
sass_option_set_source_map_file(opts, mapfile.c_str());
Array response = compileScss(this_, ctx_w);
return response;
}
static String HHVM_METHOD(Sass, compileFileNative, const String& file) {
VMRegAnchor _;
struct Sass_Context_Wrapper* ctx_w
= sass_make_file_context_wrapper(file.c_str());
Array response = compileScss(this_, ctx_w);
return response[s_SassResponse_css].toString();
}
static Array HHVM_METHOD(Sass, compileFileWithMapNative, const String& file, const String& mapfile) {
VMRegAnchor _;
struct Sass_Context_Wrapper* ctx_w
= sass_make_file_context_wrapper(file.c_str());
struct Sass_Options* opts = sass_context_get_options(ctx_w->ctx);
sass_option_set_source_map_file(opts, mapfile.c_str());
Array response = compileScss(this_, ctx_w);
return response;
}
static String HHVM_STATIC_METHOD(Sass, sass2scss, const String& sass, int64_t options) {
char* scss = sass2scss(sass.c_str(), options);
String s(scss);
free(scss);
return s;
}
static String HHVM_STATIC_METHOD(Sass, getLibraryVersion) {
return String::FromCStr(libsass_version());
}
static String HHVM_STATIC_METHOD(Sass, getLanguageVersion) {
return String::FromCStr(libsass_language_version());
}
static String HHVM_STATIC_METHOD(Sass, getSass2ScssVersion) {
return String::FromCStr(sass2scss_version());
}
static Variant HHVM_METHOD(SassTypesValue, operate, int64_t op, const Variant& rh) {
VMRegAnchor _;
union Sass_Value* lhs = SassTypesFactory::to_sass(Variant(this_));
union Sass_Value* rhs = SassTypesFactory::to_sass(rh);
union Sass_Value* rs = 0;
switch ((enum Sass_OP)op) {
case Sass_OP::AND:
case Sass_OP::OR:
case Sass_OP::EQ:
case Sass_OP::NEQ:
case Sass_OP::GT:
case Sass_OP::GTE:
case Sass_OP::LT:
case Sass_OP::LTE:
case Sass_OP::ADD:
case Sass_OP::SUB:
case Sass_OP::MUL:
case Sass_OP::DIV:
case Sass_OP::MOD: {
rs = sass_value_op((enum Sass_OP)op, lhs, rhs);
break;
}
default: {
rs = sass_make_error("Invalid operator");
break;
}
}
sass_delete_value(rhs);
sass_delete_value(lhs);
if (UNLIKELY(sass_value_is_warning(rs))) {
auto message = String(sass_warning_get_message(rs));
sass_delete_value(rs);
throw_object(
s_RuntimeExceptionClass,
make_packed_array(message, 54551050)
);
} else if (sass_value_is_error(rs)) {
auto message = String(sass_error_get_message(rs));
sass_delete_value(rs);
throw_object(
s_RuntimeExceptionClass,
make_packed_array(message, 54551051)
);
}
Variant r = SassTypesFactory::to_php(rs);
sass_delete_value(rs);
return r;
}
static String HHVM_STATIC_METHOD(SassTypesString, quoteNative, const String& str) {
char* quoted = sass_string_quote(str.c_str(), '*');
String q(quoted);
free(quoted);
return q;
}
static String HHVM_STATIC_METHOD(SassTypesString, unquoteNative, const String& str) {
char* unquoted = sass_string_unquote(str.c_str());
String uq(unquoted);
free(unquoted);
return uq;
}
static class SassExtension : public Extension {
public:
SassExtension() : Extension("sass", "0.4-dev") {}
virtual void moduleInit() {
HHVM_MALIAS(Sass\\Sass, compile, Sass, compile);
HHVM_MALIAS(Sass\\Sass, compileWithMap, Sass, compileWithMap);
HHVM_MALIAS(Sass\\Sass, compileFileNative, Sass, compileFileNative);
HHVM_MALIAS(Sass\\Sass, compileFileWithMapNative, Sass, compileFileWithMapNative);
HHVM_STATIC_MALIAS(Sass\\Sass, sass2scss, Sass, sass2scss);
HHVM_STATIC_MALIAS(Sass\\Sass, getLibraryVersion, Sass, getLibraryVersion);
HHVM_STATIC_MALIAS(Sass\\Sass, getLanguageVersion, Sass, getLanguageVersion);
HHVM_STATIC_MALIAS(Sass\\Sass, getSass2ScssVersion, Sass, getSass2ScssVersion);
Native::registerClassConstant<KindOfInt64>(s_Sass.get(),
s_STYLE_NESTED.get(),
SASS_STYLE_NESTED);
Native::registerClassConstant<KindOfInt64>(s_Sass.get(),
s_STYLE_EXPANDED.get(),
SASS_STYLE_EXPANDED);
Native::registerClassConstant<KindOfInt64>(s_Sass.get(),
s_STYLE_COMPACT.get(),
SASS_STYLE_COMPACT);
Native::registerClassConstant<KindOfInt64>(s_Sass.get(),
s_STYLE_COMPRESSED.get(),
SASS_STYLE_COMPRESSED);
Native::registerClassConstant<KindOfInt64>(s_Sass.get(),
s_SYNTAX_SCSS.get(),
i_SYNTAX_SCSS);
Native::registerClassConstant<KindOfInt64>(s_Sass.get(),
s_SYNTAX_SASS.get(),
i_SYNTAX_SASS);
Native::registerClassConstant<KindOfInt64>(s_Sass.get(),
s_SASS2SCSS_PRETTIFY_0.get(),
SASS2SCSS_PRETTIFY_0);
Native::registerClassConstant<KindOfInt64>(s_Sass.get(),
s_SASS2SCSS_PRETTIFY_1.get(),
SASS2SCSS_PRETTIFY_1);
Native::registerClassConstant<KindOfInt64>(s_Sass.get(),
s_SASS2SCSS_PRETTIFY_2.get(),
SASS2SCSS_PRETTIFY_2);
Native::registerClassConstant<KindOfInt64>(s_Sass.get(),
s_SASS2SCSS_PRETTIFY_3.get(),
SASS2SCSS_PRETTIFY_3);
Native::registerClassConstant<KindOfInt64>(s_Sass.get(),
s_SASS2SCSS_KEEP_COMMENT.get(),
SASS2SCSS_KEEP_COMMENT);
Native::registerClassConstant<KindOfInt64>(s_Sass.get(),
s_SASS2SCSS_STRIP_COMMENT.get(),
SASS2SCSS_STRIP_COMMENT);
Native::registerClassConstant<KindOfInt64>(s_Sass.get(),
s_SASS2SCSS_CONVERT_COMMENT.get(),
SASS2SCSS_CONVERT_COMMENT);
HHVM_MALIAS(Sass\\Types\\SassValue, operate, SassTypesValue, operate);
Native::registerClassConstant<KindOfInt64>(s_SassTypesSassValue.get(),
s_OP_AND.get(),
Sass_OP::AND);
Native::registerClassConstant<KindOfInt64>(s_SassTypesSassValue.get(),
s_OP_OR.get(),
Sass_OP::OR);
Native::registerClassConstant<KindOfInt64>(s_SassTypesSassValue.get(),
s_OP_EQ.get(),
Sass_OP::EQ);
Native::registerClassConstant<KindOfInt64>(s_SassTypesSassValue.get(),
s_OP_NEQ.get(),
Sass_OP::NEQ);
Native::registerClassConstant<KindOfInt64>(s_SassTypesSassValue.get(),
s_OP_GT.get(),
Sass_OP::GT);
Native::registerClassConstant<KindOfInt64>(s_SassTypesSassValue.get(),
s_OP_GTE.get(),
Sass_OP::GTE);
Native::registerClassConstant<KindOfInt64>(s_SassTypesSassValue.get(),
s_OP_LT.get(),
Sass_OP::LT);
Native::registerClassConstant<KindOfInt64>(s_SassTypesSassValue.get(),
s_OP_LTE.get(),
Sass_OP::LTE);
Native::registerClassConstant<KindOfInt64>(s_SassTypesSassValue.get(),
s_OP_ADD.get(),
Sass_OP::ADD);
Native::registerClassConstant<KindOfInt64>(s_SassTypesSassValue.get(),
s_OP_SUB.get(),
Sass_OP::SUB);
Native::registerClassConstant<KindOfInt64>(s_SassTypesSassValue.get(),
s_OP_MUL.get(),
Sass_OP::MUL);
Native::registerClassConstant<KindOfInt64>(s_SassTypesSassValue.get(),
s_OP_DIV.get(),
Sass_OP::DIV);
Native::registerClassConstant<KindOfInt64>(s_SassTypesSassValue.get(),
s_OP_MOD.get(),
Sass_OP::MOD);
HHVM_STATIC_MALIAS(Sass\\Types\\SassString, quoteNative, SassTypesString, quoteNative);
HHVM_STATIC_MALIAS(Sass\\Types\\SassString, unquoteNative, SassTypesString, unquoteNative);
loadSystemlib();
}
} s_sass_extension;
HHVM_GET_MODULE(sass)
} // namespace HPHP