Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- type IToken =
- interface
- abstract member row : int32
- abstract member col : int32
- end
- type Token =
- | Keyword of name:string * row:int32 * col:int32
- | Identifier of name:string * row:int32 * col:int32
- | Op of name:string * row:int32 * col:int32
- | Float of value:float * row:int32 * col:int32
- | Int of value:int64 * row:int32 * col:int32
- | LParen of row:int32 * col:int32
- | RParen of row:int32 * col:int32
- | LBracket of row:int32 * col:int32
- | RBracket of row:int32 * col:int32
- | Dot of row:int32 * col:int32
- | Comma of row:int32 * col:int32
- | NewLine of indent:int32 * row:int32 * col:int32
- interface IToken with
- member s.row =
- match s with
- | Keyword (_,r,_) -> r
- | Identifier (_,r,_) -> r
- | Op (_,r,_) -> r
- | Float (_,r,_) -> r
- | Int (_,r,_) -> r
- | LParen (r,_) -> r
- | RParen (r,_) -> r
- | LBracket (r,_) -> r
- | RBracket (r,_) -> r
- | Dot (r,_) -> r
- | Comma (r,_) -> r
- | NewLine (_,r,_) -> r
- member s.col =
- match s with
- | Keyword (_,_,c) -> c
- | Identifier (_,_,c) -> c
- | Op (_,_,c) -> c
- | Float (_,_,c) -> c
- | Int (_,_,c) -> c
- | LParen (_,c) -> c
- | RParen (_,c) -> c
- | LBracket (_,c) -> c
- | RBracket (_,c) -> c
- | Dot (_,c) -> c
- | Comma (_,c) -> c
- | NewLine (_,_,c) -> c
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement