From c6d655c50e31fe8a0f9d4bf342e422ea4bf592c0 Mon Sep 17 00:00:00 2001 From: Pieter Goetschalckx Date: Tue, 8 Sep 2020 16:58:38 +0200 Subject: [PATCH] Rename supertype identifiers --- tree-sitter/src/TreeSitter/Symbol.hs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/tree-sitter/src/TreeSitter/Symbol.hs b/tree-sitter/src/TreeSitter/Symbol.hs index 08f7451e..6d8311f6 100644 --- a/tree-sitter/src/TreeSitter/Symbol.hs +++ b/tree-sitter/src/TreeSitter/Symbol.hs @@ -122,10 +122,12 @@ escapeOperatorPunctuation = concatMap $ \case camelCase :: String -> String camelCase = go where - go ('_':'_':xs) = "Underscore" <> go xs - go ('_':xs) = go (capitalize xs) - go (x:xs) = x : go xs - go "" = "" + go ('_':xs) = "super" <> capitalize (go xs) + go xs = go' xs + go' ('_':'_':xs) = "Underscore" <> go' (capitalize xs) + go' ('_':xs) = go' (capitalize xs) + go' (x:xs) = x : go' xs + go' "" = "" -- | Capitalize a String capitalize :: String -> String