-
Notifications
You must be signed in to change notification settings - Fork 5
/
tokens.ts
25 lines (23 loc) · 891 Bytes
/
tokens.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
/*
* Copyright (c) 2020, J2 Innovations. All Rights Reserved
*/
import { TokenObj } from './TokenObj'
import { TokenType } from './TokenType'
/**
* A collection of constant tokens.
*/
export const tokens = {
eof: new TokenObj(TokenType.eof, '<eof>'),
equals: new TokenObj(TokenType.equals, '=='),
notEquals: new TokenObj(TokenType.notEquals, '!='),
lessThan: new TokenObj(TokenType.lessThan, '<'),
lessThanOrEqual: new TokenObj(TokenType.lessThanOrEqual, '<='),
greaterThan: new TokenObj(TokenType.greaterThan, '>'),
greaterThanOrEqual: new TokenObj(TokenType.greaterThanOrEqual, '>='),
leftBrace: new TokenObj(TokenType.leftBrace, '('),
rightBrace: new TokenObj(TokenType.rightBrace, ')'),
and: new TokenObj(TokenType.text, 'and'),
or: new TokenObj(TokenType.text, 'or'),
not: new TokenObj(TokenType.text, 'not'),
wildcardEq: new TokenObj(TokenType.wildcardEq, '*=='),
}