bydgoszczscript

simple, fast and efficient programming language
git clone git://git.kocotian.pl/bydgoszczscript.git
Log | Files | Refs | README | LICENSE

commit b5b560052a8a85d19b0f760b9f50f3e2ea2d6e39
parent 069fb21996eaa6063a6966ce7a9eb3db5015093b
Author: kocotian <kocotian@kocotian.pl>
Date:   Thu, 27 May 2021 13:27:33 +0200

Comma token

Diffstat:
Minclude/token.h | 2+-
Mtoken.c | 5+++++
2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/include/token.h b/include/token.h @@ -30,7 +30,7 @@ typedef enum { TokenNULL, TokenIdentifier, TokenNumber, TokenString, TokenOpeningParenthesis, TokenClosingParenthesis, - TokenColon, TokenSemicolon, + TokenColon, TokenSemicolon, TokenComma, } TokenType; typedef struct Token { diff --git a/token.c b/token.c @@ -93,6 +93,11 @@ nextToken(File *f) TYPE(TokenSemicolon); ++i; } + /* Comma */ + else if ((CURCHAR == ',')) { + TYPE(TokenComma); + ++i; + } /* Other unexpected token */ else { errwarn(*f, 1, "unexpected token: '%c'", CURCHAR);