[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: C preprocessor style #line support
- From: Joshua Jensen <josh.jjensen@...>
- Date: Sat, 27 Aug 2011 16:37:27 -0600
----- Original Message -----
Date: 8/25/2011 6:02 PM
I could (and have the Lua module mcpp to help me do this). However,
this doesn't allow easy lookup of a symbol's value in the debugger. For
the above, I can see what MY_DEFINE is as I am stepping over the line.
On Thu, Aug 25, 2011 at 17:18, Luiz Henrique de Figueiredo
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"
#line 2 "fileB.lua"
You could actually run Lua files through the C preprocessor for true
Of course, #include is a worse problem, as line numbers will be off for
#define for expansion of source code is really convenient at times.
Using the technique Luiz shows in the other email could ameliorate the
line numbering problem.
Anyway, I may have to use a full preprocessor anyway. I was just hoping
to use an all Lua technique that would allow for symbol resolution.