[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] Insert variable into tangled source code
From: |
Sebastien Vauban |
Subject: |
Re: [O] Insert variable into tangled source code |
Date: |
Tue, 06 Aug 2013 15:57:24 +0200 |
User-agent: |
Gnus/5.130006 (Ma Gnus v0.6) Emacs/24.3.50 (windows-nt) |
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