Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-fonts
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
Aleksandr Isakov
wine-fonts
Commits
dc2133cc
Commit
dc2133cc
authored
Sep 10, 2012
by
Jacek Caban
Committed by
Alexandre Julliard
Sep 10, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jscript: Added support for no new line between break and identifier rule.
parent
3f2365d5
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
11 deletions
+33
-11
engine.h
dlls/jscript/engine.h
+1
-0
lex.c
dlls/jscript/lex.c
+15
-11
lang.js
dlls/jscript/tests/lang.js
+17
-0
No files found.
dlls/jscript/engine.h
View file @
dc2133cc
...
...
@@ -28,6 +28,7 @@ typedef struct {
script_ctx_t
*
script
;
source_elements_t
*
source
;
BOOL
nl
;
BOOL
implicit_nl_semicolon
;
BOOL
is_html
;
BOOL
lexer_error
;
HRESULT
hres
;
...
...
dlls/jscript/lex.c
View file @
dc2133cc
...
...
@@ -68,8 +68,9 @@ static const WCHAR withW[] = {'w','i','t','h',0};
static
const
struct
{
const
WCHAR
*
word
;
int
token
;
BOOL
no_nl
;
}
keywords
[]
=
{
{
breakW
,
kBREAK
},
{
breakW
,
kBREAK
,
TRUE
},
{
caseW
,
kCASE
},
{
catchW
,
kCATCH
},
{
continueW
,
kCONTINUE
},
...
...
@@ -161,8 +162,10 @@ static int check_keywords(parser_ctx_t *ctx, const WCHAR **lval)
i
=
(
min
+
max
)
/
2
;
r
=
check_keyword
(
ctx
,
keywords
[
i
].
word
,
lval
);
if
(
!
r
)
if
(
!
r
)
{
ctx
->
implicit_nl_semicolon
=
keywords
[
i
].
no_nl
;
return
keywords
[
i
].
token
;
}
if
(
r
>
0
)
min
=
i
+
1
;
...
...
@@ -173,14 +176,6 @@ static int check_keywords(parser_ctx_t *ctx, const WCHAR **lval)
return
0
;
}
static
void
skip_spaces
(
parser_ctx_t
*
ctx
)
{
while
(
ctx
->
ptr
<
ctx
->
end
&&
isspaceW
(
*
ctx
->
ptr
))
{
if
(
is_endline
(
*
ctx
->
ptr
++
))
ctx
->
nl
=
TRUE
;
}
}
static
BOOL
skip_html_comment
(
parser_ctx_t
*
ctx
)
{
const
WCHAR
html_commentW
[]
=
{
'<'
,
'!'
,
'-'
,
'-'
,
0
};
...
...
@@ -509,11 +504,20 @@ static int parse_numeric_literal(parser_ctx_t *ctx, literal_t **literal)
static
int
next_token
(
parser_ctx_t
*
ctx
,
void
*
lval
)
{
do
{
skip_spaces
(
ctx
);
while
(
ctx
->
ptr
<
ctx
->
end
&&
isspaceW
(
*
ctx
->
ptr
))
{
if
(
is_endline
(
*
ctx
->
ptr
++
))
ctx
->
nl
=
TRUE
;
}
if
(
ctx
->
ptr
==
ctx
->
end
)
return
tEOF
;
}
while
(
skip_comment
(
ctx
)
||
skip_html_comment
(
ctx
));
if
(
ctx
->
implicit_nl_semicolon
)
{
if
(
ctx
->
nl
)
return
';'
;
ctx
->
implicit_nl_semicolon
=
FALSE
;
}
if
(
isalphaW
(
*
ctx
->
ptr
))
{
int
ret
=
check_keywords
(
ctx
,
lval
);
if
(
ret
)
...
...
dlls/jscript/tests/lang.js
View file @
dc2133cc
...
...
@@ -1355,6 +1355,23 @@ ok(name_override_func === 3, "name_override_func = " + name_override_func);
function name_override_func() {};
ok(name_override_func === 3, "
name_override_func
=
" + name_override_func);
/* NoNewline rule parser tests */
while(true) {
if(true) break
tmp = false
}
while(true) {
if(true) break /*
* no semicolon, but comment present */
tmp = false
}
while(true) {
if(true) break // no semicolon, but comment present
tmp = false
}
/* Keep this test in the end of file */
undefined = 6;
ok(undefined === 6, "
undefined
=
" + undefined);
...
...
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