Nim/compiler
Zahary Karadjov 0b197ade6c Multiple C lines corresponding to a single nimrod line are joined together
This patch greatly improves the "step over" operation available in debuggers.
In practice, there are often 4-8 lines of C code generated for each nimrod line
Each such line will be responsible to a single step in the debugger that is
a) not expected by the user
b) taking the user to an incorrect line in the nimrod code

To keep this working, all code generation should use the rope formatting
facilities when producing new lines (i.e. $n and $N).
New semantics for the format string are introduced:
$n means "soft new line" that could be joined/broken when lineDir is enabled.
$N means "hard new line" that will always appear as a new line.

As an alternative to this approach, I also tested producing code like this:
#line "code.nim" 154
foo = bar; \
foo(bar) \

This is better for readability of the final output, but unfortunately it didn't
produce the desired result across all compilers/debuggers.
2011-09-20 14:11:06 +03:00
..
c2nim c2nim,pas2nim: use the stdout.writeln to display the "unknown option" message 2011-07-29 20:21:29 +09:00
pas2nim c2nim,pas2nim: use the stdout.writeln to display the "unknown option" message 2011-07-29 20:21:29 +09:00
ast.nim bugfixes for generics; new threads implementation still broken 2011-09-20 00:56:48 +02:00
astalgo.nim bugfixes for generics; new threads implementation still broken 2011-09-20 00:56:48 +02:00
bitsets.nim big repo cleanup 2011-04-12 01:13:42 +02:00
ccgexprs.nim Multiple C lines corresponding to a single nimrod line are joined together 2011-09-20 14:11:06 +03:00
ccgstmts.nim Multiple C lines corresponding to a single nimrod line are joined together 2011-09-20 14:11:06 +03:00
ccgthreadvars.nim preparations for 0.8.12 2011-07-10 15:48:13 +02:00
ccgtypes.nim Multiple C lines corresponding to a single nimrod line are joined together 2011-09-20 14:11:06 +03:00
ccgutils.nim Nimrod can now compile itself with --lineDir enabled 2011-09-20 14:11:06 +03:00
cgen.nim Multiple C lines corresponding to a single nimrod line are joined together 2011-09-20 14:11:06 +03:00
cgmeth.nim preparation for new 'is' operator; breaks bootstrapping again, sorry (use generated C code) 2011-07-31 00:21:32 +02:00
charsets.nim big repo cleanup 2011-04-12 01:13:42 +02:00
commands.nim documentation for --nimcache option 2011-08-19 01:52:14 +02:00
condsyms.nim added system.slurp for easy embedding of resources 2011-08-10 00:43:58 +02:00
crc.nim gc tweaking to gain a few percent of performance 2011-05-07 22:13:24 +02:00
depends.nim big repo cleanup 2011-04-12 01:13:42 +02:00
docgen.nim support for C++ code generation; importcpp and importobjc pragmas 2011-08-07 21:02:09 +02:00
ecmasgen.nim finally got rid of nkPassAsOpenArray 2011-08-16 08:56:53 +02:00
evals.nim small bugfix for eval 2011-08-19 09:07:23 +02:00
extccomp.nim cleaned up the tests; fixes #30; fixes #26 2011-05-01 20:11:55 +02:00
filter_tmpl.nim deprecated system.copy: use system.substr instead 2011-05-14 01:13:44 +02:00
filters.nim got rid of some arcane module names 2011-04-21 00:54:44 +02:00
highlite.nim got rid of nstrtabs and nhashes modules 2011-06-10 22:49:06 +02:00
idents.nim got rid of nstrtabs and nhashes modules 2011-06-10 22:49:06 +02:00
importer.nim intsets are now a proper module and part of the stdlib 2011-06-14 01:36:49 +02:00
lexbase.nim big repo cleanup 2011-04-12 01:13:42 +02:00
lexer.nim support for C++ code generation; importcpp and importobjc pragmas 2011-08-07 21:02:09 +02:00
lists.nim bugfix: 'final' not passed to generic 2011-07-29 01:25:05 +02:00
llstream.nim deprecated system.copy: use system.substr instead 2011-05-14 01:13:44 +02:00
llvmgen.nim bugfixes; step one for 'var T' as return type support 2011-07-28 00:53:52 +02:00
llvmtype.nim big repo cleanup 2011-04-12 01:13:42 +02:00
lookups.nim support for C++ code generation; importcpp and importobjc pragmas 2011-08-07 21:02:09 +02:00
magicsys.nim got rid of nstrtabs and nhashes modules 2011-06-10 22:49:06 +02:00
main.nim added system.slurp for easy embedding of resources 2011-08-10 00:43:58 +02:00
msgs.nim Multiple C lines corresponding to a single nimrod line are joined together 2011-09-20 14:11:06 +03:00
nimconf.nim lexer, parser cleanup; boehm gc for mac os x 2011-05-17 21:14:30 +02:00
nimrod.cfg big repo cleanup 2011-04-12 01:13:42 +02:00
nimrod.dot big repo cleanup 2011-04-12 01:13:42 +02:00
nimrod.ini support for C++ code generation; importcpp and importobjc pragmas 2011-08-07 21:02:09 +02:00
nimrod.nim Nimrod can now compile itself with --lineDir enabled 2011-09-20 14:11:06 +03:00
nimsets.nim got rid of some arcane module names 2011-04-21 00:54:44 +02:00
nversion.nim first steps to explicit channels for thread communication; added mainThreadId 2011-07-16 18:34:18 +02:00
options.nim implemented --nimcache config option; big clean up of magic words 2011-08-19 01:46:24 +02:00
parsecfg.nim big repo cleanup 2011-04-12 01:13:42 +02:00
parser.nim preparation for new 'is' operator; breaks bootstrapping again, sorry (use generated C code) 2011-07-31 00:21:32 +02:00
passaux.nim big repo cleanup 2011-04-12 01:13:42 +02:00
passes.nim further improvements for thread analysis 2011-06-13 20:57:49 +02:00
pbraces.nim got rid of some arcane module names 2011-04-21 00:54:44 +02:00
pendx.nim got rid of some arcane module names 2011-04-21 00:54:44 +02:00
platform.nim first steps to thread local heaps 2011-06-02 13:02:40 +02:00
pragmas.nim bugfixes for generics; new threads implementation still broken 2011-09-20 00:56:48 +02:00
procfind.nim big repo cleanup 2011-04-12 01:13:42 +02:00
readme.txt big repo cleanup 2011-04-12 01:13:42 +02:00
renderer.nim finally got rid of nkPassAsOpenArray 2011-08-16 08:56:53 +02:00
rodread.nim doc improvements; added lazarus example 2011-07-24 23:07:40 +02:00
rodutils.nim big repo cleanup 2011-04-12 01:13:42 +02:00
rodwrite.nim support for C++ code generation; importcpp and importobjc pragmas 2011-08-07 21:02:09 +02:00
ropes.nim Multiple C lines corresponding to a single nimrod line are joined together 2011-09-20 14:11:06 +03:00
rst.nim bugfixes; added events module, sequtils module 2011-07-26 00:46:41 +02:00
sem.nim bugfixes for generics; new threads implementation still broken 2011-09-20 00:56:48 +02:00
semcall.nim bugfix: proper cache for generic instantiations 2011-07-21 00:57:39 +02:00
semdata.nim bugfix: proper cache for generic instantiations 2011-07-21 00:57:39 +02:00
semexprs.nim bugfixes for generics; new threads implementation still broken 2011-09-20 00:56:48 +02:00
semfold.nim finally got rid of nkPassAsOpenArray 2011-08-16 08:56:53 +02:00
semgnrc.nim bugfixes for semantic checking; thread implementation pushed the compiler 2011-06-04 02:56:55 +02:00
seminst.nim bugfixes for generics; new threads implementation still broken 2011-09-20 00:56:48 +02:00
semstmts.nim bugfixes for generics; new threads implementation still broken 2011-09-20 00:56:48 +02:00
semtempl.nim finally got rid of nkPassAsOpenArray 2011-08-16 08:56:53 +02:00
semthreads.nim finally got rid of nkPassAsOpenArray 2011-08-16 08:56:53 +02:00
semtypes.nim bugfixes for generics; new threads implementation still broken 2011-09-20 00:56:48 +02:00
semtypinst.nim bugfixes for generics; new threads implementation still broken 2011-09-20 00:56:48 +02:00
sigmatch.nim bugfixes for generics; new threads implementation still broken 2011-09-20 00:56:48 +02:00
suggest.nim attempt to improve 'suggest' feature 2011-07-30 15:19:58 +02:00
syntaxes.nim deprecated system.copy: use system.substr instead 2011-05-14 01:13:44 +02:00
tccgen.nim big repo cleanup 2011-04-12 01:13:42 +02:00
transf.nim implemented --nimcache config option; big clean up of magic words 2011-08-19 01:46:24 +02:00
trees.nim bugfix: proper cache for generic instantiations 2011-07-21 00:57:39 +02:00
treetab.nim got rid of nstrtabs and nhashes modules 2011-06-10 22:49:06 +02:00
types.nim bugfixes for generics; new threads implementation still broken 2011-09-20 00:56:48 +02:00
wordrecg.nim 'pure' is now 'noStackFrame' for procs 2011-08-19 19:11:58 +02:00

This directory contains the Nimrod compiler written in Nimrod. Note that this
code has been translated from a bootstrapping version written in Pascal, so
the code is **not** a poster child of good Nimrod code.