Prepare for string literal parsing
This commit is contained in:
parent
9ff658615b
commit
b384973379
|
@ -42,6 +42,7 @@ enum TokenTypes {
|
||||||
CMP_GTE, // =>
|
CMP_GTE, // =>
|
||||||
|
|
||||||
LI_INT, // Integer literal
|
LI_INT, // Integer literal
|
||||||
|
LI_STR, // String literal
|
||||||
LI_SEMIC, // ;
|
LI_SEMIC, // ;
|
||||||
|
|
||||||
LI_LBRAC, // {
|
LI_LBRAC, // {
|
||||||
|
|
|
@ -41,11 +41,11 @@ int ParseOptionalPointer() {
|
||||||
|
|
||||||
int Type;
|
int Type;
|
||||||
// TODO: THIS IS WRONG AND SHOULD NOT EXIST
|
// TODO: THIS IS WRONG AND SHOULD NOT EXIST
|
||||||
// TY_CHAR is 22, RET_CHAR is 1.
|
// TY_CHAR is 25, RET_CHAR is 1.
|
||||||
// Offset is 20. Rest are in order
|
// Offset is 20. Rest are in order
|
||||||
|
|
||||||
if(CurrentToken.type >= TY_CHAR && CurrentToken.type <= TY_VOID) {
|
if(CurrentToken.type >= TY_CHAR && CurrentToken.type <= TY_VOID) {
|
||||||
Type = CurrentToken.type - 23;
|
Type = CurrentToken.type - 24;
|
||||||
printf("\t\tConverting a %s token to a %s type.\n", TokenNames[CurrentToken.type], TypeNames[Type]);
|
printf("\t\tConverting a %s token to a %s type.\n", TokenNames[CurrentToken.type], TypeNames[Type]);
|
||||||
} else {
|
} else {
|
||||||
DieDecimal("Illegal type for pointerisation", CurrentToken.type);
|
DieDecimal("Illegal type for pointerisation", CurrentToken.type);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user