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
4c6a1d1d
Commit
4c6a1d1d
authored
Feb 19, 2013
by
Piotr Caban
Committed by
Alexandre Julliard
Feb 19, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jscript: Rename JSREG_* defines to REG_*.
parent
6b474b55
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
28 deletions
+28
-28
jsregexp.c
dlls/jscript/jsregexp.c
+8
-8
regexp.c
dlls/jscript/regexp.c
+15
-15
regexp.h
dlls/jscript/regexp.h
+5
-5
No files found.
dlls/jscript/jsregexp.c
View file @
4c6a1d1d
...
...
@@ -165,7 +165,7 @@ HRESULT regexp_match_next(script_ctx_t *ctx, jsdisp_t *dispex, DWORD rem_flags,
heap_pool_t
*
mark
;
HRESULT
hres
;
if
((
rem_flags
&
REM_CHECK_GLOBAL
)
&&
!
(
regexp
->
jsregexp
->
flags
&
JS
REG_GLOB
))
if
((
rem_flags
&
REM_CHECK_GLOBAL
)
&&
!
(
regexp
->
jsregexp
->
flags
&
REG_GLOB
))
return
S_FALSE
;
mark
=
heap_pool_mark
(
&
ctx
->
tmp_heap
);
...
...
@@ -216,7 +216,7 @@ static HRESULT regexp_match(script_ctx_t *ctx, jsdisp_t *dispex, jsstr_t *str, B
ret
[
i
++
]
=
cres
;
if
(
!
gflag
&&
!
(
This
->
jsregexp
->
flags
&
JS
REG_GLOB
))
{
if
(
!
gflag
&&
!
(
This
->
jsregexp
->
flags
&
REG_GLOB
))
{
hres
=
S_OK
;
break
;
}
...
...
@@ -407,7 +407,7 @@ static HRESULT run_exec(script_ctx_t *ctx, vdisp_t *jsthis, jsval_t arg, jsstr_t
if
(
FAILED
(
hres
))
return
hres
;
if
(
regexp
->
jsregexp
->
flags
&
JS
REG_GLOB
)
{
if
(
regexp
->
jsregexp
->
flags
&
REG_GLOB
)
{
if
(
regexp
->
last_index
<
0
)
{
jsstr_release
(
string
);
set_last_index
(
regexp
,
0
);
...
...
@@ -668,7 +668,7 @@ HRESULT regexp_string_match(script_ctx_t *ctx, jsdisp_t *re, jsstr_t *str, jsval
jsdisp_t
*
array
;
HRESULT
hres
;
if
(
!
(
regexp
->
jsregexp
->
flags
&
JS
REG_GLOB
))
{
if
(
!
(
regexp
->
jsregexp
->
flags
&
REG_GLOB
))
{
match_result_t
match
,
*
parens
=
NULL
;
DWORD
parens_cnt
,
parens_size
=
0
;
const
WCHAR
*
cp
=
str
->
str
;
...
...
@@ -991,16 +991,16 @@ HRESULT parse_regexp_flags(const WCHAR *str, DWORD str_len, DWORD *ret)
for
(
p
=
str
;
p
<
str
+
str_len
;
p
++
)
{
switch
(
*
p
)
{
case
'g'
:
flags
|=
JS
REG_GLOB
;
flags
|=
REG_GLOB
;
break
;
case
'i'
:
flags
|=
JS
REG_FOLD
;
flags
|=
REG_FOLD
;
break
;
case
'm'
:
flags
|=
JS
REG_MULTILINE
;
flags
|=
REG_MULTILINE
;
break
;
case
'y'
:
flags
|=
JS
REG_STICKY
;
flags
|=
REG_STICKY
;
break
;
default:
WARN
(
"wrong flag %c
\n
"
,
*
p
);
...
...
dlls/jscript/regexp.c
View file @
4c6a1d1d
...
...
@@ -638,14 +638,14 @@ EmitREBytecode(CompilerState *state, JSRegExp *re, size_t treeDepth,
}
}
if
(
t
->
kid
&&
t
->
u
.
flat
.
length
>
1
)
{
pc
[
-
1
]
=
(
state
->
flags
&
JS
REG_FOLD
)
?
REOP_FLATi
:
REOP_FLAT
;
pc
[
-
1
]
=
(
state
->
flags
&
REG_FOLD
)
?
REOP_FLATi
:
REOP_FLAT
;
pc
=
WriteCompactIndex
(
pc
,
(
WCHAR
*
)
t
->
kid
-
state
->
cpbegin
);
pc
=
WriteCompactIndex
(
pc
,
t
->
u
.
flat
.
length
);
}
else
if
(
t
->
u
.
flat
.
chr
<
256
)
{
pc
[
-
1
]
=
(
state
->
flags
&
JS
REG_FOLD
)
?
REOP_FLAT1i
:
REOP_FLAT1
;
pc
[
-
1
]
=
(
state
->
flags
&
REG_FOLD
)
?
REOP_FLAT1i
:
REOP_FLAT1
;
*
pc
++
=
(
jsbytecode
)
t
->
u
.
flat
.
chr
;
}
else
{
pc
[
-
1
]
=
(
state
->
flags
&
JS
REG_FOLD
)
pc
[
-
1
]
=
(
state
->
flags
&
REG_FOLD
)
?
REOP_UCFLAT1i
:
REOP_UCFLAT1
;
SET_ARG
(
pc
,
t
->
u
.
flat
.
chr
);
...
...
@@ -804,7 +804,7 @@ ProcessOp(CompilerState *state, REOpData *opData, RENode **operandStack,
*/
if
(((
RENode
*
)
result
->
kid
)
->
op
==
REOP_FLAT
&&
((
RENode
*
)
result
->
u
.
kid2
)
->
op
==
REOP_FLAT
&&
(
state
->
flags
&
JS
REG_FOLD
)
==
0
)
{
(
state
->
flags
&
REG_FOLD
)
==
0
)
{
result
->
op
=
REOP_ALTPREREQ
;
result
->
u
.
altprereq
.
ch1
=
((
RENode
*
)
result
->
kid
)
->
u
.
flat
.
chr
;
result
->
u
.
altprereq
.
ch2
=
((
RENode
*
)
result
->
u
.
kid2
)
->
u
.
flat
.
chr
;
...
...
@@ -816,7 +816,7 @@ ProcessOp(CompilerState *state, REOpData *opData, RENode **operandStack,
if
(((
RENode
*
)
result
->
kid
)
->
op
==
REOP_CLASS
&&
((
RENode
*
)
result
->
kid
)
->
u
.
ucclass
.
index
<
256
&&
((
RENode
*
)
result
->
u
.
kid2
)
->
op
==
REOP_FLAT
&&
(
state
->
flags
&
JS
REG_FOLD
)
==
0
)
{
(
state
->
flags
&
REG_FOLD
)
==
0
)
{
result
->
op
=
REOP_ALTPREREQ2
;
result
->
u
.
altprereq
.
ch1
=
((
RENode
*
)
result
->
u
.
kid2
)
->
u
.
flat
.
chr
;
result
->
u
.
altprereq
.
ch2
=
((
RENode
*
)
result
->
kid
)
->
u
.
ucclass
.
index
;
...
...
@@ -828,7 +828,7 @@ ProcessOp(CompilerState *state, REOpData *opData, RENode **operandStack,
if
(((
RENode
*
)
result
->
kid
)
->
op
==
REOP_FLAT
&&
((
RENode
*
)
result
->
u
.
kid2
)
->
op
==
REOP_CLASS
&&
((
RENode
*
)
result
->
u
.
kid2
)
->
u
.
ucclass
.
index
<
256
&&
(
state
->
flags
&
JS
REG_FOLD
)
==
0
)
{
(
state
->
flags
&
REG_FOLD
)
==
0
)
{
result
->
op
=
REOP_ALTPREREQ2
;
result
->
u
.
altprereq
.
ch1
=
((
RENode
*
)
result
->
kid
)
->
u
.
flat
.
chr
;
result
->
u
.
altprereq
.
ch2
=
...
...
@@ -1108,11 +1108,11 @@ lexHex:
continue
;
}
}
if
(
state
->
flags
&
JS
REG_FOLD
)
if
(
state
->
flags
&
REG_FOLD
)
rangeStart
=
localMax
;
/* one run of the uc/dc loop below */
}
if
(
state
->
flags
&
JS
REG_FOLD
)
{
if
(
state
->
flags
&
REG_FOLD
)
{
WCHAR
maxch
=
localMax
;
for
(
i
=
rangeStart
;
i
<=
localMax
;
i
++
)
{
...
...
@@ -2009,7 +2009,7 @@ BackrefMatcher(REGlobalData *gData, REMatchState *x, size_t parenIndex)
return
NULL
;
parenContent
=
&
gData
->
cpbegin
[
cap
->
index
];
if
(
gData
->
regexp
->
flags
&
JS
REG_FOLD
)
{
if
(
gData
->
regexp
->
flags
&
REG_FOLD
)
{
for
(
i
=
0
;
i
<
len
;
i
++
)
{
if
(
toupperW
(
parenContent
[
i
])
!=
toupperW
(
x
->
cp
[
i
]))
return
NULL
;
...
...
@@ -2233,7 +2233,7 @@ ProcessCharSet(REGlobalData *gData, RECharSet *charSet)
}
if
(
inRange
)
{
if
(
gData
->
regexp
->
flags
&
JS
REG_FOLD
)
{
if
(
gData
->
regexp
->
flags
&
REG_FOLD
)
{
assert
(
rangeStart
<=
thisCh
);
for
(
i
=
rangeStart
;
i
<=
thisCh
;
i
++
)
{
WCHAR
uch
,
dch
;
...
...
@@ -2251,7 +2251,7 @@ ProcessCharSet(REGlobalData *gData, RECharSet *charSet)
}
inRange
=
FALSE
;
}
else
{
if
(
gData
->
regexp
->
flags
&
JS
REG_FOLD
)
{
if
(
gData
->
regexp
->
flags
&
REG_FOLD
)
{
AddCharacterToCharSet
(
charSet
,
toupperW
(
thisCh
));
AddCharacterToCharSet
(
charSet
,
tolowerW
(
thisCh
));
}
else
{
...
...
@@ -2325,7 +2325,7 @@ SimpleMatch(REGlobalData *gData, REMatchState *x, REOp op,
case
REOP_BOL
:
if
(
x
->
cp
!=
gData
->
cpbegin
)
{
if
(
/*!gData->cx->regExpStatics.multiline && FIXME !!! */
!
(
gData
->
regexp
->
flags
&
JS
REG_MULTILINE
))
{
!
(
gData
->
regexp
->
flags
&
REG_MULTILINE
))
{
break
;
}
if
(
!
RE_IS_LINE_TERM
(
x
->
cp
[
-
1
]))
...
...
@@ -2336,7 +2336,7 @@ SimpleMatch(REGlobalData *gData, REMatchState *x, REOp op,
case
REOP_EOL
:
if
(
x
->
cp
!=
gData
->
cpend
)
{
if
(
/*!gData->cx->regExpStatics.multiline &&*/
!
(
gData
->
regexp
->
flags
&
JS
REG_MULTILINE
))
{
!
(
gData
->
regexp
->
flags
&
REG_MULTILINE
))
{
break
;
}
if
(
!
RE_IS_LINE_TERM
(
*
x
->
cp
))
...
...
@@ -2532,7 +2532,7 @@ ExecuteREBytecode(REGlobalData *gData, REMatchState *x)
* If the first node is a simple match, step the index into the string
* until that match is made, or fail if it can't be found at all.
*/
if
(
REOP_IS_SIMPLE
(
op
)
&&
!
(
gData
->
regexp
->
flags
&
JS
REG_STICKY
))
{
if
(
REOP_IS_SIMPLE
(
op
)
&&
!
(
gData
->
regexp
->
flags
&
REG_STICKY
))
{
anchor
=
FALSE
;
while
(
x
->
cp
<=
gData
->
cpend
)
{
nextpc
=
pc
;
/* reset back to start each time */
...
...
@@ -3063,7 +3063,7 @@ static REMatchState *MatchRegExp(REGlobalData *gData, REMatchState *x)
for
(
j
=
0
;
j
<
gData
->
regexp
->
parenCount
;
j
++
)
x
->
parens
[
j
].
index
=
-
1
;
result
=
ExecuteREBytecode
(
gData
,
x
);
if
(
!
gData
->
ok
||
result
||
(
gData
->
regexp
->
flags
&
JS
REG_STICKY
))
if
(
!
gData
->
ok
||
result
||
(
gData
->
regexp
->
flags
&
REG_STICKY
))
return
result
;
gData
->
backTrackSP
=
gData
->
backTrackStack
;
gData
->
cursz
=
0
;
...
...
dlls/jscript/regexp.h
View file @
4c6a1d1d
...
...
@@ -31,10 +31,10 @@
* the Initial Developer. All Rights Reserved.
*/
#define
JSREG_FOLD 0x01
/* fold uppercase to lowercase */
#define
JSREG_GLOB 0x02
/* global exec, creates array of matches */
#define
JSREG_MULTILINE 0x04
/* treat ^ and $ as begin and end of line */
#define
JSREG_STICKY 0x08
/* only match starting at lastIndex */
#define
REG_FOLD 0x01
/* fold uppercase to lowercase */
#define
REG_GLOB 0x02
/* global exec, creates array of matches */
#define
REG_MULTILINE 0x04
/* treat ^ and $ as begin and end of line */
#define
REG_STICKY 0x08
/* only match starting at lastIndex */
typedef
struct
RECapture
{
ptrdiff_t
index
;
/* start of contents, -1 for empty */
...
...
@@ -73,7 +73,7 @@ typedef struct RECharSet {
}
RECharSet
;
typedef
struct
JSRegExp
{
WORD
flags
;
/* flags, see jsapi.h's
JS
REG_* defines */
WORD
flags
;
/* flags, see jsapi.h's REG_* defines */
size_t
parenCount
;
/* number of parenthesized submatches */
size_t
classCount
;
/* count [...] bitmaps */
RECharSet
*
classList
;
/* list of [...] bitmaps */
...
...
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