Safe Haskell | None |
---|---|
Language | Haskell2010 |
Yi.Lexer.JavaScript
Synopsis
- initState :: HlState
- alexScanToken :: (AlexState HlState, AlexInput) -> Maybe (Tok Token, (AlexState HlState, AlexInput))
- tokenToStyle :: Token -> UIStyle -> Style
- type TT = Tok Token
- data Token
- data Reserved
- data Operator
- = Add'
- | Subtract'
- | Multiply'
- | Divide'
- | Modulo'
- | Increment'
- | Decrement'
- | Assign'
- | AddAssign'
- | SubtractAssign'
- | MultiplyAssign'
- | DivideAssign'
- | ModuloAssign'
- | Equals'
- | NotEquals'
- | GT'
- | GTE'
- | LT'
- | LTE'
- | EqualsType'
- | NotEqualsType'
- | And'
- | Or'
- | Not'
- | BitAnd'
- | BitOr'
- | BitXor'
- | LeftShift'
- | RightShift'
- | RightShiftZ'
- | BitNot'
- | Qualify'
- type HlState = Int
- prefixOperators :: [Operator]
- infixOperators :: [Operator]
- postfixOperators :: [Operator]
Documentation
alexScanToken :: (AlexState HlState, AlexInput) -> Maybe (Tok Token, (AlexState HlState, AlexInput)) Source #
Scan one token. Return (maybe) a token and a new state.
The different tokens.
Constructors
Unknown | |
Res !Reserved | |
Str !String | |
Rex !String | |
Op !Operator | |
Special !Char | |
Number !String | |
ValidName !String | |
Comment !CommentType | |
Const !String |
Instances
Show Token Source # | |
Eq Token Source # | |
Strokable (Tok Token) Source # | |
Strokable (Array TT) Source # | |
Strokable (Block TT) Source # | |
Strokable (Expr TT) Source # | |
Strokable (ForContent TT) Source # | |
Defined in Yi.Syntax.JavaScript | |
Strokable (KeyValue TT) Source # | |
Strokable (ParExpr TT) Source # | |
Strokable (Parameters TT) Source # | |
Defined in Yi.Syntax.JavaScript | |
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. |
Strokable (VarDecAss TT) 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.
Constructors
Instances
The constructors for Operator
have an apostrophe as a suffix because
e.g. LT
is already used by Prelude
.
Constructors
Instances
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.