There's a slight problem with parentheses - the args-out-of-range error
handler is outside the condition case right now. Once I fixed that it worked
fine and displayed the "wisent-parse-max-stack-size might need to be
increased" message.
Thanks.
Suraj
PS: Here's the amended patch.
*** semantic-wisent.el 2005-10-02 18:38:17.000000000 +0200
--- semantic-wisent.el.new 2006-12-15 13:49:07.000000000 +0100
***************
*** 220,229 ****
;; Parse
(setq wisent-lex-istream stream
cache (semantic-safe "wisent-parse-stream: %s"
! (wisent-parse semantic--parse-table
! wisent-lexer-function
! wisent-error-function
! goal)))
;; Manage returned lookahead token
(if wisent-lookahead
(if (eq (caar la-elt) wisent-lookahead)
--- 220,240 ----
;; Parse
(setq wisent-lex-istream stream
cache (semantic-safe "wisent-parse-stream: %s"
! (condition-case error-to-filter
! (wisent-parse semantic--parse-table
! wisent-lexer-function
! wisent-error-function
! goal)
! (args-out-of-range
! (if (and (not debug-on-error)
! (= wisent-parse-max-stack-size
! (nth 2 error-to-filter)))
! (progn
! (message "wisent-parse-stream: %s"
! (error-message-string
error-to-filter))
! (message "wisent-parse-max-stack-size \
! might need to be increased"))
! (apply 'signal error-to-filter))))))
;; Manage returned lookahead token
(if wisent-lookahead
(if (eq (caar la-elt) wisent-lookahead)
On 12/15/06, David PONCE <david.ponce@...> wrote:
>
> Hi Suraj,
>
> > I've editing a java source file with a fairly large method earlier today
> > and noticed that parsing of the file was silently failing. Well, there
> > was a line like this in the messages buffer:
> >
> > wisent-parse-stream: #<buffer TTY.java> - Args out of range: [... large
> > array with 500 elements...], 500
> >
> > but I didn't notice it show up in the minibuffer, probably because it
> > was very long.
> >
> > I managed to figure out that I needed to increase
> > wisent-parse-max-stack-size, the default value of which is 500, by
> > turning on debug-on-error and looking at the source for wisent-parse but
> > the initial error message was not very useful.
> >
> > David, would it make possible to catch the args-out-of-range exception
> > in wisent-parse-stream and have the error message say something useful
> > about modifying wisent-parse-max-stack-size instead ?
>
> Could you please try the following patch to semantic-wisent.el?
> Does it seem useful?
>
> Thanks!
>
> David
>
> *** semantic-wisent.el 2005-10-02 18:38:17.000000000 +0200
> --- semantic-wisent.el.new 2006-12-15 13:49:07.000000000 +0100
> ***************
> *** 220,229 ****
> ;; Parse
> (setq wisent-lex-istream stream
> cache (semantic-safe "wisent-parse-stream: %s"
> ! (wisent-parse semantic--parse-table
> ! wisent-lexer-function
> ! wisent-error-function
> ! goal)))
> ;; Manage returned lookahead token
> (if wisent-lookahead
> (if (eq (caar la-elt) wisent-lookahead)
> --- 220,240 ----
> ;; Parse
> (setq wisent-lex-istream stream
> cache (semantic-safe "wisent-parse-stream: %s"
> ! (condition-case error-to-filter
> ! (wisent-parse semantic--parse-table
> ! wisent-lexer-function
> ! wisent-error-function
> ! goal))
> ! (args-out-of-range
> ! (if (and (not debug-on-error)
> ! (= wisent-parse-max-stack-size
> ! (nth 2 error-to-filter)))
> ! (progn
> ! (message "wisent-parse-stream: %s"
> ! (error-message-string
> error-to-filter))
> ! (message "wisent-parse-max-stack-size \
> ! might need to be increased"))
> ! (apply 'signal error-to-filter)))))
> ;; Manage returned lookahead token
> (if wisent-lookahead
> (if (eq (caar la-elt) wisent-lookahead)
>
>
|