yi-mode-javascript-0.17.1: Yi editor javascript mode

Safe HaskellNone
LanguageHaskell2010

Yi.Lexer.JavaScript

Synopsis

Documentation

alexScanToken :: (AlexState HlState, AlexInput) -> Maybe (Tok Token, (AlexState HlState, AlexInput)) Source #

Scan one token. Return (maybe) a token and a new state.

tokenToStyle :: Token -> UIStyle -> Style Source #

Takes a Token and returns a style to be used for that type of token.

TODO: The elem check is potentially unnecessarily slow. We could split the Const constructor into two different ones, one for builtins and one for others.

data Token Source #

The different tokens.

Instances

Eq Token Source # 

Methods

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

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

Show Token Source # 

Methods

showsPrec :: Int -> Token -> ShowS #

show :: Token -> String #

showList :: [Token] -> ShowS #

Strokable (Tok Token) Source # 
Strokable (KeyValue TT) Source # 
Strokable (Array TT) Source # 
Strokable (Expr TT) Source # 
Strokable (VarDecAss TT) Source # 
Strokable (Block TT) Source # 
Strokable (ForContent TT) Source # 
Strokable (ParExpr TT) Source # 
Strokable (Parameters TT) Source # 
Strokable (Statement TT) Source #

TODO: This code is *screaming* for some generic programming.

TODO: Somehow fix Failable and failStroker to be more "generic". This will make these instances much nicer and we won't have to make ad-hoc stuff like this.

data Reserved Source #

The constructors for Reserved have an apostrophe as a suffix because Default is already used. Also note that Undefined' is not intended as some sort of "backup" reserved word for things we don't care about -- it really means the "undefined" built-in in JavaScript.

type HlState = Int Source #

HlState is 0 when outside of a multi-line comment and -1 when inside one.

prefixOperators :: [Operator] Source #

Prefix operators. NOTE: Add' is also a valid prefix operator, but since it's completely useless in the real world, we don't care about it here. Doing this makes parsing much, much easier.

infixOperators :: [Operator] Source #

Infix operators.

postfixOperators :: [Operator] Source #

Postfix operators.