diff --git a/nasal_dbg.h b/nasal_dbg.h index 2d2a197..88f529a 100644 --- a/nasal_dbg.h +++ b/nasal_dbg.h @@ -301,14 +301,12 @@ void nasal_dbg::run( ++count[code[pc]]; (this->*oprs[code[pc]])(); if(top>=canary) - break; + die("stack overflow"); ++pc; } #endif vmexit: - if(top>=canary) - die("stack overflow"); callsort(count); gc.clear(); imm.clear(); @@ -316,12 +314,14 @@ vmexit: return; #ifndef _MSC_VER #define dbg(op,num) {\ - interact();\ - op();\ - ++count[num];\ - if(top=text_size){ + token.content="eof"; + token.type=j_eof; + return; + } + + var c=text[ptr]; + if(c=='{'){ + token.content='{'; + token.type=j_lbrace; + }elsif(c=='}'){ + token.content='}'; + token.type=j_rbrace; + }elsif(c=='['){ + token.content='['; + token.type=j_lbracket; + }elsif(c==']'){ + token.content=']'; + token.type=j_rbracket; + }elsif(c==','){ + token.content=','; + token.type=j_comma; + }elsif(c==':'){ + token.content=':'; + token.type=j_colon; + }elsif(c=='\"' or c=='\''){ + var strbegin=c; + var s=""; + ptr+=1; + while(ptr=text_size){ - token.content="eof"; - token.type=j_eof; - return; - } - - var c=text[ptr]; - if(c=='{'){ - token.content='{'; - token.type=j_lbrace; - }elsif(c=='}'){ - token.content='}'; - token.type=j_rbrace; - }elsif(c=='['){ - token.content='['; - token.type=j_lbracket; - }elsif(c==']'){ - token.content=']'; - token.type=j_rbracket; - }elsif(c==','){ - token.content=','; - token.type=j_comma; - }elsif(c==':'){ - token.content=':'; - token.type=j_colon; - }elsif(c=='\"' or c=='\''){ - var strbegin=c; - var s=""; - ptr+=1; - while(ptr