Nim/compiler
Adam Strzelecki 13b57dbc2f Introduce {.noRewrite.} expr pragma disabling TR
Term rewriting macros/templates are currently greedy and they will rewrite as
long as there is a match. So there was no way to ensure some rewrite happens
only once, eg. when rewriting term to same term plus extra content.

With new macro we can actually prevent further rewriting on marked expr or
stmts, eg. with given example echo(...) will be rewritten just once:

  template pwnEcho{echo(x)}(x: expr) =
    {.noRewrite.}: echo("pwned!")

  echo "ab"
2015-06-02 21:38:53 +02:00
..
nimfix Fixed the paths of nimfix and nimsuggest to be relative. 2015-04-25 12:07:35 -06:00
nimsuggest now nimsuggest works on the first sug 2015-05-24 17:47:51 -05:00
plugins system.locals is now a plugin for education 2015-04-24 02:08:06 +02:00
aliases.nim updated the compiler to use the new symbol names 2014-08-28 23:48:42 +02:00
ast.nim Introduce {.noRewrite.} expr pragma disabling TR 2015-06-02 21:38:53 +02:00
astalgo.nim Get rid of deprecation warnings 2015-04-07 15:47:18 +02:00
bitsets.nim Nimrod renamed to Nim 2014-08-28 09:38:14 +02:00
canonicalizer.nim compiler_ropes: ropeToStr -> $ 2015-04-01 22:32:15 +08:00
ccgcalls.nim importing of C++ nested generics like std::vector<T>::iterator, using the apostrophe operator 2015-04-13 23:49:41 +03:00
ccgexprs.nim fixes 'echo nil' codegen bug 2015-05-03 01:08:51 +02:00
ccgmerge.nim Get rid of deprecation warnings 2015-04-07 15:47:18 +02:00
ccgstmts.nim fixes #1888 2015-04-27 23:11:59 +02:00
ccgthreadvars.nim Get rid of deprecation warnings 2015-04-07 15:47:18 +02:00
ccgtrav.nim Get rid of deprecation warnings 2015-04-07 15:47:18 +02:00
ccgtypes.nim fixes #2470, fixes #1354 2015-04-28 20:21:53 +02:00
ccgutils.nim fixes #2551; fixes #2212; breaks bootstrapping in debug mode; bootstrap with -d:release 2015-04-25 23:16:57 +02:00
cgen.nim Implicitly assume compilers to know naked and noreturn attributes 2015-05-07 22:31:45 +02:00
cgendata.nim Get rid of deprecation warnings 2015-04-07 15:47:18 +02:00
cgmeth.nim Merge branch 'devel' into bigbreak 2014-11-03 22:50:55 +01:00
commands.nim Add path directive to allow inclusion of config file's path itself 2015-05-14 12:52:43 -07:00
condsyms.nim fixes #2569 2015-04-23 23:49:10 +02:00
crc.nim Nimrod renamed to Nim 2014-08-28 09:38:14 +02:00
depends.nim Get rid of deprecation warnings 2015-04-07 15:47:18 +02:00
docgen.nim Get rid of tkUnderscore. Map _ to tkSymbol. 2015-04-08 20:08:45 +01:00
docgen2.nim Nimrod renamed to Nim 2014-08-28 09:38:14 +02:00
evaltempl.nim fixes #1940; code breakage! stricter template evaluation 2015-03-07 15:43:36 +01:00
extccomp.nim Merge pull request #2657 from def-/noreturn 2015-05-08 02:08:32 +02:00
filter_tmpl.nim Replaced deprecated repeatChar() with repeat() or spaces(). 2015-03-04 03:30:43 +01:00
filters.nim Nimrod renamed to Nim 2014-08-28 09:38:14 +02:00
forloops.nim minor documentation updates 2015-02-16 02:56:40 +01:00
guards.nim sempass2: bugfixes 2015-04-28 15:01:05 +02:00
hlo.nim Nimrod renamed to Nim 2014-08-28 09:38:14 +02:00
idents.nim nimsuggest: first version 2015-01-27 01:36:19 +01:00
idgen.nim Nimrod renamed to Nim 2014-08-28 09:38:14 +02:00
importer.nim prepare for upcoming parsing change of unary operators 2015-03-22 09:31:15 +01:00
installer.ini Ship all testdata with dist 2015-05-26 15:46:57 +03:00
jsgen.nim Fixes #2798 2015-05-26 16:00:48 +03:00
jstypes.nim Get rid of deprecation warnings 2015-04-07 15:47:18 +02:00
lambdalifting.nim first implementation of overloading of '='; missing: rewriting let/var sections 2015-04-06 23:21:51 +02:00
lexer.nim cleanups for underscores in tuple unpacking 2015-04-24 13:08:42 +02:00
lists.nim Nimrod renamed to Nim 2014-08-28 09:38:14 +02:00
llstream.nim Make reading from stdin work again. 2015-03-01 00:16:46 +01:00
lookups.nim Rewrite in order to not introduce a new node kind. 2015-04-05 15:46:56 +01:00
lowerings.nim system.locals is now a plugin for education 2015-04-24 02:08:06 +02:00
magicsys.nim implemented 'guard' annotation 2014-09-21 18:39:00 +02:00
main.nim Clean up stdin file reading of compiler. 2015-05-16 12:38:53 +02:00
modules.nim Use gProjectIsStdin instead 2015-05-17 16:10:46 +02:00
msgs.nim finishes #2566 2015-04-24 12:44:14 +02:00
nim.nim Use gProjectIsStdin instead 2015-05-17 16:10:46 +02:00
nim.nim.cfg fixed the tester; more tests green 2015-03-10 12:32:48 +01:00
nimblecmd.nim Fix typos 2015-02-15 16:20:32 +00:00
nimconf.nim Merge pull request #2058 from def-/nimrod-cfgs 2015-02-07 18:11:00 +01:00
nimeval.nim Make nimeval compile 2015-01-12 23:04:53 +01:00
nimlexbase.nim Replaced deprecated repeatChar() with repeat() or spaces(). 2015-03-04 03:30:43 +01:00
nimsets.nim Nimrod renamed to Nim 2014-08-28 09:38:14 +02:00
nodejs.nim Move lib/pure/nodejs to compiler/nodejs. Ref #2017. 2015-01-28 14:58:31 +00:00
nversion.nim Happy new year! 2015-01-06 15:26:33 +01:00
options.nim Use gProjectIsStdin instead 2015-05-17 16:10:46 +02:00
parampatterns.nim fix #2585 properly 2015-04-22 20:33:06 +02:00
parser.nim fixes #2533 2015-04-24 12:36:41 +02:00
passaux.nim Nimrod renamed to Nim 2014-08-28 09:38:14 +02:00
passes.nim Clean up stdin file reading of compiler. 2015-05-16 12:38:53 +02:00
patterns.nim Introduce {.noRewrite.} expr pragma disabling TR 2015-06-02 21:38:53 +02:00
pbraces.nim Nimrod renamed to Nim 2014-08-28 09:38:14 +02:00
platform.nim codegen doesn't produce line tracing commands anymore; fixes #1344 2015-03-21 20:38:27 +01:00
plugins.nim added '..^' and '..<' operators; 'nil' is allowed for 'len'; added plugin system to the compiler 2015-04-22 12:04:11 +02:00
pragmas.nim Introduce {.noRewrite.} expr pragma disabling TR 2015-06-02 21:38:53 +02:00
procfind.nim Fix #1561 2014-10-29 18:57:03 -04:00
readme.txt Nimrod renamed to Nim 2014-08-28 09:38:14 +02:00
renderer.nim Fixed renderer for asm node in JS 2015-05-28 10:23:09 +03:00
rodread.nim Get rid of deprecation warnings 2015-04-07 15:47:18 +02:00
rodutils.nim Nimrod renamed to Nim 2014-08-28 09:38:14 +02:00
rodwrite.nim compiler_ropes: ropeToStr -> $ 2015-04-01 22:32:15 +08:00
ropes.nim compiler_ropes: more lib_ropes porting 2015-04-08 23:30:03 +08:00
saturate.nim Nimrod renamed to Nim 2014-08-28 09:38:14 +02:00
sem.nim fixes #2470, fixes #1354 2015-04-28 20:21:53 +02:00
semasgn.nim overloading of '=' works 2015-04-06 23:21:52 +02:00
semcall.nim fixes #2420; negative indexing for slicing is obsolete (breaking change!) 2015-03-28 00:15:04 +01:00
semdata.nim fixes #2585 2015-04-22 20:25:11 +02:00
semdestruct.nim fixes #2420; negative indexing for slicing is obsolete (breaking change!) 2015-03-28 00:15:04 +01:00
semexprs.nim fixes #2629, fixes #2641, fixes #2632, fixes #2630 2015-05-03 01:08:52 +02:00
semfields.nim fixes #2134 2015-02-20 20:01:25 +01:00
semfold.nim fixes #2629, fixes #2641, fixes #2632, fixes #2630 2015-05-03 01:08:52 +02:00
semgnrc.nim interpret tuple as a class and tuple[] as the empty tuple 2015-03-06 12:20:15 +13:00
seminst.nim fixes #2470, fixes #1354 2015-04-28 20:21:53 +02:00
semmacrosanity.nim fixes #2603 2015-04-26 22:44:05 +02:00
semmagic.nim system.locals is now a plugin for education 2015-04-24 02:08:06 +02:00
semparallel.nim disjoint checker works with the new countup iterators 2015-03-14 01:26:32 +01:00
sempass2.nim sempass2: bugfixes 2015-04-28 15:01:05 +02:00
semstmts.nim Introduce {.noRewrite.} expr pragma disabling TR 2015-06-02 21:38:53 +02:00
semtempl.nim don't store the scope for routines 2015-04-04 01:19:31 +02:00
semtypes.nim fixes #2607 2015-04-26 22:44:06 +02:00
semtypinst.nim fixes #2505, fixes #1853, fixes #2522 2015-04-20 21:25:49 +02:00
service.nim Make compiler read files from stdin 2015-02-22 23:23:22 +01:00
sigmatch.nim Fix #2662: Don't convert subtype typedesc params 2015-05-13 19:10:54 +02:00
suggest.nim changed from parseEnum to direct copy 2015-05-13 18:34:29 +05:00
syntaxes.nim nimsuggest: sane dirty buffer handling 2015-01-29 03:08:41 +01:00
tccgen.nim Nimrod renamed to Nim 2014-08-28 09:38:14 +02:00
testability.nim distinguish between 'defined' and 'declared' 2014-08-11 20:38:28 +02:00
transf.nim minor bugfixes to the new 'len(nil)==0' feature 2015-05-03 01:08:50 +02:00
trees.nim VM: minor fixes to make lexim work 2015-04-20 11:36:13 +02:00
treetab.nim tables work in 'const' sections; echo supports 'nil' strings; minor cleanups 2015-02-09 00:08:55 +01:00
types.nim fixes regression caused by code cleanups 2015-04-29 22:24:50 +02:00
typesrenderer.nim interpret tuple as a class and tuple[] as the empty tuple 2015-03-06 12:20:15 +13:00
vm.nim Update ast spec about uint literals 2015-05-18 21:34:26 +02:00
vmdef.nim marshalling can be done at compile-time 2015-04-25 23:17:00 +02:00
vmdeps.nim concept types are represented with getType() 2015-04-13 14:57:23 -05:00
vmgen.nim marshalling can be done at compile-time 2015-04-25 23:17:00 +02:00
vmhooks.nim Happy new year! 2015-01-06 15:26:33 +01:00
vmmarshal.nim marshalling can be done at compile-time 2015-04-25 23:17:00 +02:00
vmops.nim system.locals is now a plugin for education 2015-04-24 02:08:06 +02:00
wordrecg.nim Introduce {.noRewrite.} expr pragma disabling TR 2015-06-02 21:38:53 +02:00

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