Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
05b104c6
Commit
05b104c6
authored
Aug 27, 2009
by
Jacek Caban
Committed by
Alexandre Julliard
Aug 27, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jscript: Fixed parsing regexps starting with '='.
parent
560d6354
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
5 deletions
+18
-5
lex.c
dlls/jscript/lex.c
+5
-2
parser.y
dlls/jscript/parser.y
+10
-3
lang.js
dlls/jscript/tests/lang.js
+3
-0
No files found.
dlls/jscript/lex.c
View file @
05b104c6
...
...
@@ -735,7 +735,7 @@ int parser_lex(void *lval, parser_ctx_t *ctx)
if
(
*
ctx
->
ptr
==
'='
)
{
/* /= */
ctx
->
ptr
++
;
*
(
int
*
)
lval
=
EXPR_ASSIGNDIV
;
return
tAssignOper
;
return
kDIVEQ
;
}
}
return
'/'
;
...
...
@@ -772,7 +772,10 @@ literal_t *parse_regexp(parser_ctx_t *ctx)
TRACE
(
"
\n
"
);
re
=
ctx
->
ptr
;
while
(
*
ctx
->
ptr
!=
'/'
)
ctx
->
ptr
--
;
re
=
++
ctx
->
ptr
;
while
(
ctx
->
ptr
<
ctx
->
end
&&
*
ctx
->
ptr
!=
'/'
)
{
if
(
*
ctx
->
ptr
++
==
'\\'
&&
ctx
->
ptr
<
ctx
->
end
)
ctx
->
ptr
++
;
...
...
dlls/jscript/parser.y
View file @
05b104c6
...
...
@@ -172,7 +172,7 @@ static source_elements_t *source_elements_add_statement(source_elements_t*,state
/* keywords */
%token kBREAK kCASE kCATCH kCONTINUE kDEFAULT kDELETE kDO kELSE kIF kFINALLY kFOR kIN
%token kINSTANCEOF kNEW kNULL kUNDEFINED kRETURN kSWITCH kTHIS kTHROW kTRUE kFALSE kTRY kTYPEOF kVAR kVOID kWHILE kWITH
%token tANDAND tOROR tINC tDEC tHTMLCOMMENT
%token tANDAND tOROR tINC tDEC tHTMLCOMMENT
kDIVEQ
%token <srcptr> kFUNCTION '}'
...
...
@@ -245,6 +245,7 @@ static source_elements_t *source_elements_add_statement(source_elements_t*,state
%type <literal> PropertyName
%type <literal> BooleanLiteral
%type <srcptr> KFunction
%type <ival> AssignOper
%nonassoc LOWER_THAN_ELSE
%nonassoc kELSE
...
...
@@ -515,12 +516,16 @@ ExpressionNoIn
| ExpressionNoIn ',' AssignmentExpressionNoIn
{ $$ = new_binary_expression(ctx, EXPR_COMMA, $1, $3); }
AssignOper
: tAssignOper { $$ = $1; }
| kDIVEQ { $$ = EXPR_ASSIGNDIV; }
/* ECMA-262 3rd Edition 11.13 */
AssignmentExpression
: ConditionalExpression { $$ = $1; }
| LeftHandSideExpression '=' AssignmentExpression
{ $$ = new_binary_expression(ctx, EXPR_ASSIGN, $1, $3); }
| LeftHandSideExpression
t
AssignOper AssignmentExpression
| LeftHandSideExpression AssignOper AssignmentExpression
{ $$ = new_binary_expression(ctx, $2, $1, $3); }
/* ECMA-262 3rd Edition 11.13 */
...
...
@@ -529,7 +534,7 @@ AssignmentExpressionNoIn
{ $$ = $1; }
| LeftHandSideExpression '=' AssignmentExpressionNoIn
{ $$ = new_binary_expression(ctx, EXPR_ASSIGN, $1, $3); }
| LeftHandSideExpression
t
AssignOper AssignmentExpressionNoIn
| LeftHandSideExpression AssignOper AssignmentExpressionNoIn
{ $$ = new_binary_expression(ctx, $2, $1, $3); }
/* ECMA-262 3rd Edition 11.12 */
...
...
@@ -800,6 +805,8 @@ Literal
| tStringLiteral { $$ = new_string_literal(ctx, $1); }
| '/' { $$ = parse_regexp(ctx);
if(!$$) YYABORT; }
| kDIVEQ { $$ = parse_regexp(ctx);
if(!$$) YYABORT; }
/* ECMA-262 3rd Edition 7.8.2 */
BooleanLiteral
...
...
dlls/jscript/tests/lang.js
View file @
05b104c6
...
...
@@ -896,6 +896,9 @@ ok(""+str === "test", "''+str = " + str);
ok
((
function
(){
return
1
;})()
===
1
,
"(function (){return 1;})() = "
+
(
function
(){
return
1
;})());
var
re
=
/=
(\?
|%3F
)
/g
;
ok
(
re
.
source
===
"=(
\\
?|%3F)"
,
"re.source = "
+
re
.
source
);
ok
(
createNullBSTR
()
===
''
,
"createNullBSTR() !== ''"
);
function
do_test
()
{}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment