wisent-production-bounds (in lisp/semantic/wisent/wisent.el) computes
the value for the $regioni variables in semantic actions when the region
covers a non-terminal.
It assumes regions are a simple cons (first . last), but the rest of the
wisent parser represents regions as a nested list ((first last)).
This code fixes that:
(defsubst wisent-production-bounds (stack i j)
"Determine the start and end locations of a production value.
Return a pair (START . END), where START is the first available start
location, and END the last available end location, in components
values of the rule currently reduced.
Return nil when no component location is available.
STACK is the parser stack.
I and J are the indices in STACK of respectively the value of the
first and last components of the current rule.
This function is for internal use by semantic actions' generated
lambda-expression."
(let ((f (caadr (aref stack i)))
(l (cadadr (aref stack j))))
(while (/= i j)
(cond
((not f)
;; item i is an empty production
(setq f (caadr (aref stack (setq i (+ i 2))))))
((not l)
;; item j is an empty production
(setq l (cadadr (aref stack (setq j (- j 2))))))
((setq i j))))
(and f l (list (list f l)))))
In GNU Emacs 24.2.91.1 (i386-mingw-nt6.1.7601)
of 2012-12-15 on MS-W7-DANI
Bzr revision: 111040 cyd <at> gnu.org-20121215141602-c4qmr11gc39rrpng
Windowing system distributor `Microsoft Corp.', version 6.1.7601
Nobody/Anonymous
None
None
Public
|
Date: 2013-02-02 06:13:31 PST It is always good to insist on an example! Attached file shows the |
| Field | Old Value | Date | By |
|---|---|---|---|
| close_date | - | 2013-02-02 06:13:31 PST | stephen_leake |
| allow_comments | 1 | 2013-02-02 06:13:31 PST | stephen_leake |
| status_id | Open | 2013-02-02 06:13:31 PST | stephen_leake |