| Index: mojom/mojom_parser/mojom/types.go
|
| diff --git a/mojom/mojom_parser/mojom/types.go b/mojom/mojom_parser/mojom/types.go
|
| index 264aa498ef8778e61451a15092f1b7ddcc569f3f..0baa519385ea6d563e44471ede47ac8f06757498 100644
|
| --- a/mojom/mojom_parser/mojom/types.go
|
| +++ b/mojom/mojom_parser/mojom/types.go
|
| @@ -213,6 +213,10 @@ type StringType struct {
|
| nullable bool
|
| }
|
|
|
| +func (s StringType) Nullable() bool {
|
| + return s.nullable
|
| +}
|
| +
|
| // StringLiteralType is a global singleton representing the unique LiteralType string.
|
| var StringLiteralType LiteralType = StringType{}
|
|
|
| @@ -282,6 +286,14 @@ type HandleTypeRef struct {
|
| kind HandleKind
|
| }
|
|
|
| +func (h HandleTypeRef) Nullable() bool {
|
| + return h.nullable
|
| +}
|
| +
|
| +func (h HandleTypeRef) HandleKind() HandleKind {
|
| + return h.kind
|
| +}
|
| +
|
| func (HandleTypeRef) TypeRefKind() TypeKind {
|
| return TypeKindHandle
|
| }
|
| @@ -390,6 +402,18 @@ func NewArrayTypeRef(elementType TypeRef, fixedSize int, nullable bool) *ArrayTy
|
| return &ArrayTypeRef{nullable, fixedSize, elementType}
|
| }
|
|
|
| +func (a ArrayTypeRef) Nullable() bool {
|
| + return a.nullable
|
| +}
|
| +
|
| +func (a ArrayTypeRef) FixedLength() int {
|
| + return a.fixedLength
|
| +}
|
| +
|
| +func (a ArrayTypeRef) ElementType() TypeRef {
|
| + return a.elementType
|
| +}
|
| +
|
| // An ArrayTypeRef is a TypeRef:
|
|
|
| func (ArrayTypeRef) TypeRefKind() TypeKind {
|
| @@ -408,10 +432,6 @@ func (ArrayTypeRef) MarkTypeCompatible(assignment LiteralAssignment) bool {
|
| return assignment.assignedValue.IsDefault()
|
| }
|
|
|
| -func (a ArrayTypeRef) Nullable() bool {
|
| - return a.nullable
|
| -}
|
| -
|
| func (a ArrayTypeRef) String() string {
|
| fixedLengthSpecifier := ""
|
| if a.fixedLength > 0 {
|
| @@ -441,6 +461,18 @@ func NewMapTypeRef(keyType TypeRef, valueType TypeRef, nullable bool) *MapTypeRe
|
| return &MapTypeRef{nullable, keyType, valueType}
|
| }
|
|
|
| +func (m MapTypeRef) Nullable() bool {
|
| + return m.nullable
|
| +}
|
| +
|
| +func (m MapTypeRef) KeyType() TypeRef {
|
| + return m.keyType
|
| +}
|
| +
|
| +func (m MapTypeRef) ValueType() TypeRef {
|
| + return m.valueType
|
| +}
|
| +
|
| // A MapTypeRef is a TypeRef:
|
|
|
| func (MapTypeRef) TypeRefKind() TypeKind {
|
| @@ -459,10 +491,6 @@ func (MapTypeRef) MarkTypeCompatible(assignment LiteralAssignment) bool {
|
| return assignment.assignedValue.IsDefault()
|
| }
|
|
|
| -func (m MapTypeRef) Nullable() bool {
|
| - return m.nullable
|
| -}
|
| -
|
| func (m MapTypeRef) String() string {
|
| nullableSpecifier := ""
|
| if m.nullable {
|
| @@ -521,6 +549,18 @@ func NewResolvedUserTypeRef(identifier string, resolvedType UserDefinedType) *Us
|
| return &UserTypeRef{identifier: identifier, resolvedType: resolvedType}
|
| }
|
|
|
| +func (t *UserTypeRef) Nullable() bool {
|
| + return t.nullable
|
| +}
|
| +
|
| +func (t *UserTypeRef) IsInterfaceRequest() bool {
|
| + return t.interfaceRequest
|
| +}
|
| +
|
| +func (t *UserTypeRef) Identifier() string {
|
| + return t.identifier
|
| +}
|
| +
|
| // A UserTypeRef is a TypeRef:
|
|
|
| func (UserTypeRef) TypeRefKind() TypeKind {
|
| @@ -555,10 +595,6 @@ func (t *UserTypeRef) MarkTypeCompatible(assignment LiteralAssignment) bool {
|
| return true
|
| }
|
|
|
| -func (t *UserTypeRef) Nullable() bool {
|
| - return t.nullable
|
| -}
|
| -
|
| func (ref *UserTypeRef) validateAfterResolution() error {
|
| if ref.resolvedType.Kind() != UserDefinedTypeKindEnum {
|
| // A type ref has resolved to a non-enum type. Make sure it is not
|
|
|