2020-10-21 22:49:08 +02:00
|
|
|
# Copyright 2020 Mattia Giambirtone
|
|
|
|
#
|
|
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
# you may not use this file except in compliance with the License.
|
|
|
|
# You may obtain a copy of the License at
|
|
|
|
#
|
|
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
#
|
|
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
# See the License for the specific language governing permissions and
|
|
|
|
# limitations under the License.
|
2020-10-21 22:34:04 +02:00
|
|
|
|
2020-08-05 16:16:12 +02:00
|
|
|
# Token types enumeration
|
|
|
|
|
|
|
|
type
|
|
|
|
TokenType* = enum
|
|
|
|
PLUS, MINUS, SLASH, STAR,
|
|
|
|
NEG, NE, EQ, DEQ, LT, GE,
|
2020-08-06 14:51:50 +02:00
|
|
|
LE, MOD, POW, GT, LP, RP, LS
|
2020-08-10 10:48:21 +02:00
|
|
|
LB, RB, COMMA, DOT,
|
|
|
|
ID, RS, NUMBER, STR,
|
2020-08-05 16:16:12 +02:00
|
|
|
SEMICOLON, AND, CLASS,
|
|
|
|
ELSE, FOR, FUN, FALSE,
|
|
|
|
IF, NIL, RETURN, SUPER,
|
|
|
|
THIS, OR, TRUE, VAR,
|
2020-08-14 10:02:13 +02:00
|
|
|
WHILE, DEL, BREAK, EOF,
|
2020-08-30 12:35:37 +02:00
|
|
|
COLON, CONTINUE, CARET,
|
2020-10-21 22:34:04 +02:00
|
|
|
SHL, SHR, NAN, INF, BAND,
|
2020-09-29 17:32:42 +02:00
|
|
|
BOR, TILDE
|