1
1
mirror of https://github.com/github/semantic.git synced 2024-11-27 03:09:48 +03:00

Remove UNKNOWN

This commit is contained in:
Timothy Clem 2020-06-04 14:03:23 -07:00
parent 769b7d0355
commit c722b0d87e
3 changed files with 29 additions and 38 deletions

View File

@ -163,15 +163,14 @@ enum NodeType {
} }
enum SyntaxType { enum SyntaxType {
UNKNOWN = 0; FUNCTION = 0;
FUNCTION = 1; METHOD = 1;
METHOD = 2; CLASS = 2;
CLASS = 3; MODULE = 3;
MODULE = 4; CALL = 4;
CALL = 5; TYPE = 5;
TYPE = 6; INTERFACE = 6;
INTERFACE = 7; IMPLEMENTATION = 7;
IMPLEMENTATION = 8;
} }
message StackGraphNode { message StackGraphNode {

View File

@ -6081,8 +6081,7 @@ newtype SyntaxType'UnrecognizedValue
= SyntaxType'UnrecognizedValue Data.Int.Int32 = SyntaxType'UnrecognizedValue Data.Int.Int32
deriving (Prelude.Eq, Prelude.Ord, Prelude.Show) deriving (Prelude.Eq, Prelude.Ord, Prelude.Show)
data SyntaxType data SyntaxType
= UNKNOWN | = FUNCTION |
FUNCTION |
METHOD | METHOD |
CLASS | CLASS |
MODULE | MODULE |
@ -6093,20 +6092,18 @@ data SyntaxType
SyntaxType'Unrecognized !SyntaxType'UnrecognizedValue SyntaxType'Unrecognized !SyntaxType'UnrecognizedValue
deriving (Prelude.Show, Prelude.Eq, Prelude.Ord) deriving (Prelude.Show, Prelude.Eq, Prelude.Ord)
instance Data.ProtoLens.MessageEnum SyntaxType where instance Data.ProtoLens.MessageEnum SyntaxType where
maybeToEnum 0 = Prelude.Just UNKNOWN maybeToEnum 0 = Prelude.Just FUNCTION
maybeToEnum 1 = Prelude.Just FUNCTION maybeToEnum 1 = Prelude.Just METHOD
maybeToEnum 2 = Prelude.Just METHOD maybeToEnum 2 = Prelude.Just CLASS
maybeToEnum 3 = Prelude.Just CLASS maybeToEnum 3 = Prelude.Just MODULE
maybeToEnum 4 = Prelude.Just MODULE maybeToEnum 4 = Prelude.Just CALL
maybeToEnum 5 = Prelude.Just CALL maybeToEnum 5 = Prelude.Just TYPE
maybeToEnum 6 = Prelude.Just TYPE maybeToEnum 6 = Prelude.Just INTERFACE
maybeToEnum 7 = Prelude.Just INTERFACE maybeToEnum 7 = Prelude.Just IMPLEMENTATION
maybeToEnum 8 = Prelude.Just IMPLEMENTATION
maybeToEnum k maybeToEnum k
= Prelude.Just = Prelude.Just
(SyntaxType'Unrecognized (SyntaxType'Unrecognized
(SyntaxType'UnrecognizedValue (Prelude.fromIntegral k))) (SyntaxType'UnrecognizedValue (Prelude.fromIntegral k)))
showEnum UNKNOWN = "UNKNOWN"
showEnum FUNCTION = "FUNCTION" showEnum FUNCTION = "FUNCTION"
showEnum METHOD = "METHOD" showEnum METHOD = "METHOD"
showEnum CLASS = "CLASS" showEnum CLASS = "CLASS"
@ -6118,7 +6115,6 @@ instance Data.ProtoLens.MessageEnum SyntaxType where
showEnum (SyntaxType'Unrecognized (SyntaxType'UnrecognizedValue k)) showEnum (SyntaxType'Unrecognized (SyntaxType'UnrecognizedValue k))
= Prelude.show k = Prelude.show k
readEnum k readEnum k
| (Prelude.==) k "UNKNOWN" = Prelude.Just UNKNOWN
| (Prelude.==) k "FUNCTION" = Prelude.Just FUNCTION | (Prelude.==) k "FUNCTION" = Prelude.Just FUNCTION
| (Prelude.==) k "METHOD" = Prelude.Just METHOD | (Prelude.==) k "METHOD" = Prelude.Just METHOD
| (Prelude.==) k "CLASS" = Prelude.Just CLASS | (Prelude.==) k "CLASS" = Prelude.Just CLASS
@ -6130,7 +6126,7 @@ instance Data.ProtoLens.MessageEnum SyntaxType where
| Prelude.otherwise | Prelude.otherwise
= (Prelude.>>=) (Text.Read.readMaybe k) Data.ProtoLens.maybeToEnum = (Prelude.>>=) (Text.Read.readMaybe k) Data.ProtoLens.maybeToEnum
instance Prelude.Bounded SyntaxType where instance Prelude.Bounded SyntaxType where
minBound = UNKNOWN minBound = FUNCTION
maxBound = IMPLEMENTATION maxBound = IMPLEMENTATION
instance Prelude.Enum SyntaxType where instance Prelude.Enum SyntaxType where
toEnum k__ toEnum k__
@ -6140,21 +6136,19 @@ instance Prelude.Enum SyntaxType where
"toEnum: unknown value for enum SyntaxType: " (Prelude.show k__))) "toEnum: unknown value for enum SyntaxType: " (Prelude.show k__)))
Prelude.id Prelude.id
(Data.ProtoLens.maybeToEnum k__) (Data.ProtoLens.maybeToEnum k__)
fromEnum UNKNOWN = 0 fromEnum FUNCTION = 0
fromEnum FUNCTION = 1 fromEnum METHOD = 1
fromEnum METHOD = 2 fromEnum CLASS = 2
fromEnum CLASS = 3 fromEnum MODULE = 3
fromEnum MODULE = 4 fromEnum CALL = 4
fromEnum CALL = 5 fromEnum TYPE = 5
fromEnum TYPE = 6 fromEnum INTERFACE = 6
fromEnum INTERFACE = 7 fromEnum IMPLEMENTATION = 7
fromEnum IMPLEMENTATION = 8
fromEnum (SyntaxType'Unrecognized (SyntaxType'UnrecognizedValue k)) fromEnum (SyntaxType'Unrecognized (SyntaxType'UnrecognizedValue k))
= Prelude.fromIntegral k = Prelude.fromIntegral k
succ IMPLEMENTATION succ IMPLEMENTATION
= Prelude.error = Prelude.error
"SyntaxType.succ: bad argument IMPLEMENTATION. This value would be out of bounds." "SyntaxType.succ: bad argument IMPLEMENTATION. This value would be out of bounds."
succ UNKNOWN = FUNCTION
succ FUNCTION = METHOD succ FUNCTION = METHOD
succ METHOD = CLASS succ METHOD = CLASS
succ CLASS = MODULE succ CLASS = MODULE
@ -6164,10 +6158,9 @@ instance Prelude.Enum SyntaxType where
succ INTERFACE = IMPLEMENTATION succ INTERFACE = IMPLEMENTATION
succ (SyntaxType'Unrecognized _) succ (SyntaxType'Unrecognized _)
= Prelude.error "SyntaxType.succ: bad argument: unrecognized value" = Prelude.error "SyntaxType.succ: bad argument: unrecognized value"
pred UNKNOWN pred FUNCTION
= Prelude.error = Prelude.error
"SyntaxType.pred: bad argument UNKNOWN. This value would be out of bounds." "SyntaxType.pred: bad argument FUNCTION. This value would be out of bounds."
pred FUNCTION = UNKNOWN
pred METHOD = FUNCTION pred METHOD = FUNCTION
pred CLASS = METHOD pred CLASS = METHOD
pred MODULE = CLASS pred MODULE = CLASS
@ -6182,7 +6175,7 @@ instance Prelude.Enum SyntaxType where
enumFromThen = Data.ProtoLens.Message.Enum.messageEnumFromThen enumFromThen = Data.ProtoLens.Message.Enum.messageEnumFromThen
enumFromThenTo = Data.ProtoLens.Message.Enum.messageEnumFromThenTo enumFromThenTo = Data.ProtoLens.Message.Enum.messageEnumFromThenTo
instance Data.ProtoLens.FieldDefault SyntaxType where instance Data.ProtoLens.FieldDefault SyntaxType where
fieldDefault = UNKNOWN fieldDefault = FUNCTION
instance Control.DeepSeq.NFData SyntaxType where instance Control.DeepSeq.NFData SyntaxType where
rnf x__ = Prelude.seq x__ () rnf x__ = Prelude.seq x__ ()
{- | Fields : {- | Fields :

View File

@ -859,7 +859,6 @@ instance ToJSON NodeType where
toEncoding = toAesonEncoding toEncoding = toAesonEncoding
instance FromJSONPB SyntaxType where instance FromJSONPB SyntaxType where
parseJSONPB (JSONPB.String "UNKNOWN") = pure UNKNOWN
parseJSONPB (JSONPB.String "FUNCTION") = pure FUNCTION parseJSONPB (JSONPB.String "FUNCTION") = pure FUNCTION
parseJSONPB (JSONPB.String "METHOD") = pure METHOD parseJSONPB (JSONPB.String "METHOD") = pure METHOD
parseJSONPB (JSONPB.String "CLASS") = pure CLASS parseJSONPB (JSONPB.String "CLASS") = pure CLASS