void SglExprLex::updateState() { switch (lastScanResult.type) { case HEXTAG: radix += 8; // fall through case OCTTAG: radix += 6; // fall through case BINTAG: radix -= 8; // fall through case DECTAG: case CMPLTAG: case DECSEQ: case HEXSEQ: case OCTSEQ: case BINSEQ: if (state != stScale) state = stNumber; break; case DOT: state = stNumber; break; case DECSCALE: case SCALE: state = stScale; break; case SIGN: case GROUPCHAR: break; case leaveState: case TEXT: state = stTopLevel; break; case sot: state = stText; // fall through case OPENPAR: closePar.push( checkEscape(lastScanResult.symbol->asOpen()->closeToken())); //fall through default: if ( state != stScale && state != stText ) state = stTopLevel; } }
void visit(DotVarExp *e) { Type *t1b = e->e1->type->toBasetype(); if (t1b->ty == Tclass) result |= checkEscape(sc, e->e1, gag); else e->e1->accept(this); }
//Game Loop bool ce_game::start_game(){ //Create the tick timer functions LOCK_VARIABLE(ticks); LOCK_FUNCTION(ticker); install_int_ex(ticker, BPS_TO_TIMER(fps)); //----------GameLoop---------- while (isPlaying || end_timer > 0 || start_timer > 0){ //Wait until a tick has happened while(ticks == 0){ rest(1); } //If there is a tick pending update the logic and remve the tick while(ticks > 0){ //Do game logic or decriment end/start timers if (isPlaying){ checkEscape(); update(); checkState(); }else if (start_timer >= 0){ if (start_timer == 0){ isPlaying = true; start_timer = -1; }else{ start_timer--; } }else{ end_timer--; } ticks--; } //Draw game or start/end screens if (start_timer > 0){ drawStart(); }else if (isPlaying || end_timer > 150){ draw(); }else{ drawEnd(); } } return hasWon; }
void visit(PtrExp *e) { result |= checkEscape(sc, e->e1, gag); }