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
6b61f9c4
Commit
6b61f9c4
authored
Apr 20, 2013
by
Kenton Varda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cleanup: enum value -> enumerant
parent
5a19e0a1
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
57 additions
and
58 deletions
+57
-58
Compiler.hs
compiler/src/Compiler.hs
+15
-15
CxxGenerator.hs
compiler/src/CxxGenerator.hs
+6
-6
Grammar.hs
compiler/src/Grammar.hs
+5
-5
Parser.hs
compiler/src/Parser.hs
+4
-5
Semantics.hs
compiler/src/Semantics.hs
+18
-18
WireFormat.hs
compiler/src/WireFormat.hs
+1
-1
c++-header.mustache
compiler/src/c++-header.mustache
+6
-6
language.md
doc/language.md
+2
-2
No files found.
compiler/src/Compiler.hs
View file @
6b61f9c4
...
...
@@ -202,7 +202,7 @@ compileValue _ (BuiltinType BuiltinData) (StringFieldValue x) =
compileValue
pos
(
EnumType
desc
)
(
IdentifierFieldValue
name
)
=
case
lookupMember
name
(
enumMemberMap
desc
)
of
Just
(
DescEnum
Value
value
)
->
succeed
(
EnumValue
ValueDesc
value
)
Just
(
DescEnum
erant
value
)
->
succeed
(
Enumerant
ValueDesc
value
)
_
->
makeError
pos
(
printf
"Enum type '%s' has no value '%s'."
(
enumName
desc
)
name
)
compileValue
pos
(
StructType
desc
)
(
RecordFieldValue
fields
)
=
do
...
...
@@ -248,7 +248,7 @@ compileValue pos (BuiltinType BuiltinFloat64) _ = makeExpectError pos "number"
compileValue
pos
(
BuiltinType
BuiltinText
)
_
=
makeExpectError
pos
"string"
compileValue
pos
(
BuiltinType
BuiltinData
)
_
=
makeExpectError
pos
"string"
compileValue
pos
(
EnumType
_
)
_
=
makeExpectError
pos
"enum
value
name"
compileValue
pos
(
EnumType
_
)
_
=
makeExpectError
pos
"enum
erant
name"
compileValue
pos
(
StructType
_
)
_
=
makeExpectError
pos
"parenthesized list of field assignments"
compileValue
pos
(
InterfaceType
_
)
_
=
makeError
pos
"Interfaces can't have default values."
compileValue
pos
(
ListType
_
)
_
=
makeExpectError
pos
"list"
...
...
@@ -580,33 +580,33 @@ compileDecl scope (EnumDecl (Located _ name) annotations decls) =
CompiledStatementStatus
name
(
feedback
(
\
desc
->
do
(
members
,
memberMap
)
<-
compileChildDecls
desc
decls
requireNoDuplicateNames
decls
let
numbers
=
[
num
|
Enum
Value
Decl
_
num
_
<-
decls
]
requireSequentialNumbering
"Enum
value
s"
numbers
let
numbers
=
[
num
|
Enum
erant
Decl
_
num
_
<-
decls
]
requireSequentialNumbering
"Enum
erant
s"
numbers
requireOrdinalsInRange
numbers
(
theId
,
compiledAnnotations
)
<-
compileAnnotations
scope
EnumAnnotation
annotations
return
(
DescEnum
EnumDesc
{
enumName
=
name
,
enumId
=
theId
,
enumParent
=
scope
,
enum
Values
=
[
d
|
DescEnumValue
d
<-
members
]
,
enum
erants
=
[
d
|
DescEnumerant
d
<-
members
]
,
enumAnnotations
=
compiledAnnotations
,
enumMemberMap
=
memberMap
,
enumStatements
=
members
})))
compileDecl
scope
@
(
DescEnum
parent
)
(
Enum
Value
Decl
(
Located
_
name
)
(
Located
_
number
)
annotations
)
=
(
Enum
erant
Decl
(
Located
_
name
)
(
Located
_
number
)
annotations
)
=
CompiledStatementStatus
name
(
do
(
theId
,
compiledAnnotations
)
<-
compileAnnotations
scope
Enum
Value
Annotation
annotations
return
(
DescEnum
Value
EnumValue
Desc
{
enum
Value
Name
=
name
,
enum
Value
Id
=
theId
,
enum
Value
Parent
=
parent
,
enum
Value
Number
=
number
,
enum
Value
Annotations
=
compiledAnnotations
(
theId
,
compiledAnnotations
)
<-
compileAnnotations
scope
Enum
erant
Annotation
annotations
return
(
DescEnum
erant
Enumerant
Desc
{
enum
erant
Name
=
name
,
enum
erant
Id
=
theId
,
enum
erant
Parent
=
parent
,
enum
erant
Number
=
number
,
enum
erant
Annotations
=
compiledAnnotations
}))
compileDecl
_
(
Enum
Value
Decl
(
Located
pos
name
)
_
_
)
=
CompiledStatementStatus
name
(
makeError
pos
"Enum
value
s can only appear inside enums."
)
compileDecl
_
(
Enum
erant
Decl
(
Located
pos
name
)
_
_
)
=
CompiledStatementStatus
name
(
makeError
pos
"Enum
erant
s can only appear inside enums."
)
compileDecl
scope
(
StructDecl
(
Located
_
name
)
annotations
decls
)
=
CompiledStatementStatus
name
(
feedback
(
\
desc
->
do
...
...
compiler/src/CxxGenerator.hs
View file @
6b61f9c4
...
...
@@ -153,7 +153,7 @@ isDefaultZero (UInt32Desc i) = i == 0
isDefaultZero
(
UInt64Desc
i
)
=
i
==
0
isDefaultZero
(
Float32Desc
x
)
=
x
==
0
isDefaultZero
(
Float64Desc
x
)
=
x
==
0
isDefaultZero
(
Enum
ValueValueDesc
v
)
=
enumValue
Number
v
==
0
isDefaultZero
(
Enum
erantValueDesc
v
)
=
enumerant
Number
v
==
0
isDefaultZero
(
TextDesc
_
)
=
error
"Can't call isDefaultZero on aggregate types."
isDefaultZero
(
DataDesc
_
)
=
error
"Can't call isDefaultZero on aggregate types."
isDefaultZero
(
StructValueDesc
_
)
=
error
"Can't call isDefaultZero on aggregate types."
...
...
@@ -171,7 +171,7 @@ defaultMask (UInt32Desc i) = show i ++ "u"
defaultMask
(
UInt64Desc
i
)
=
show
i
++
"llu"
defaultMask
(
Float32Desc
x
)
=
show
(
floatToWord
x
)
++
"u"
defaultMask
(
Float64Desc
x
)
=
show
(
doubleToWord
x
)
++
"ul"
defaultMask
(
Enum
ValueValueDesc
v
)
=
show
(
enumValue
Number
v
)
defaultMask
(
Enum
erantValueDesc
v
)
=
show
(
enumerant
Number
v
)
defaultMask
(
TextDesc
_
)
=
error
"Can't call defaultMask on aggregate types."
defaultMask
(
DataDesc
_
)
=
error
"Can't call defaultMask on aggregate types."
defaultMask
(
StructValueDesc
_
)
=
error
"Can't call defaultMask on aggregate types."
...
...
@@ -189,14 +189,14 @@ elementType _ = error "Called elementType on non-list."
repeatedlyTake
_
[]
=
[]
repeatedlyTake
n
l
=
take
n
l
:
repeatedlyTake
n
(
drop
n
l
)
enum
Value
Context
parent
desc
=
mkStrContext
context
where
context
"enum
ValueName"
=
MuVariable
$
toUpperCaseWithUnderscores
$
enumValue
Name
desc
context
"enum
ValueNumber"
=
MuVariable
$
enumValue
Number
desc
enum
erant
Context
parent
desc
=
mkStrContext
context
where
context
"enum
erantName"
=
MuVariable
$
toUpperCaseWithUnderscores
$
enumerant
Name
desc
context
"enum
erantNumber"
=
MuVariable
$
enumerant
Number
desc
context
s
=
parent
s
enumContext
parent
desc
=
mkStrContext
context
where
context
"enumName"
=
MuVariable
$
enumName
desc
context
"enum
Values"
=
MuList
$
map
(
enumValueContext
context
)
$
enumValue
s
desc
context
"enum
erants"
=
MuList
$
map
(
enumerantContext
context
)
$
enumerant
s
desc
context
s
=
parent
s
defaultBytesContext
::
Monad
m
=>
(
String
->
MuType
m
)
->
TypeDesc
->
[
Word8
]
->
MuContext
m
...
...
compiler/src/Grammar.hs
View file @
6b61f9c4
...
...
@@ -68,7 +68,7 @@ paramImports (ParamDecl _ t ann _) = typeImports t ++ concatMap annotationImport
data
AnnotationTarget
=
FileAnnotation
|
ConstantAnnotation
|
EnumAnnotation
|
Enum
Value
Annotation
|
Enum
erant
Annotation
|
StructAnnotation
|
FieldAnnotation
|
UnionAnnotation
...
...
@@ -82,7 +82,7 @@ instance Show AnnotationTarget where
show
FileAnnotation
=
"file"
show
ConstantAnnotation
=
"const"
show
EnumAnnotation
=
"enum"
show
Enum
Value
Annotation
=
"enumerant"
show
Enum
erant
Annotation
=
"enumerant"
show
StructAnnotation
=
"struct"
show
FieldAnnotation
=
"field"
show
UnionAnnotation
=
"union"
...
...
@@ -94,7 +94,7 @@ instance Show AnnotationTarget where
data
Declaration
=
AliasDecl
(
Located
String
)
DeclName
|
ConstantDecl
(
Located
String
)
TypeExpression
[
Annotation
]
(
Located
FieldValue
)
|
EnumDecl
(
Located
String
)
[
Annotation
]
[
Declaration
]
|
Enum
Value
Decl
(
Located
String
)
(
Located
Integer
)
[
Annotation
]
|
Enum
erant
Decl
(
Located
String
)
(
Located
Integer
)
[
Annotation
]
|
StructDecl
(
Located
String
)
[
Annotation
]
[
Declaration
]
|
FieldDecl
(
Located
String
)
(
Located
Integer
)
TypeExpression
[
Annotation
]
(
Maybe
(
Located
FieldValue
))
...
...
@@ -109,7 +109,7 @@ declarationName :: Declaration -> Maybe (Located String)
declarationName
(
AliasDecl
n
_
)
=
Just
n
declarationName
(
ConstantDecl
n
_
_
_
)
=
Just
n
declarationName
(
EnumDecl
n
_
_
)
=
Just
n
declarationName
(
Enum
Value
Decl
n
_
_
)
=
Just
n
declarationName
(
Enum
erant
Decl
n
_
_
)
=
Just
n
declarationName
(
StructDecl
n
_
_
)
=
Just
n
declarationName
(
FieldDecl
n
_
_
_
_
)
=
Just
n
declarationName
(
UnionDecl
n
_
_
_
)
=
Just
n
...
...
@@ -121,7 +121,7 @@ declImports :: Declaration -> [Located String]
declImports
(
AliasDecl
_
name
)
=
maybeToList
(
declNameImport
name
)
declImports
(
ConstantDecl
_
t
ann
_
)
=
typeImports
t
++
concatMap
annotationImports
ann
declImports
(
EnumDecl
_
ann
decls
)
=
concatMap
annotationImports
ann
++
concatMap
declImports
decls
declImports
(
Enum
Value
Decl
_
_
ann
)
=
concatMap
annotationImports
ann
declImports
(
Enum
erant
Decl
_
_
ann
)
=
concatMap
annotationImports
ann
declImports
(
StructDecl
_
ann
decls
)
=
concatMap
annotationImports
ann
++
concatMap
declImports
decls
declImports
(
FieldDecl
_
_
t
ann
_
)
=
typeImports
t
++
concatMap
annotationImports
ann
...
...
compiler/src/Parser.hs
View file @
6b61f9c4
...
...
@@ -120,7 +120,6 @@ structKeyword = tokenParser (matchSimpleToken StructKeyword) <?> "\"struct\""
unionKeyword
=
tokenParser
(
matchSimpleToken
UnionKeyword
)
<?>
"
\"
union
\"
"
interfaceKeyword
=
tokenParser
(
matchSimpleToken
InterfaceKeyword
)
<?>
"
\"
interface
\"
"
annotationKeyword
=
tokenParser
(
matchSimpleToken
AnnotationKeyword
)
<?>
"
\"
annotation
\"
"
onKeyword
=
tokenParser
(
matchSimpleToken
OnKeyword
)
<?>
"
\"
on
\"
"
parenthesizedList
parser
=
do
items
<-
tokenParser
(
matchUnary
ParenthesizedList
)
...
...
@@ -201,13 +200,13 @@ enumDecl statements = do
return
(
EnumDecl
name
annotations
children
)
enumLine
::
Maybe
[
Located
Statement
]
->
TokenParser
Declaration
enumLine
Nothing
=
enum
Value
Decl
enumLine
Nothing
=
enum
erant
Decl
enumLine
(
Just
_
)
=
fail
"Blocks not allowed here."
enum
Value
Decl
=
do
enum
erant
Decl
=
do
(
name
,
value
)
<-
nameWithOrdinal
annotations
<-
many
annotation
return
(
Enum
Value
Decl
name
value
annotations
)
return
(
Enum
erant
Decl
name
value
annotations
)
structDecl
statements
=
do
structKeyword
...
...
@@ -313,7 +312,7 @@ annotationTarget = (constKeyword >> return ConstantAnnotation)
name
<-
varIdentifier
case
name
of
"file"
->
return
FileAnnotation
"enumerant"
->
return
Enum
Value
Annotation
"enumerant"
->
return
Enum
erant
Annotation
"field"
->
return
FieldAnnotation
"method"
->
return
MethodAnnotation
"parameter"
->
return
ParamAnnotation
...
...
compiler/src/Semantics.hs
View file @
6b61f9c4
...
...
@@ -45,7 +45,7 @@ data Desc = DescFile FileDesc
|
DescAlias
AliasDesc
|
DescConstant
ConstantDesc
|
DescEnum
EnumDesc
|
DescEnum
Value
EnumValue
Desc
|
DescEnum
erant
Enumerant
Desc
|
DescStruct
StructDesc
|
DescUnion
UnionDesc
|
DescField
FieldDesc
...
...
@@ -61,7 +61,7 @@ descName (DescFile _) = "(top-level)"
descName
(
DescAlias
d
)
=
aliasName
d
descName
(
DescConstant
d
)
=
constantName
d
descName
(
DescEnum
d
)
=
enumName
d
descName
(
DescEnum
Value
d
)
=
enumValue
Name
d
descName
(
DescEnum
erant
d
)
=
enumerant
Name
d
descName
(
DescStruct
d
)
=
structName
d
descName
(
DescUnion
d
)
=
unionName
d
descName
(
DescField
d
)
=
fieldName
d
...
...
@@ -77,7 +77,7 @@ descId (DescFile d) = fileId d
descId
(
DescAlias
_
)
=
Nothing
descId
(
DescConstant
d
)
=
constantId
d
descId
(
DescEnum
d
)
=
enumId
d
descId
(
DescEnum
Value
d
)
=
enumValue
Id
d
descId
(
DescEnum
erant
d
)
=
enumerant
Id
d
descId
(
DescStruct
d
)
=
structId
d
descId
(
DescUnion
d
)
=
unionId
d
descId
(
DescField
d
)
=
fieldId
d
...
...
@@ -101,7 +101,7 @@ descParent (DescFile _) = error "File descriptor has no parent."
descParent
(
DescAlias
d
)
=
aliasParent
d
descParent
(
DescConstant
d
)
=
constantParent
d
descParent
(
DescEnum
d
)
=
enumParent
d
descParent
(
DescEnum
Value
d
)
=
DescEnum
(
enumValue
Parent
d
)
descParent
(
DescEnum
erant
d
)
=
DescEnum
(
enumerant
Parent
d
)
descParent
(
DescStruct
d
)
=
structParent
d
descParent
(
DescUnion
d
)
=
DescStruct
(
unionParent
d
)
descParent
(
DescField
d
)
=
DescStruct
(
fieldParent
d
)
...
...
@@ -117,7 +117,7 @@ descAnnotations (DescFile d) = fileAnnotations d
descAnnotations
(
DescAlias
_
)
=
Map
.
empty
descAnnotations
(
DescConstant
d
)
=
constantAnnotations
d
descAnnotations
(
DescEnum
d
)
=
enumAnnotations
d
descAnnotations
(
DescEnum
Value
d
)
=
enumValue
Annotations
d
descAnnotations
(
DescEnum
erant
d
)
=
enumerant
Annotations
d
descAnnotations
(
DescStruct
d
)
=
structAnnotations
d
descAnnotations
(
DescUnion
d
)
=
unionAnnotations
d
descAnnotations
(
DescField
d
)
=
fieldAnnotations
d
...
...
@@ -161,7 +161,7 @@ data ValueDesc = VoidDesc
|
Float64Desc
Double
|
TextDesc
String
|
DataDesc
ByteString
|
Enum
ValueValueDesc
EnumValue
Desc
|
Enum
erantValueDesc
Enumerant
Desc
|
StructValueDesc
[(
FieldDesc
,
ValueDesc
)]
|
ListDesc
[
ValueDesc
]
deriving
(
Show
)
...
...
@@ -180,7 +180,7 @@ valueString (Float32Desc x) = show x
valueString
(
Float64Desc
x
)
=
show
x
valueString
(
TextDesc
s
)
=
show
s
valueString
(
DataDesc
s
)
=
show
(
map
(
chr
.
fromIntegral
)
s
)
valueString
(
Enum
ValueValueDesc
v
)
=
enumValue
Name
v
valueString
(
Enum
erantValueDesc
v
)
=
enumerant
Name
v
valueString
(
StructValueDesc
l
)
=
"("
++
delimit
", "
(
map
assignmentString
l
)
++
")"
where
assignmentString
(
field
,
value
)
=
case
fieldUnion
field
of
Nothing
->
fieldName
field
++
" = "
++
valueString
value
...
...
@@ -259,7 +259,7 @@ fieldValueSize (Float32Desc _) = Size32
fieldValueSize
(
Float64Desc
_
)
=
Size64
fieldValueSize
(
TextDesc
_
)
=
SizeReference
fieldValueSize
(
DataDesc
_
)
=
SizeReference
fieldValueSize
(
Enum
Value
ValueDesc
_
)
=
Size16
fieldValueSize
(
Enum
erant
ValueDesc
_
)
=
Size16
fieldValueSize
(
StructValueDesc
_
)
=
SizeReference
fieldValueSize
(
ListDesc
_
)
=
SizeReference
...
...
@@ -337,18 +337,18 @@ data EnumDesc = EnumDesc
{
enumName
::
String
,
enumId
::
Maybe
String
,
enumParent
::
Desc
,
enum
Values
::
[
EnumValue
Desc
]
,
enum
erants
::
[
Enumerant
Desc
]
,
enumAnnotations
::
AnnotationMap
,
enumMemberMap
::
MemberMap
,
enumStatements
::
[
Desc
]
}
data
Enum
ValueDesc
=
EnumValue
Desc
{
enum
Value
Name
::
String
,
enum
Value
Id
::
Maybe
String
,
enum
Value
Parent
::
EnumDesc
,
enum
Value
Number
::
Integer
,
enum
Value
Annotations
::
AnnotationMap
data
Enum
erantDesc
=
Enumerant
Desc
{
enum
erant
Name
::
String
,
enum
erant
Id
::
Maybe
String
,
enum
erant
Parent
::
EnumDesc
,
enum
erant
Number
::
Integer
,
enum
erant
Annotations
::
AnnotationMap
}
data
StructDesc
=
StructDesc
...
...
@@ -469,8 +469,8 @@ descToCode indent self@(DescEnum desc) = printf "%senum %s%s {\n%s%s}\n" indent
(
annotationsCode
self
)
(
blockCode
indent
(
enumStatements
desc
))
indent
descToCode
indent
self
@
(
DescEnum
Value
desc
)
=
printf
"%s%s @%d%s;
\n
"
indent
(
enum
ValueName
desc
)
(
enumValue
Number
desc
)
descToCode
indent
self
@
(
DescEnum
erant
desc
)
=
printf
"%s%s @%d%s;
\n
"
indent
(
enum
erantName
desc
)
(
enumerant
Number
desc
)
(
annotationsCode
self
)
descToCode
indent
self
@
(
DescStruct
desc
)
=
printf
"%sstruct %s%s {
\n
%s%s}
\n
"
indent
(
structName
desc
)
...
...
@@ -546,7 +546,7 @@ instance Show FileDesc where { show desc = descToCode "" (DescFile desc) }
instance
Show
AliasDesc
where
{
show
desc
=
descToCode
""
(
DescAlias
desc
)
}
instance
Show
ConstantDesc
where
{
show
desc
=
descToCode
""
(
DescConstant
desc
)
}
instance
Show
EnumDesc
where
{
show
desc
=
descToCode
""
(
DescEnum
desc
)
}
instance
Show
Enum
ValueDesc
where
{
show
desc
=
descToCode
""
(
DescEnumValue
desc
)
}
instance
Show
Enum
erantDesc
where
{
show
desc
=
descToCode
""
(
DescEnumerant
desc
)
}
instance
Show
StructDesc
where
{
show
desc
=
descToCode
""
(
DescStruct
desc
)
}
instance
Show
FieldDesc
where
{
show
desc
=
descToCode
""
(
DescField
desc
)
}
instance
Show
InterfaceDesc
where
{
show
desc
=
descToCode
""
(
DescInterface
desc
)
}
...
...
compiler/src/WireFormat.hs
View file @
6b61f9c4
...
...
@@ -64,7 +64,7 @@ encodeDataValue (Float32Desc v) = bytes (floatToWord v) 4
encodeDataValue
(
Float64Desc
v
)
=
bytes
(
doubleToWord
v
)
8
encodeDataValue
(
TextDesc
_
)
=
error
"Not fixed-width data."
encodeDataValue
(
DataDesc
_
)
=
error
"Not fixed-width data."
encodeDataValue
(
Enum
ValueValueDesc
v
)
=
bytes
(
enumValue
Number
v
)
2
encodeDataValue
(
Enum
erantValueDesc
v
)
=
bytes
(
enumerant
Number
v
)
2
encodeDataValue
(
StructValueDesc
_
)
=
error
"Not fixed-width data."
encodeDataValue
(
ListDesc
_
)
=
error
"Not fixed-width data."
...
...
compiler/src/c++-header.mustache
View file @
6b61f9c4
...
...
@@ -61,9 +61,9 @@ struct {{typeFullName}} {
{{#
structNestedEnums
}}
enum class
{{
enumName
}}
: uint16_t {
{{#
enum
Value
s
}}
{{
enum
ValueName
}}
=
{{
enumValue
Number
}}
,
{{/
enum
Value
s
}}
{{#
enum
erant
s
}}
{{
enum
erantName
}}
=
{{
enumerant
Number
}}
,
{{/
enum
erant
s
}}
};
{{/
structNestedEnums
}}
...
...
@@ -93,9 +93,9 @@ struct {{typeFullName}} {
{{#
fileEnums
}}
enum class
{{
enumName
}}
: uint16_t {
{{#
enum
Value
s
}}
{{
enum
ValueName
}}
=
{{
enumValue
Number
}}
,
{{/
enum
Value
s
}}
{{#
enum
erant
s
}}
{{
enum
erantName
}}
=
{{
enumerant
Number
}}
,
{{/
enum
erant
s
}}
};
{{/
fileEnums
}}
{{! =========================================================================================== }}
...
...
doc/language.md
View file @
6b61f9c4
...
...
@@ -43,7 +43,7 @@ Some notes:
*
Types come after names. The name is by far the most important thing to see, especially when
quickly skimming, so we put it up front where it is most visible. Sorry, C got it wrong.
*
The
`@N`
annotations show how the protocol evolved over time, so that the system can make sure
to maintain compatibility with older versions. Fields (and enum
value
s, and interface methods)
to maintain compatibility with older versions. Fields (and enum
erant
s, and interface methods)
must be numbered consecutively starting from zero in the order in which they were added. In this
example, it looks like the
`birthdate`
field was added to the
`Person`
structure recently -- its
number is higher than the
`email`
and
`phones`
fields. Unlike Protobufs, you cannot skip numbers
...
...
@@ -172,7 +172,7 @@ enum Rfc3092Variable {
}
{% endhighlight %}
Like fields, enum
value
s must be numbered sequentially starting from zero. In languages where
Like fields, enum
erant
s must be numbered sequentially starting from zero. In languages where
enums have numeric values, these numbers will be used, but in general Cap'n Proto enums should not
be considered numeric.
...
...
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