shimmer-0.1.3.4: The Reflective Lambda Machine

Safe HaskellSafe
LanguageHaskell98

SMR.Source.Token

Synopsis

Documentation

data Token Source #

Tokens for for the source language.

Constructors

KEnd

End of input.

KPunc Char

Punctuation character.

KName Space Text

A scoped name.

KNat Integer

A literal natural number.

KText Text

A literal text string.

Instances
Eq Token Source # 
Instance details

Defined in SMR.Source.Token

Methods

(==) :: Token -> Token -> Bool #

(/=) :: Token -> Token -> Bool #

Show Token Source # 
Instance details

Defined in SMR.Source.Token

Methods

showsPrec :: Int -> Token -> ShowS #

show :: Token -> String #

showList :: [Token] -> ShowS #

data Space Source #

Name space of a name.

Constructors

SVar

Local variable.

SMac

Macro name.

SSym

Symbol name.

SSet

Set name.

SPrm

Primitive name.

SKey

Keyword (super primitive)

SNom

Nominal name.

Instances
Eq Space Source # 
Instance details

Defined in SMR.Source.Token

Methods

(==) :: Space -> Space -> Bool #

(/=) :: Space -> Space -> Bool #

Show Space Source # 
Instance details

Defined in SMR.Source.Token

Methods

showsPrec :: Int -> Space -> ShowS #

show :: Space -> String #

showList :: [Space] -> ShowS #

isToken :: Token -> Token -> Bool Source #

Check if a token is equal to the give none.

isKPunc :: Char -> Token -> Bool Source #

Check is token is punctuation using the given character.

takeNameOfToken :: Space -> Token -> Maybe Text Source #

Take the name from a token, if any.

takeAnyNameOfToken :: Token -> Maybe (Space, Text) Source #

Take the name from a token, if any.

takeNatOfToken :: Token -> Maybe Integer Source #

Take the natural number from a token, if any.

takeTextOfToken :: Token -> Maybe Text Source #

Take the text string from a token, if any.