- (setq state
- (or (its-get-next-state state (aref input i))
- (if build-if-none
- (let ((keyseq (substring input 0 (1+ i))))
- (its-make-next-state state (aref input i) keyseq keyseq))
- (error "No such state (%s)" input)))
- i (1+ i)))
+ (setq its-parent-states (cons state its-parent-states)
+ key (aref input i)
+ i (1+ i)
+ next-state (its-get-next-state state key))
+ (cond
+ (next-state
+ (setq state next-state))
+ ((null build-if-none)
+ (error "No such state (%s)" input))
+ (t
+ (if (not (or brand-new (= i 1) (its-get-kst/t state)))
+ (its-set-interim-terminal-state state))
+ (setq state (its-make-next-state state key
+ (concat (its-get-output state)
+ (list key)))
+ brand-new t))))
+ (if (and (eq build-if-none 'dup-check) (null brand-new))
+ (error "Duplicated definition (%s)" input))