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
bbe6769f
Commit
bbe6769f
authored
Aug 16, 2013
by
Kenton Varda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow 'group' and 'union' to have preceding colon, and fix a bug.
parent
7c6c617d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
5 deletions
+8
-5
node-translator.c++
c++/src/capnp/compiler/node-translator.c++
+1
-1
parser.c++
c++/src/capnp/compiler/parser.c++
+7
-4
No files found.
c++/src/capnp/compiler/node-translator.c++
View file @
bbe6769f
...
...
@@ -364,7 +364,7 @@ public:
}
else
{
uint
newSize
=
kj
::
max
(
lgSizeUsed
,
lgSize
)
+
1
;
if
(
tryExpandUsage
(
group
,
location
,
newSize
))
{
uint
result
=
holes
.
assertHoleAndAllocate
(
lgSize
);
uint
result
=
KJ_ASSERT_NONNULL
(
holes
.
tryAllocate
(
lgSize
)
);
uint
locationOffset
=
location
.
offset
<<
(
location
.
lgSize
-
lgSize
);
return
locationOffset
+
result
;
}
else
{
...
...
c++/src/capnp/compiler/parser.c++
View file @
bbe6769f
...
...
@@ -693,15 +693,17 @@ CapnpParser::CapnpParser(Orphanage orphanageParam, const ErrorReporter& errorRep
// name and ordinal.
p
::
oneOf
(
p
::
sequence
(
p
::
optional
(
identifier
),
p
::
optional
(
parsers
.
ordinal
),
keyword
(
"union"
),
p
::
many
(
parsers
.
annotation
)),
p
::
optional
(
identifier
),
p
::
optional
(
parsers
.
ordinal
),
p
::
optional
(
op
(
":"
)),
keyword
(
"union"
),
p
::
many
(
parsers
.
annotation
)),
p
::
sequence
(
keyword
(
"union"
),
p
::
optional
([](
ParserInput
&
)
->
kj
::
Maybe
<
Located
<
Text
::
Reader
>>
{
return
nullptr
;
}),
p
::
optional
([](
ParserInput
&
)
->
kj
::
Maybe
<
Orphan
<
LocatedInteger
>>
{
return
nullptr
;
}),
p
::
optional
([](
ParserInput
&
)
->
kj
::
Maybe
<
Orphan
<
LocatedInteger
>>
{
return
nullptr
;
}),
p
::
optional
([](
ParserInput
&
)
->
kj
::
Maybe
<
kj
::
Tuple
<>>
{
return
nullptr
;
}),
p
::
many
(
parsers
.
annotation
))),
[
this
](
kj
::
Maybe
<
Located
<
Text
::
Reader
>>&&
name
,
kj
::
Maybe
<
Orphan
<
LocatedInteger
>>&&
ordinal
,
kj
::
Maybe
<
kj
::
Tuple
<>>&&
,
kj
::
Array
<
Orphan
<
Declaration
::
AnnotationApplication
>>&&
annotations
)
->
DeclParserResult
{
auto
decl
=
orphanage
.
newOrphan
<
Declaration
>
();
...
...
@@ -723,8 +725,9 @@ CapnpParser::CapnpParser(Orphanage orphanageParam, const ErrorReporter& errorRep
}));
parsers
.
groupDecl
=
arena
.
copy
(
p
::
transform
(
p
::
sequence
(
identifier
,
keyword
(
"group"
),
p
::
many
(
parsers
.
annotation
)),
p
::
sequence
(
identifier
,
p
::
optional
(
op
(
":"
)),
keyword
(
"group"
),
p
::
many
(
parsers
.
annotation
)),
[
this
](
Located
<
Text
::
Reader
>&&
name
,
kj
::
Maybe
<
kj
::
Tuple
<>>&&
,
kj
::
Array
<
Orphan
<
Declaration
::
AnnotationApplication
>>&&
annotations
)
->
DeclParserResult
{
auto
decl
=
orphanage
.
newOrphan
<
Declaration
>
();
...
...
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