support for directives

This commit is contained in:
Mihai Bazon
2012-09-18 13:21:09 +03:00
parent 21968285e8
commit 3da0ac4897
5 changed files with 27 additions and 4 deletions

View File

@@ -773,8 +773,8 @@ function parse($TEXT, exigent_mode) {
case "string":
var dir = S.in_directives, stat = simple_statement();
// XXXv2: decide how to fix directives
// if (dir && stat instanceof AST_String && !is("punc", ","))
// return new AST_Directive({ value: stat.value });
if (dir && stat.body instanceof AST_String && !is("punc", ","))
return new AST_Directive({ value: stat.body.value });
return stat;
case "num":
case "regexp":