remove temporary 'block' keyword

This commit is contained in:
K. Lange 2020-12-27 10:58:36 +09:00
parent 90bc82e976
commit 076da0bc1e
3 changed files with 11 additions and 3 deletions

View File

@ -581,9 +581,19 @@ static void unary(int canAssign) {
}
static void string(int canAssign) {
/* TODO: needs to handle escape sequences */
emitConstant(OBJECT_VAL(copyString(parser.previous.start + 1, parser.previous.length - 2)));
}
/* TODO
static void codepoint(int canAssign) {
// Convert utf8 bytes to single codepoint; error on multiple codepoints.
// Emit as constant Integer value? Or as separate Codepoint value?
// The latter could add to strings as utf8 bytes, but compare to
// Integers as the numerical value...
}
*/
#define EMIT_CONSTANT_OP(opc, arg) do { if (arg < 256) { emitBytes(opc, arg); } \
else { emitBytes(opc ## _LONG, arg >> 16); emitBytes(arg >> 8, arg); } } while (0)
@ -637,7 +647,7 @@ ParseRule rules[] = {
[TOKEN_IDENTIFIER] = {variable, NULL, PREC_NONE},
[TOKEN_STRING] = {string, NULL, PREC_NONE},
[TOKEN_NUMBER] = {number, NULL, PREC_NONE},
[TOKEN_CODEPOINT] = {NULL, NULL, PREC_NONE}, /* should be equivalent to number */
[TOKEN_CODEPOINT] = {NULL, NULL, PREC_NONE}, /* TODO */
[TOKEN_AND] = {NULL, and_, PREC_AND},
[TOKEN_CLASS] = {NULL, NULL, PREC_NONE},
[TOKEN_ELSE] = {NULL, NULL, PREC_NONE},

View File

@ -176,7 +176,6 @@ static KrkTokenType identifierType() {
switch (*scanner.start) {
case 'a': return checkKeyword(1, "nd", TOKEN_AND);
case 'c': return checkKeyword(1, "lass", TOKEN_CLASS);
case 'b': return checkKeyword(1, "lock", TOKEN_BLOCK);
case 'd': return checkKeyword(1, "ef", TOKEN_DEF);
case 'e': return checkKeyword(1, "lse", TOKEN_ELSE);
case 'f': return checkKeyword(1, "or", TOKEN_FOR);

View File

@ -36,7 +36,6 @@ typedef enum {
TOKEN_INDENTATION,
TOKEN_BLOCK, /* temporary XXX remove me */
TOKEN_RETRY,
TOKEN_EOL,