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
290f5631
Commit
290f5631
authored
Oct 18, 2012
by
Jacek Caban
Committed by
Alexandre Julliard
Oct 18, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vbscript: Added support for HTML comments.
parent
68c1bf50
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
30 additions
and
14 deletions
+30
-14
compile.c
dlls/vbscript/compile.c
+2
-2
lex.c
dlls/vbscript/lex.c
+19
-7
parse.h
dlls/vbscript/parse.h
+2
-1
parser.y
dlls/vbscript/parser.y
+4
-1
vbscript.c
dlls/vbscript/vbscript.c
+2
-2
vbscript.h
dlls/vbscript/vbscript.h
+1
-1
No files found.
dlls/vbscript/compile.c
View file @
290f5631
...
...
@@ -1644,7 +1644,7 @@ static void release_compiler(compile_ctx_t *ctx)
release_vbscode
(
ctx
->
code
);
}
HRESULT
compile_script
(
script_ctx_t
*
script
,
const
WCHAR
*
src
,
vbscode_t
**
ret
)
HRESULT
compile_script
(
script_ctx_t
*
script
,
const
WCHAR
*
src
,
const
WCHAR
*
delimiter
,
vbscode_t
**
ret
)
{
function_t
*
new_func
;
function_decl_t
*
func_decl
;
...
...
@@ -1653,7 +1653,7 @@ HRESULT compile_script(script_ctx_t *script, const WCHAR *src, vbscode_t **ret)
vbscode_t
*
code
;
HRESULT
hres
;
hres
=
parse_script
(
&
ctx
.
parser
,
src
);
hres
=
parse_script
(
&
ctx
.
parser
,
src
,
delimiter
);
if
(
FAILED
(
hres
))
return
hres
;
...
...
dlls/vbscript/lex.c
View file @
290f5631
...
...
@@ -320,6 +320,16 @@ static void skip_spaces(parser_ctx_t *ctx)
ctx
->
ptr
++
;
}
static
int
comment_line
(
parser_ctx_t
*
ctx
)
{
ctx
->
ptr
=
strchrW
(
ctx
->
ptr
,
'\n'
);
if
(
ctx
->
ptr
)
ctx
->
ptr
++
;
else
ctx
->
ptr
=
ctx
->
end
;
return
tNL
;
}
static
int
parse_next_token
(
void
*
lval
,
parser_ctx_t
*
ctx
)
{
WCHAR
c
;
...
...
@@ -347,18 +357,12 @@ static int parse_next_token(void *lval, parser_ctx_t *ctx)
ctx
->
ptr
++
;
return
tNL
;
case
'\''
:
ctx
->
ptr
=
strchrW
(
ctx
->
ptr
,
'\n'
);
if
(
ctx
->
ptr
)
ctx
->
ptr
++
;
else
ctx
->
ptr
=
ctx
->
end
;
return
tNL
;
return
comment_line
(
ctx
);
case
':'
:
case
')'
:
case
','
:
case
'='
:
case
'+'
:
case
'-'
:
case
'*'
:
case
'/'
:
case
'^'
:
...
...
@@ -366,6 +370,11 @@ static int parse_next_token(void *lval, parser_ctx_t *ctx)
case
'.'
:
case
'_'
:
return
*
ctx
->
ptr
++
;
case
'-'
:
if
(
ctx
->
is_html
&&
ctx
->
ptr
[
1
]
==
'-'
&&
ctx
->
ptr
[
2
]
==
'>'
)
return
comment_line
(
ctx
);
ctx
->
ptr
++
;
return
'-'
;
case
'('
:
/* NOTE:
* We resolve empty brackets in lexer instead of parser to avoid complex conflicts
...
...
@@ -392,6 +401,9 @@ static int parse_next_token(void *lval, parser_ctx_t *ctx)
case
'='
:
ctx
->
ptr
++
;
return
tLTEQ
;
case
'!'
:
if
(
ctx
->
is_html
&&
ctx
->
ptr
[
1
]
==
'-'
&&
ctx
->
ptr
[
2
]
==
'-'
)
return
comment_line
(
ctx
);
}
return
'<'
;
case
'>'
:
...
...
dlls/vbscript/parse.h
View file @
290f5631
...
...
@@ -253,6 +253,7 @@ typedef struct {
BOOL
option_explicit
;
BOOL
parse_complete
;
BOOL
is_html
;
HRESULT
hres
;
int
last_token
;
...
...
@@ -265,7 +266,7 @@ typedef struct {
vbsheap_t
heap
;
}
parser_ctx_t
;
HRESULT
parse_script
(
parser_ctx_t
*
,
const
WCHAR
*
)
DECLSPEC_HIDDEN
;
HRESULT
parse_script
(
parser_ctx_t
*
,
const
WCHAR
*
,
const
WCHAR
*
)
DECLSPEC_HIDDEN
;
void
parser_release
(
parser_ctx_t
*
)
DECLSPEC_HIDDEN
;
int
parser_lex
(
void
*
,
parser_ctx_t
*
)
DECLSPEC_HIDDEN
;
void
*
parser_alloc
(
parser_ctx_t
*
,
size_t
)
DECLSPEC_HIDDEN
;
dlls/vbscript/parser.y
View file @
290f5631
...
...
@@ -919,8 +919,10 @@ void *parser_alloc(parser_ctx_t *ctx, size_t size)
return ret;
}
HRESULT parse_script(parser_ctx_t *ctx, const WCHAR *code)
HRESULT parse_script(parser_ctx_t *ctx, const WCHAR *code
, const WCHAR *delimiter
)
{
const WCHAR html_delimiterW[] = {'<','/','s','c','r','i','p','t','>',0};
ctx->code = ctx->ptr = code;
ctx->end = ctx->code + strlenW(ctx->code);
...
...
@@ -934,6 +936,7 @@ HRESULT parse_script(parser_ctx_t *ctx, const WCHAR *code)
ctx->stats = ctx->stats_tail = NULL;
ctx->class_decls = NULL;
ctx->option_explicit = FALSE;
ctx->is_html = delimiter && !strcmpiW(delimiter, html_delimiterW);
parser_parse(ctx);
...
...
dlls/vbscript/vbscript.c
View file @
290f5631
...
...
@@ -612,7 +612,7 @@ static HRESULT WINAPI VBScriptParse_ParseScriptText(IActiveScriptParse *iface,
if
(
This
->
thread_id
!=
GetCurrentThreadId
()
||
This
->
state
==
SCRIPTSTATE_CLOSED
)
return
E_UNEXPECTED
;
hres
=
compile_script
(
This
->
ctx
,
pstrCode
,
&
code
);
hres
=
compile_script
(
This
->
ctx
,
pstrCode
,
pstrDelimiter
,
&
code
);
if
(
FAILED
(
hres
))
return
hres
;
...
...
@@ -672,7 +672,7 @@ static HRESULT WINAPI VBScriptParseProcedure_ParseProcedureText(IActiveScriptPar
if
(
This
->
thread_id
!=
GetCurrentThreadId
()
||
This
->
state
==
SCRIPTSTATE_CLOSED
)
return
E_UNEXPECTED
;
hres
=
compile_script
(
This
->
ctx
,
pstrCode
,
&
code
);
hres
=
compile_script
(
This
->
ctx
,
pstrCode
,
pstrDelimiter
,
&
code
);
if
(
FAILED
(
hres
))
return
hres
;
...
...
dlls/vbscript/vbscript.h
View file @
290f5631
...
...
@@ -326,7 +326,7 @@ struct _vbscode_t {
};
void
release_vbscode
(
vbscode_t
*
)
DECLSPEC_HIDDEN
;
HRESULT
compile_script
(
script_ctx_t
*
,
const
WCHAR
*
,
vbscode_t
**
)
DECLSPEC_HIDDEN
;
HRESULT
compile_script
(
script_ctx_t
*
,
const
WCHAR
*
,
const
WCHAR
*
,
vbscode_t
**
)
DECLSPEC_HIDDEN
;
HRESULT
exec_script
(
script_ctx_t
*
,
function_t
*
,
IDispatch
*
,
DISPPARAMS
*
,
VARIANT
*
)
DECLSPEC_HIDDEN
;
void
release_dynamic_vars
(
dynamic_var_t
*
)
DECLSPEC_HIDDEN
;
...
...
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