RPA Toolkit
Fixed REX_DFA_NEXT macro.
[rpatk.git] / rex / doc / example / tokenjs.rexcc
index 1c2d7c8..66a8a74 100644 (file)
@@ -58,7 +58,8 @@ int get_token(wint_t *buffer, int size)
        wint_t wc;
        
        while ((wc = fgetwc(stdin)) != WEOF) {
-               if ((nstate = REX_DFA_NEXT(dfa, nstate, wc)) == REX_DFA_DEADSTATE) {
+               REX_DFA_NEXT(dfa, nstate, wc, &nstate);
+               if (nstate == REX_DFA_DEADSTATE) {
                        ungetc(wc, stdin);
                        break;
                }