Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
glslang
Project
Overview
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
glslang
Commits
5002c26b
Commit
5002c26b
authored
Sep 11, 2017
by
John Kessenich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix #1043: set all scan string-locations to have bias, not just the first one.
parent
a25530cc
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
9 deletions
+9
-9
Common.h
glslang/Include/Common.h
+1
-0
Scan.h
glslang/MachineIndependent/Scan.h
+8
-9
No files found.
glslang/Include/Common.h
View file @
5002c26b
...
@@ -222,6 +222,7 @@ inline const TString String(const int i, const int /*base*/ = 10)
...
@@ -222,6 +222,7 @@ inline const TString String(const int i, const int /*base*/ = 10)
struct
TSourceLoc
{
struct
TSourceLoc
{
void
init
()
{
name
=
nullptr
;
string
=
0
;
line
=
0
;
column
=
0
;
}
void
init
()
{
name
=
nullptr
;
string
=
0
;
line
=
0
;
column
=
0
;
}
void
init
(
int
stringNum
)
{
init
();
string
=
stringNum
;
}
// Returns the name if it exists. Otherwise, returns the string number.
// Returns the name if it exists. Otherwise, returns the string number.
std
::
string
getStringNameOrNum
(
bool
quoteStringName
=
true
)
const
std
::
string
getStringNameOrNum
(
bool
quoteStringName
=
true
)
const
{
{
...
...
glslang/MachineIndependent/Scan.h
View file @
5002c26b
...
@@ -51,25 +51,24 @@ const int EndOfInput = -1;
...
@@ -51,25 +51,24 @@ const int EndOfInput = -1;
//
//
class
TInputScanner
{
class
TInputScanner
{
public
:
public
:
TInputScanner
(
int
n
,
const
char
*
const
s
[],
size_t
L
[],
const
char
*
const
*
names
=
nullptr
,
int
b
=
0
,
int
f
=
0
,
bool
single
=
false
)
:
TInputScanner
(
int
n
,
const
char
*
const
s
[],
size_t
L
[],
const
char
*
const
*
names
=
nullptr
,
int
b
=
0
,
int
f
=
0
,
bool
single
=
false
)
:
numSources
(
n
),
numSources
(
n
),
sources
(
reinterpret_cast
<
const
unsigned
char
*
const
*>
(
s
)),
// up to this point, common usage is "char*", but now we need positive 8-bit characters
// up to this point, common usage is "char*", but now we need positive 8-bit characters
lengths
(
L
),
currentSource
(
0
),
currentChar
(
0
),
stringBias
(
b
),
finale
(
f
),
singleLogical
(
single
),
endOfFileReached
(
false
)
sources
(
reinterpret_cast
<
const
unsigned
char
*
const
*>
(
s
)),
lengths
(
L
),
currentSource
(
0
),
currentChar
(
0
),
stringBias
(
b
),
finale
(
f
),
singleLogical
(
single
),
endOfFileReached
(
false
)
{
{
loc
=
new
TSourceLoc
[
numSources
];
loc
=
new
TSourceLoc
[
numSources
];
for
(
int
i
=
0
;
i
<
numSources
;
++
i
)
{
for
(
int
i
=
0
;
i
<
numSources
;
++
i
)
{
loc
[
i
].
init
();
loc
[
i
].
init
(
i
-
stringBias
);
}
}
if
(
names
!=
nullptr
)
{
if
(
names
!=
nullptr
)
{
for
(
int
i
=
0
;
i
<
numSources
;
++
i
)
for
(
int
i
=
0
;
i
<
numSources
;
++
i
)
loc
[
i
].
name
=
names
[
i
];
loc
[
i
].
name
=
names
[
i
];
}
}
loc
[
currentSource
].
string
=
-
stringBias
;
loc
[
currentSource
].
line
=
1
;
loc
[
currentSource
].
line
=
1
;
loc
[
currentSource
].
column
=
0
;
logicalSourceLoc
.
init
(
1
);
logicalSourceLoc
.
string
=
0
;
logicalSourceLoc
.
line
=
1
;
logicalSourceLoc
.
column
=
0
;
logicalSourceLoc
.
name
=
loc
[
0
].
name
;
logicalSourceLoc
.
name
=
loc
[
0
].
name
;
}
}
...
...
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