Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
0e415e0c
Commit
0e415e0c
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 lexer support for string literals.
parent
d145d0c0
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
46 additions
and
1 deletion
+46
-1
lex.c
dlls/vbscript/lex.c
+45
-0
parser.y
dlls/vbscript/parser.y
+1
-1
No files found.
dlls/vbscript/lex.c
View file @
0e415e0c
...
...
@@ -197,6 +197,49 @@ static int parse_identifier(parser_ctx_t *ctx, const WCHAR **ret)
return
tIdentifier
;
}
static
int
parse_string_literal
(
parser_ctx_t
*
ctx
,
const
WCHAR
**
ret
)
{
const
WCHAR
*
ptr
=
++
ctx
->
ptr
;
WCHAR
*
rptr
;
int
len
=
0
;
while
(
ctx
->
ptr
<
ctx
->
end
)
{
if
(
*
ctx
->
ptr
==
'\n'
)
{
FIXME
(
"newline inside string literal
\n
"
);
return
0
;
}
if
(
*
ctx
->
ptr
==
'"'
)
{
if
(
ctx
->
ptr
[
1
]
!=
'"'
)
break
;
len
--
;
ctx
->
ptr
++
;
}
ctx
->
ptr
++
;
}
if
(
ctx
->
ptr
==
ctx
->
end
)
{
FIXME
(
"unterminated string literal
\n
"
);
return
0
;
}
len
+=
ctx
->
ptr
-
ptr
;
*
ret
=
rptr
=
parser_alloc
(
ctx
,
(
len
+
1
)
*
sizeof
(
WCHAR
));
if
(
!
rptr
)
return
0
;
while
(
ptr
<
ctx
->
ptr
)
{
if
(
*
ptr
==
'"'
)
ptr
++
;
*
rptr
++
=
*
ptr
++
;
}
*
rptr
=
0
;
ctx
->
ptr
++
;
return
tString
;
}
static
int
parse_next_token
(
void
*
lval
,
parser_ctx_t
*
ctx
)
{
WCHAR
c
;
...
...
@@ -238,6 +281,8 @@ static int parse_next_token(void *lval, parser_ctx_t *ctx)
case
'\\'
:
case
'.'
:
return
*
ctx
->
ptr
++
;
case
'"'
:
return
parse_string_literal
(
ctx
,
lval
);
default:
FIXME
(
"Unhandled char %c in %s
\n
"
,
*
ctx
->
ptr
,
debugstr_w
(
ctx
->
ptr
));
}
...
...
dlls/vbscript/parser.y
View file @
0e415e0c
...
...
@@ -68,7 +68,7 @@ static statement_t *new_call_statement(parser_ctx_t*,member_expression_t*);
%token tNOTHING tEMPTY tNULL
%token tCLASS tSET tNEW tPUBLIC tPRIVATE tDEFAULT tME
%token tERROR tNEXT tON tRESUME tGOTO
%token <string> tIdentifier
%token <string> tIdentifier
tString
%type <statement> Statement StatementNl
%type <expression> Expression LiteralExpression
...
...
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