Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yaml-cpp
Overview
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
lvzhengyang
yaml-cpp
Commits
01ef70a6
Commit
01ef70a6
authored
Jun 28, 2008
by
Jesse Beder
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed complex keys.
parent
c63ebbd8
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
103 deletions
+12
-103
scanner.cpp
+3
-3
scantoken.cpp
+4
-2
test.yaml
+5
-98
No files found.
scanner.cpp
View file @
01ef70a6
...
@@ -229,14 +229,14 @@ namespace YAML
...
@@ -229,14 +229,14 @@ namespace YAML
Eat
(
1
);
Eat
(
1
);
// then eat a comment
// then eat a comment
if
(
Exp
::
Comment
.
Matches
(
INPUT
.
peek
()
))
{
if
(
Exp
::
Comment
.
Matches
(
INPUT
))
{
// eat until line break
// eat until line break
while
(
INPUT
&&
!
Exp
::
Break
.
Matches
(
INPUT
.
peek
()
))
while
(
INPUT
&&
!
Exp
::
Break
.
Matches
(
INPUT
))
Eat
(
1
);
Eat
(
1
);
}
}
// if it's NOT a line break, then we're done!
// if it's NOT a line break, then we're done!
if
(
!
Exp
::
Break
.
Matches
(
INPUT
.
peek
()
))
if
(
!
Exp
::
Break
.
Matches
(
INPUT
))
break
;
break
;
// otherwise, let's eat the line break and keep going
// otherwise, let's eat the line break and keep going
...
...
scantoken.cpp
View file @
01ef70a6
...
@@ -204,7 +204,8 @@ namespace YAML
...
@@ -204,7 +204,8 @@ namespace YAML
template
<>
PlainScalarToken
*
Scanner
::
ScanToken
(
PlainScalarToken
*
pToken
)
template
<>
PlainScalarToken
*
Scanner
::
ScanToken
(
PlainScalarToken
*
pToken
)
{
{
// insert a potential simple key
// insert a potential simple key
InsertSimpleKey
();
if
(
m_simpleKeyAllowed
)
InsertSimpleKey
();
m_simpleKeyAllowed
=
false
;
m_simpleKeyAllowed
=
false
;
// now eat and store the scalar
// now eat and store the scalar
...
@@ -279,7 +280,8 @@ namespace YAML
...
@@ -279,7 +280,8 @@ namespace YAML
template
<>
QuotedScalarToken
*
Scanner
::
ScanToken
(
QuotedScalarToken
*
pToken
)
template
<>
QuotedScalarToken
*
Scanner
::
ScanToken
(
QuotedScalarToken
*
pToken
)
{
{
// insert a potential simple key
// insert a potential simple key
InsertSimpleKey
();
if
(
m_simpleKeyAllowed
)
InsertSimpleKey
();
m_simpleKeyAllowed
=
false
;
m_simpleKeyAllowed
=
false
;
// eat single or double quote
// eat single or double quote
...
...
test.yaml
View file @
01ef70a6
---
{
model
:
a simple key
:
a value
,
file
:
data/models/compound.model
?
a complex key
:
another value
,
textures
:
data/materials/compound
}
rooms
:
\ No newline at end of file
-
name
:
"
Room
#1"
pos
:
[
0
,
0
,
0
]
size
:
[
1000
,
1000
,
500
]
height
:
500
stairtype
:
none
display
:
[]
pathfinding
:
tilesize
:
50
size
:
[
24
,
24
]
map
:
-----------------------
-+++++++++++++++++++++-
-+-------------------+-
-+-------------------+-
-+-------------------+-
-+-------------------+-
-+-------------------+-
-+-------------------+-
-+-------------------+-
-+-------------------+-
-+---------------------
-+---------------------
-+---------------------
-+---------------------
-+-------------------+-
-+-------------------+-
-+-------------------+-
-+-------------------+-
-+-------------------+-
-+-------------------+-
-+-------------------+-
-+-------------------+-
-+++++++++++++++++++++-
-----------------------
-
name
:
Doorway
pos
:
[
1000
,
400
,
0
]
size
:
[
50
,
200
,
500
]
height
:
500
stairtype
:
none
display
:
[]
pathfinding
:
tilesize
:
50
size
:
[
5
,
9
]
map
:
-----
-+++-
-----
-----
-----
-----
-----
-+++-
-----
-
name
:
"
Room
#2"
pos
:
[
1050
,
0
,
0
]
size
:
[
1000
,
1000
,
500
]
height
:
500
stairtype
:
none
display
:
[]
pathfinding
:
tilesize
:
50
size
:
[
24
,
24
]
map
:
-----------------------
-+++++++++++++++++++++-
-+-------------------+-
-+-------------------+-
-+-------------------+-
-+-------------------+-
-+-------------------+-
-+-------------------+-
-+-------------------+-
-+-------------------+-
---------------------+-
---------------------+-
---------------------+-
---------------------+-
-+-------------------+-
-+-------------------+-
-+-------------------+-
-+-------------------+-
-+-------------------+-
-+-------------------+-
-+-------------------+-
-+-------------------+-
-+++++++++++++++++++++-
-----------------------
exits
:
-
room1
:
"
Room
#1"
room2
:
"
Room
#2"
dir
:
e
pos
:
[
400
,
600
]
...
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