yi-0.6.2.3: The Haskell-Scriptable EditorSource codeContentsIndex
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
= Unknown
| Res !Reserved
| Str !String
| Rex !String
| Op !Operator
| Special !Char
| Number !String
| ValidName !String
| Comment !CommentType
| Const !String
data Reserved
= Break'
| Case'
| Catch'
| Continue'
| Default'
| Delete'
| Do'
| Else'
| Finally'
| For'
| Function'
| If'
| In'
| InstanceOf'
| New'
| Return'
| Switch'
| This'
| Throw'
| Try'
| TypeOf'
| Var'
| Void'
| While'
| With'
| True'
| False'
| Null'
| Undefined'
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
initState :: HlStateSource
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 -> StyleSource
type TT = Tok TokenSource
data Token Source
The different tokens.
Constructors
Unknown
Res !Reserved
Str !String
Rex !String
Op !Operator
Special !Char
Number !String
ValidName !String
Comment !CommentType
Const !String
show/hide Instances
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.
Constructors
Break'
Case'
Catch'
Continue'
Default'
Delete'
Do'
Else'
Finally'
For'
Function'
If'
In'
InstanceOf'
New'
Return'
Switch'
This'
Throw'
Try'
TypeOf'
Var'
Void'
While'
With'
True'
False'
Null'
Undefined'
show/hide Instances
data Operator Source
The constructors for Operator have an apostrophe as a suffix because e.g. LT is already used by Prelude.
Constructors
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'
show/hide Instances
type HlState = IntSource

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.

Postfix operators.

Infix operators.

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

prefixOperators :: [Operator]Source
infixOperators :: [Operator]Source
postfixOperators :: [Operator]Source
Produced by Haddock version 2.6.1