Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
C
capnproto
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
capnproto
Commits
63573705
Commit
63573705
authored
Jun 05, 2017
by
Kenton Varda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Follow style guide.
parent
3f5d9815
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
7 deletions
+10
-7
node-translator.c++
c++/src/capnp/compiler/node-translator.c++
+7
-5
node-translator.h
c++/src/capnp/compiler/node-translator.h
+2
-0
schema-loader.c++
c++/src/capnp/schema-loader.c++
+1
-2
No files found.
c++/src/capnp/compiler/node-translator.c++
View file @
63573705
...
@@ -1383,8 +1383,7 @@ NodeTranslator::NodeTranslator(
...
@@ -1383,8 +1383,7 @@ NodeTranslator::NodeTranslator(
compileNode
(
decl
,
wipNode
.
get
());
compileNode
(
decl
,
wipNode
.
get
());
}
}
void
NodeTranslator
::
addFieldDoc
(
uint
codeOrder
,
::
capnp
::
Text
::
Reader
docComment
)
void
NodeTranslator
::
addFieldDoc
(
uint
codeOrder
,
::
capnp
::
Text
::
Reader
docComment
)
{
{
fieldDocs
.
add
(
std
::
make_pair
(
codeOrder
,
docComment
));
fieldDocs
.
add
(
std
::
make_pair
(
codeOrder
,
docComment
));
}
}
...
@@ -1478,8 +1477,9 @@ void NodeTranslator::compileNode(Declaration::Reader decl, schema::Node::Builder
...
@@ -1478,8 +1477,9 @@ void NodeTranslator::compileNode(Declaration::Reader decl, schema::Node::Builder
if
(
decl
.
hasDocComment
()
||
!
fieldDocs
.
empty
())
{
if
(
decl
.
hasDocComment
()
||
!
fieldDocs
.
empty
())
{
Orphan
<
schema
::
NodeDoc
>
doc
=
orphanage
.
newOrphan
<
schema
::
NodeDoc
>
();
Orphan
<
schema
::
NodeDoc
>
doc
=
orphanage
.
newOrphan
<
schema
::
NodeDoc
>
();
doc
.
get
().
setId
(
wipNode
.
getReader
().
getId
());
doc
.
get
().
setId
(
wipNode
.
getReader
().
getId
());
if
(
decl
.
hasDocComment
())
if
(
decl
.
hasDocComment
())
{
doc
.
get
().
setDocComment
(
decl
.
getDocComment
());
doc
.
get
().
setDocComment
(
decl
.
getDocComment
());
}
if
(
!
fieldDocs
.
empty
())
{
if
(
!
fieldDocs
.
empty
())
{
auto
fdocs
=
doc
.
get
().
initFieldDocs
(
fieldDocs
.
size
());
auto
fdocs
=
doc
.
get
().
initFieldDocs
(
fieldDocs
.
size
());
...
@@ -1841,8 +1841,9 @@ private:
...
@@ -1841,8 +1841,9 @@ private:
hasDefaultValue
=
true
;
hasDefaultValue
=
true
;
fieldDefaultValue
=
fieldDecl
.
getDefaultValue
().
getValue
();
fieldDefaultValue
=
fieldDecl
.
getDefaultValue
().
getValue
();
}
}
if
(
decl
.
hasDocComment
())
if
(
decl
.
hasDocComment
())
{
docComment
=
decl
.
getDocComment
();
docComment
=
decl
.
getDocComment
();
}
}
}
inline
MemberInfo
(
MemberInfo
&
parent
,
uint
codeOrder
,
inline
MemberInfo
(
MemberInfo
&
parent
,
uint
codeOrder
,
const
Declaration
::
Param
::
Reader
&
decl
,
const
Declaration
::
Param
::
Reader
&
decl
,
...
@@ -1869,8 +1870,9 @@ private:
...
@@ -1869,8 +1870,9 @@ private:
startByte
(
decl
.
getStartByte
()),
endByte
(
decl
.
getEndByte
()),
startByte
(
decl
.
getStartByte
()),
endByte
(
decl
.
getEndByte
()),
node
(
node
),
unionScope
(
nullptr
)
{
node
(
node
),
unionScope
(
nullptr
)
{
KJ_REQUIRE
(
decl
.
which
()
!=
Declaration
::
FIELD
);
KJ_REQUIRE
(
decl
.
which
()
!=
Declaration
::
FIELD
);
if
(
decl
.
hasDocComment
())
if
(
decl
.
hasDocComment
())
{
docComment
=
decl
.
getDocComment
();
docComment
=
decl
.
getDocComment
();
}
}
}
schema
::
Field
::
Builder
getSchema
()
{
schema
::
Field
::
Builder
getSchema
()
{
...
...
c++/src/capnp/compiler/node-translator.h
View file @
63573705
...
@@ -181,7 +181,9 @@ private:
...
@@ -181,7 +181,9 @@ private:
Orphan
<
schema
::
Node
>
wipNode
;
Orphan
<
schema
::
Node
>
wipNode
;
kj
::
Maybe
<
Orphan
<
schema
::
NodeDoc
>>
wipNodeDoc
;
kj
::
Maybe
<
Orphan
<
schema
::
NodeDoc
>>
wipNodeDoc
;
// The work-in-progress schema node and its docstring
// The work-in-progress schema node and its docstring
kj
::
Vector
<
std
::
pair
<
uint
,
::
capnp
::
Text
::
Reader
>>
fieldDocs
;
kj
::
Vector
<
std
::
pair
<
uint
,
::
capnp
::
Text
::
Reader
>>
fieldDocs
;
// TODO(now): Don't use std::pair.
kj
::
Vector
<
Orphan
<
schema
::
Node
>>
groups
;
kj
::
Vector
<
Orphan
<
schema
::
Node
>>
groups
;
// If this is a struct node and it contains groups, these are the nodes for those groups, which
// If this is a struct node and it contains groups, these are the nodes for those groups, which
...
...
c++/src/capnp/schema-loader.c++
View file @
63573705
...
@@ -1863,8 +1863,7 @@ kj::Array<schema::NodeDoc::Reader> SchemaLoader::Impl::getAllDocs() const {
...
@@ -1863,8 +1863,7 @@ kj::Array<schema::NodeDoc::Reader> SchemaLoader::Impl::getAllDocs() const {
return
result
;
return
result
;
}
}
void
SchemaLoader
::
Impl
::
loadDoc
(
schema
::
NodeDoc
::
Reader
docReader
)
void
SchemaLoader
::
Impl
::
loadDoc
(
schema
::
NodeDoc
::
Reader
docReader
)
{
{
docs
[
docReader
.
getId
()]
=
docReader
;
docs
[
docReader
.
getId
()]
=
docReader
;
}
}
...
...
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