Commit Graph

110 Commits

Author SHA1 Message Date
Adam Strzelecki
1d47617d1b Macros: Introduce getType(t: typedesc): NimNode
Since typedesc are exception in macros and they are not implicitly converted to
NimNode on macro call, we need some means to perform such conversion on demand.

Fortunately it is as simple as declaring new magic "NGetType" proc with
typedesc parameter.

NOTE: Keeping actual macro exceptional behavior for typedesc is important,
since it allows passing typedesc macro parameter to other procs or macros
expecting type parameter. If typedesc parameter was implicitly converted, then
we would lost this ability.
2015-05-17 15:28:41 +02:00
Araq
43eae0c113 macros: added bool literal support 2015-04-20 20:40:10 +02:00
Araq
2b4e233510 Merge branch 'devel' of https://github.com/Araq/Nim into devel 2015-04-20 11:44:54 +02:00
Araq
dc3a0bc009 added macros.newTree proc (why didn't we do this earlier?) 2015-04-20 11:34:18 +02:00
fowlmouth
f8917e8ad3 add ntys up to ntyNot 2015-03-28 03:19:48 -05:00
Araq
a541be8935 prepare for upcoming parsing change of unary operators 2015-03-22 09:31:15 +01:00
def
fd4e629905 Rename PNimrodNode to NimNode 2015-03-17 17:50:32 +01:00
Max Zerzouri
9c126282b2 interpret tuple as a class and tuple[] as the empty tuple
When the indentation syntax is allowed it is always interpreted as a
tuple:

type
  Unit = tuple
2015-03-06 12:20:15 +13:00
Chris Heller
0553758ebd Clone the implementation of cmpIgnoreStyle into macros.nim from typeinfo.nim so that we get rid of any imports in the core modules 2015-03-03 09:29:38 -08:00
Chris Heller
b54dfbce16 Remove use of .format() from macros.nim to avoid importing into core. There is still a remaining import of cmpIgnoreStyle from strutils that needs to be removed as well 2015-03-03 09:22:54 -08:00
Chris Heller
df7e388e0c Make macros.nim expectKind error message with a single TNimrodNodeKind consistent with error message shown with a set of TNimrodNodeKind by displaying the actual node kind (as well as the expected) 2015-03-02 17:02:43 -08:00
Araq
3bfcfeb0cf don't use stdout for nimsuggest server mode 2015-02-27 16:44:55 +01:00
Araq
975f33b01d disable deprecated warnings for macros module 2015-02-25 21:14:21 +01:00
Araq
752052e903 implements a type API for macros 2015-02-24 00:13:28 +01:00
Araq
1e6aef62ba macros.PNimrodNode is now NimNode 2015-02-24 00:13:27 +01:00
Federico Ceratto
c95f6f117a Fix typos 2015-02-15 16:06:06 +00:00
Araq
10335fd726 fixed minor bugs; cleaned up tests 2015-02-12 14:56:56 +01:00
dumndummer
9a1be7a9f3 Update macros.nim
minor doc comment spelling correction
2015-02-02 17:57:31 +00:00
Mason McGill
a6ce70bd8d Added a few AST-construction shortcuts. 2015-01-27 11:48:14 -08:00
Dominik Picheta
acc80aaedc macros.$ can now turn a nnkSym into a string. 2014-12-28 15:23:05 +00:00
Araq
e27ab36731 implements 'defer' 2014-12-04 10:12:32 +01:00
Araq
b2f577df23 fixes #1473 2014-11-12 02:36:59 +01:00
Araq
adad2d5f4a Merge branch 'devel' into bigbreak
Conflicts:
	lib/impure/db_postgres.nim
	lib/pure/json.nim
	lib/pure/math.nim
	lib/system/atomics.nim
2014-11-03 11:42:36 +01:00
Grzegorz Adam Hankiewicz
aa1fb9a07e Adds stringification support for nnkPostfix nodes. 2014-10-11 00:53:26 +02:00
Araq
4523b29d7a Nimrod renamed to Nim 2014-08-28 09:59:26 +02:00
Araq
d05df2173b Nimrod renamed to Nim 2014-08-28 09:50:51 +02:00
Araq
2f43fdb837 renamefest 2014-08-23 01:43:49 +02:00
Araq
8f5bf06528 fixes #1450 2014-08-14 02:55:04 +02:00
Araq
472190bedc fixes #1085 2014-04-21 00:04:36 +02:00
Araq
e6d17e6273 made large parts of the stdlib gcsafe 2014-04-20 20:01:24 +02:00
Araq
3e25d5f247 merged better html links #850 2014-04-08 01:19:15 +02:00
Zahary Karadjov
e8c50640d7 failing test case preventing the use of --gc:v2: tsymchoicefield 2014-03-24 12:17:22 +02:00
Zahary Karadjov
862c0ef83d split the inline and closure iterators into different symbol kinds for easier discrimination between them 2014-03-06 21:57:35 +02:00
Dominik Picheta
6a65d1c515 newProc can now be used to construct iterator defs. 2014-02-12 21:28:17 +00:00
Araq
99352c1e4c macro tests almost green 2014-02-03 17:35:03 +01:00
Araq
37229df7fc next steps for closure iterators 2014-01-22 17:32:38 +01:00
Araq
4a0aadef4d parser support anon iterators 2014-01-20 20:07:44 +01:00
Zahary Karadjov
afddae5aaf Merge branch 'upstream' into devel
Conflicts:
	compiler/ccgutils.nim
	compiler/msgs.nim
	compiler/sem.nim
	compiler/semexprs.nim
	compiler/seminst.nim
	compiler/semmagic.nim
	compiler/semstmts.nim
	compiler/semtypes.nim
	compiler/semtypinst.nim
	compiler/sigmatch.nim
	compiler/types.nim
	compiler/vmgen.nim
	lib/core/macros.nim
	lib/system.nim
	tests/reject/tenummix.nim
	web/news.txt
2013-12-29 17:21:00 +02:00
Araq
bf205fa85d case consistency part 6 2013-12-28 01:17:02 +01:00
Araq
b76729df1c Merge branch 'master' of https://github.com/Araq/Nimrod into vm2
Conflicts:
	web/news.txt
2013-12-23 01:23:16 +01:00
Andreas Rumpf
2f7119e9bb Merge pull request #764 from gradha/pr_doc_improvements
Documentation improvements
2013-12-20 13:02:44 -08:00
Grzegorz Adam Hankiewicz
7177e0f698 Adds docstring to macros.newIdentDefs. 2013-12-20 21:37:51 +01:00
Billingsly Wetherfordshire
f06c9a77b5 Update macros.nim 2013-12-20 14:23:13 -06:00
Zahary Karadjov
027f30610e static params: expr[T] is now static[T]
This introduces tyStatic and successfully bootstraps and handles
few simple test cases.  Static params within macros are no longer
treated as PNimrodNodes - they are now equivalent to constants
of the designated type.
2013-12-19 01:06:38 +02:00
Grzegorz Adam Hankiewicz
f46336ae8b Adds missing `code-block` to macros' docstrings. 2013-12-18 21:22:22 +01:00
Araq
5eba93d584 Merge branch 'master' into vm2
Conflicts:
	compiler/sem.nim
2013-12-05 00:03:27 +01:00
Araq
f10a23e669 removed 'system.eval' 2013-11-27 09:44:53 +01:00
Araq
b4e25a6372 new VM is getting stable 2013-10-29 01:07:59 +01:00
Araq
8b5aa221ad support for multiple modules of the same name; niminst supports 'platforms'; minor bugfixes 2013-09-24 16:07:07 +02:00
Araq
094d7fd4b1 added 'newLit' 2013-09-10 00:37:23 +02:00