1
1
mirror of https://github.com/github/semantic.git synced 2024-12-29 18:06:14 +03:00

Rename result to symbolMatchingInstance.

This commit is contained in:
Rob Rix 2020-02-04 13:48:10 -05:00
parent 3c4a39a1d7
commit cc553e2c5c
No known key found for this signature in database
GPG Key ID: 2BE643E01DC032AE

View File

@ -79,11 +79,11 @@ syntaxDatatype language allSymbols datatype = skipDefined $ do
<> traversalInstances)
ProductType (DatatypeName datatypeName) named children fields -> do
con <- ctorForProductType datatypeName typeParameterName children fields
result <- symbolMatchingInstance allSymbols name named datatypeName
symbolMatchingInstance <- symbolMatchingInstance allSymbols name named datatypeName
traversalInstances <- makeTraversalInstances (conT name)
pure
( generatedDatatype name [con] typeParameterName
: result
: symbolMatchingInstance
<> traversalInstances)
-- Anonymous leaf types are defined as synonyms for the `Token` datatype
LeafType (DatatypeName datatypeName) Anonymous -> do
@ -91,11 +91,11 @@ syntaxDatatype language allSymbols datatype = skipDefined $ do
pure [ TySynD name [] (ConT ''Token `AppT` LitT (StrTyLit datatypeName) `AppT` LitT (NumTyLit (fromIntegral tsSymbol))) ]
LeafType (DatatypeName datatypeName) Named -> do
con <- ctorForLeafType (DatatypeName datatypeName) typeParameterName
result <- symbolMatchingInstance allSymbols name Named datatypeName
symbolMatchingInstance <- symbolMatchingInstance allSymbols name Named datatypeName
traversalInstances <- makeTraversalInstances (conT name)
pure
( generatedDatatype name [con] typeParameterName
: result
: symbolMatchingInstance
<> traversalInstances)
where
-- Skip generating datatypes that have already been defined (overridden) in the module where the splice is running.