X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=Usermode%2FLibraries%2Flibspiderscript.so_src%2Flex.c;h=bb86198dc0e1021be0dfb2e7863912d2aff10bd3;hb=a4aa24536a1748c8ace1ef7abdc01108da417856;hp=be3a15b4d63b0dc12e675df2a504bb864f1af7b5;hpb=9b714e5ea3767470ab5c35f14da67bcb97275021;p=tpg%2Facess2.git diff --git a/Usermode/Libraries/libspiderscript.so_src/lex.c b/Usermode/Libraries/libspiderscript.so_src/lex.c index be3a15b4..bb86198d 100644 --- a/Usermode/Libraries/libspiderscript.so_src/lex.c +++ b/Usermode/Libraries/libspiderscript.so_src/lex.c @@ -7,10 +7,6 @@ #include #include -// Make the scope character ('.') be a symbol, otherwise it's just -// a ident character -#define USE_SCOPE_CHAR 0 - #define DEBUG 0 #define ARRAY_SIZE(x) ((sizeof(x))/(sizeof((x)[0]))) @@ -29,6 +25,8 @@ const struct { {TOK_RWD_FUNCTION, "function"}, {TOK_RWD_RETURN, "return"}, + {TOK_RWD_BREAK, "break"}, + {TOK_RWD_CONTINUE, "continue"}, {TOK_RWD_NEW, "new"}, {TOK_RWD_IF, "if"}, @@ -37,6 +35,7 @@ const struct { {TOK_RWD_WHILE, "while"}, {TOK_RWD_FOR, "for"}, + {TOK_RWD_NULL, "null"}, {TOK_RWD_VOID, "void"}, {TOK_RWD_OBJECT, "Object"}, {TOK_RWD_OPAQUE, "Opaque"}, @@ -306,7 +305,8 @@ int GetToken(tParser *File) if( isdigit(*File->CurPos) ) { ret = TOK_INTEGER; - if( *File->CurPos == '0' && File->CurPos[1] == 'x' ) { + if( *File->CurPos == '0' && File->CurPos[1] == 'x' ) + { File->CurPos += 2; while(('0' <= *File->CurPos && *File->CurPos <= '9') || ('A' <= *File->CurPos && *File->CurPos <= 'F') @@ -315,10 +315,13 @@ int GetToken(tParser *File) File->CurPos ++; } } - else { + else + { while( isdigit(*File->CurPos) ) File->CurPos ++; +// printf("*File->CurPos = '%c'\n", *File->CurPos); + // Decimal if( *File->CurPos == '.' ) { @@ -337,6 +340,8 @@ int GetToken(tParser *File) while( isdigit(*File->CurPos) ) File->CurPos ++; } + +// printf(" ret = %i\n", ret); } break; }