From c2bef96b7f644c05be5a38cad6ad1d28723533aa Mon Sep 17 00:00:00 2001 From: Dan Davison Date: Thu, 23 Jul 2009 22:32:03 -0400 Subject: [PATCH] Fix parser bug. --- lisp/org-babel-ref.el | 4 ++-- org-babel.org | 18 ++++++++++++++++-- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/lisp/org-babel-ref.el b/lisp/org-babel-ref.el index 6ec362c1e..182934f72 100644 --- a/lisp/org-babel-ref.el +++ b/lisp/org-babel-ref.el @@ -156,8 +156,8 @@ return nil." (when (= depth 0) (setq return (reverse (cons (substring buffer 0 -1) return))) (setq buffer ""))) - ((string= holder "(") (setq depth (+ 1 depth))) - ((string= holder ")") (setq depth (- 1 depth))))) + ((string= holder "(") (setq depth (+ depth 1))) + ((string= holder ")") (setq depth (- depth 1))))) (reverse (cons buffer return)))) (defun org-babel-ref-at-ref-p () diff --git a/org-babel.org b/org-babel.org index 7d69336ba..2b0f2bbd1 100644 --- a/org-babel.org +++ b/org-babel.org @@ -2798,13 +2798,27 @@ arg : 105 -**** TODO Nesting problem II +**** DONE Nesting problem II This generates parsing errors #+srcname: deeply-nested-args-bug-II-1() -#+begin_src python :var arg=adder(a=adder(a=one(),b=adder(a=1,b=4))) +#+begin_src python :var arg=adder(a=adder(a=one(),b=adder(a=2,b=4))) arg #+end_src +#+resname: deeply-nested-args-bug-II-1 + +: 106 + +#+srcname: deeply-nested-args-bug-II-original() +#+begin_src python :var arg=adder(a=adder(a=one(),b=one()),b=adder(a=one(),b=adder(a=1,b=4))) +arg +#+end_src + +#+resname: deeply-nested-args-bug-II-original +: 8 + + + **** DONE Why does this give 8? It was picking up the wrong definition of adder