tree-sitter-0.9.0.3: Unstable bindings for the tree-sitter parsing library.
Safe HaskellSafe-Inferred
LanguageHaskell2010

TreeSitter.Symbol

Synopsis

Documentation

type TSSymbol = Word16 Source #

fromTSSymbol :: forall symbol. Symbol symbol => TSSymbol -> symbol Source #

Map a TSSymbol to the corresponding value of a Symbol datatype.

This should be used instead of toEnum to perform this conversion, because tree-sitter represents parse errors with the unsigned short 65535, which is generally not contiguous with the other symbols.

data SymbolType Source #

Constructors

Regular 
Anonymous 
Auxiliary 

Instances

Instances details
Enum SymbolType Source # 
Instance details

Defined in TreeSitter.Symbol

Show SymbolType Source # 
Instance details

Defined in TreeSitter.Symbol

Methods

showsPrec :: Int -> SymbolType -> ShowS

show :: SymbolType -> String

showList :: [SymbolType] -> ShowS

Eq SymbolType Source # 
Instance details

Defined in TreeSitter.Symbol

Methods

(==) :: SymbolType -> SymbolType -> Bool

(/=) :: SymbolType -> SymbolType -> Bool

Ord SymbolType Source # 
Instance details

Defined in TreeSitter.Symbol

Lift SymbolType Source # 
Instance details

Defined in TreeSitter.Symbol

Methods

lift :: Quote m => SymbolType -> m Exp

liftTyped :: forall (m :: Type -> Type). Quote m => SymbolType -> Code m SymbolType

class (Bounded s, Enum s, Ix s, Ord s, Show s) => Symbol s where Source #

Methods

symbolType :: s -> SymbolType Source #

symbolToName :: SymbolType -> String -> String Source #

escapeOperatorPunctuation :: String -> String Source #

camelCase :: String -> String Source #

Convert a snake_case String to camelCase

capitalize :: String -> String Source #

Capitalize a String