[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: C preprocessor style #line support
- From: HyperHacker <hyperhacker@...>
- Date: Thu, 25 Aug 2011 18:02:37 -0600
On Thu, Aug 25, 2011 at 17:18, Luiz Henrique de Figueiredo
<lhf@tecgraf.puc-rio.br> wrote:
>> So I started thinking about how to coax Lua into doing this _and_ allow
>> a Lua debugger to still work.
>
>> It would be nice to feed this to Lua (or equivalent):
>>
>> #line 1 "fileA.lua"
>> local MY_DEFINE = 5
>> #line 2 "fileA.lua"
>> local YOUR_DEFINE = 10
>> #line 1 "fileB.lua"
>> print(MY_DEFINE)
>> #line 2 "fileB.lua"
>
>> Are there any fancy techniques to pull this off? Noticing the layout of
>> the Proto structure, I don't think there are. It seems to have only one
>> filename per Proto.
>
> That's the real problem. Line numbers are not hard. See
> http://lua-users.org/lists/lua-l/2005-06/msg00111.html
>
>
You could actually run Lua files through the C preprocessor for true
#define support.
--
Sent from my toaster.