Brian Candler wrote:
> Then it sounds like you just need to separate the blocks of code 
> appropriately. Do you want each line which begins with \w: (a labelled 
> line) to be treated specially? Then the rest of the code between the 
> labelled lines can be treated as a single string.
> 
> b = binding
> line = 1
> src.split(/^(\w+:.*)\n/).each do |chunk|
>   if chunk =~ /(\w+):(.*)$/
>     eval "label(#{$1.inspect}) { #{$2}\n }", b, "DSL", line
>     line += 1
>   else
>     eval chunk, b, "DSL", line
>     line += chunk.split("\n").size
>   end
> end

Damn, your solution was almost working well, but working on an external 
file, the "eval" loose the step in the code and i'm not able to go back 
to debug the dsl...
ok, i'm going probably to forgot about this option for now... i'll see 
later on how to do it.

Thanks again Brian.
-- 
Posted via http://www.ruby-forum.com/.