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
b6e9a83d
Commit
b6e9a83d
authored
Sep 08, 2011
by
Jacek Caban
Committed by
Alexandre Julliard
Sep 08, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vbscript: Added support for call keyword in lexer.
parent
69dcc641
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
57 additions
and
2 deletions
+57
-2
lex.c
dlls/vbscript/lex.c
+56
-2
parser.y
dlls/vbscript/parser.y
+1
-0
No files found.
dlls/vbscript/lex.c
View file @
b6e9a83d
...
...
@@ -26,11 +26,61 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
vbscript
);
static
const
WCHAR
callW
[]
=
{
'c'
,
'a'
,
'l'
,
'l'
,
0
};
static
const
struct
{
const
WCHAR
*
word
;
int
token
;
}
keywords
[]
=
{
{
callW
,
tCALL
}
};
static
inline
BOOL
is_identifier_char
(
WCHAR
c
)
{
return
isalnumW
(
c
)
||
c
==
'_'
;
}
static
int
check_keyword
(
parser_ctx_t
*
ctx
,
const
WCHAR
*
word
)
{
const
WCHAR
*
p1
=
ctx
->
ptr
;
const
WCHAR
*
p2
=
word
;
WCHAR
c
;
while
(
p1
<
ctx
->
end
&&
*
p2
)
{
c
=
tolowerW
(
*
p1
);
if
(
c
!=
*
p2
)
return
c
-
*
p2
;
p1
++
;
p2
++
;
}
if
(
*
p2
||
(
p1
<
ctx
->
end
&&
is_identifier_char
(
*
p1
)))
return
1
;
ctx
->
ptr
=
p1
;
return
0
;
}
static
int
check_keywords
(
parser_ctx_t
*
ctx
)
{
int
min
=
0
,
max
=
sizeof
(
keywords
)
/
sizeof
(
keywords
[
0
])
-
1
,
r
,
i
;
while
(
min
<=
max
)
{
i
=
(
min
+
max
)
/
2
;
r
=
check_keyword
(
ctx
,
keywords
[
i
].
word
);
if
(
!
r
)
return
keywords
[
i
].
token
;
if
(
r
>
0
)
min
=
i
+
1
;
else
max
=
i
-
1
;
}
return
0
;
}
static
int
parse_identifier
(
parser_ctx_t
*
ctx
,
const
WCHAR
**
ret
)
{
const
WCHAR
*
ptr
=
ctx
->
ptr
++
;
...
...
@@ -62,8 +112,12 @@ static int parse_next_token(void *lval, parser_ctx_t *ctx)
c
=
*
ctx
->
ptr
;
if
(
isalphaW
(
c
))
return
parse_identifier
(
ctx
,
lval
);
if
(
isalphaW
(
c
))
{
int
ret
=
check_keywords
(
ctx
);
if
(
!
ret
)
return
parse_identifier
(
ctx
,
lval
);
return
ret
;
}
switch
(
c
)
{
case
'\n'
:
...
...
dlls/vbscript/parser.y
View file @
b6e9a83d
...
...
@@ -54,6 +54,7 @@ static statement_t *new_call_statement(parser_ctx_t*,member_expression_t*);
}
%token tEOF tNL blah
%token tCALL
%token <string> tIdentifier
%type <statement> Statement StatementNl
...
...
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