Re: [O] Insert variable into tangled source code
Sebastien Vauban writes: > > First, x[0,1] can't be resolved (unlike tab_x[0,1]). > > For the rest, I'd guess you must add the proper replacemen "method" for > `own_lang'. Is this the case? > > I mean: depending on the Babel language, variables must or must not be > prefixed by a $ sign to be replaced in the code block. For example, in Emacs > Lisp, you won't prefix vars with $. > > Maybe have a look at `sh' or `sql' Babel languages for inspiration. > > Best regards, > Seb > Thank you very much!!! I've just adapted the SQL expand variable function in ob-sql.el to my language and it works perfectly! Best regards. Roland.
Re: [O] Insert variable into tangled source code
Roland wrote: > I use orgmode to write code in a IA language developped by the company I > work for. Everything was just nice when I attempted to insert in the source > code a value set up in my org buffer. > > Here is the real situation : > > #+TBLNAME: tab_x > | x | 1 | > #+begin_src own_lang :tangle ./tangle_file :var x=x[0,1] > TYPE OBJ; > > CONSTANTE > var_x DOMAIN INTEGER DEFAULT $x > #+end_src > > and I would except in tangle_file : > TYPE OBJ; > > CONSTANTE > var_x DOMAIN INTEGER DEFAULT 1 > > But unfortunately, I get > TYPE OBJ; > > CONSTANTE > var_x DOMAIN INTEGER DEFAULT $x > > Any ideas??? First, x[0,1] can't be resolved (unlike tab_x[0,1]). For the rest, I'd guess you must add the proper replacemen "method" for `own_lang'. Is this the case? I mean: depending on the Babel language, variables must or must not be prefixed by a $ sign to be replaced in the code block. For example, in Emacs Lisp, you won't prefix vars with $. Maybe have a look at `sh' or `sql' Babel languages for inspiration. Best regards, Seb -- Sebastien Vauban
[O] Insert variable into tangled source code
Hello! I use orgmode to write code in a IA language developped by the company I work for. Everything was just nice when I attempted to insert in the source code a value set up in my org buffer. Here is the real situation : #+TBLNAME: tab_x | x | 1 | #+begin_src own_lang :tangle ./tangle_file :var x=x[0,1] TYPE OBJ; CONSTANTE var_x DOMAIN INTEGER DEFAULT $x #+end_src and I would except in tangle_file : TYPE OBJ; CONSTANTE var_x DOMAIN INTEGER DEFAULT 1 But unfortunately, I get TYPE OBJ; CONSTANTE var_x DOMAIN INTEGER DEFAULT $x Any ideas??? Thanks in advance. Roland.