Commit Graph

3743 Commits

Author SHA1 Message Date
Araq
90db9171a2 compilation cache: various bugfixes; works for the compiler itself 2011-10-27 00:41:42 +02:00
Araq
9fb36bd20c compilation cache: mostly working; generics not yet 2011-10-25 15:26:36 +02:00
Araq
9fb97e24bf compilation cache: multi methods now work 2011-10-24 00:56:47 +02:00
Araq
a702524ae4 compilation cache: better dependency checking 2011-10-23 22:45:52 +02:00
Araq
627d33da08 compilation cache: small fixes; methods still not working 2011-10-23 21:39:02 +02:00
Araq
bd1cb9e77b compilation cache: methods have a chance to work 2011-10-23 11:24:52 +02:00
Araq
dce8d3d1ab rod files: next trivial examples working 2011-10-22 22:49:51 +02:00
Araq
235bd1c474 preparations for proper memmap'ed files 2011-10-22 11:08:52 +02:00
Araq
ded7f6a6d5 bugfix: nil -> emptyNode 2011-10-22 09:00:01 +02:00
Araq
182ab85dc8 trivial change scenario works with symbol files 2011-10-22 01:51:30 +02:00
Araq
ddbad192a4 got rid of gToTypeInfoId 2011-10-21 21:39:12 +02:00
Araq
d871cadbb3 got rid of gGeneratedSyms 2011-10-21 21:02:03 +02:00
Araq
43eace163a further steps for incremental C code generation 2011-10-21 19:07:01 +02:00
Araq
a6f90d4cdd first steps to C file merge operation for incremental compilation 2011-10-21 01:06:24 +02:00
Araq
7ebaf44897 bugfixes for ROD file generation; nimcache dir is now flat 2011-10-20 09:06:05 +02:00
Araq
69e0acb761 much more efficient rod file generation 2011-10-18 17:22:27 +02:00
Araq
4de84024e5 much more efficient rod file generation 2011-10-18 17:21:51 +02:00
Araq
51e01879ba 'bind' as a declarative statement 2011-10-10 02:04:15 +02:00
Araq
c138cc36b4 new syntactic construct: a{i} 2011-10-08 02:14:42 +02:00
Araq
e956abbadd slurp uses path; unidecode is improved and threadsafe 2011-10-08 01:17:06 +02:00
Zahary Karadjov
e3deb5b502 Cleaned up the circular dependecies and remaining issues
Changed: The []= operator for strings and sequences is now capable of splicing
2011-10-07 17:10:04 +03:00
Zahary Karadjov
22546c44d1 Basic unit testing facilities (suites, fixtures, cases)
Added: PNimrodNode.lineinfo for better error messages from macros
Added: seq.splice

For easier use from templates and macros, except stament now supports
the list of exception types to be supplied in nkBraket node (array literal).
2011-10-07 17:07:18 +03:00
Zahary Karadjov
eaeed1f846 getAst works correctly with existing AST values as template/macro arguments 2011-10-07 17:05:54 +03:00
Araq
42516c0086 code generator supports constant sequences; more consistent compile time evaluation 2011-10-07 09:02:08 +02:00
Araq
e9b7d5e68e c2nim: bugfix: parsing of typedef'ed function pointers 2011-09-28 00:41:40 +02:00
Araq
da6046dcba bugfix: overloading resolution for typeof 2011-09-27 00:27:51 +02:00
Araq
14968fba46 bugfix: internal error in evalFieldAccess; parseutils.interpolatedFragments optimized; tstringinterp.nim now works 2011-09-26 00:24:06 +02:00
Araq
485c371942 renamed optional to discardable 2011-09-24 19:18:08 +02:00
Araq
72ceda98cb implemented optional pragma for implicit discard 2011-09-24 13:55:24 +02:00
Araq
033e3dfc50 l-values are preserved modulo type distinction 2011-09-24 13:15:11 +02:00
Araq
92543a3037 more fixes to get rid of tyPureObject 2011-09-24 11:50:46 +02:00
Araq
98e5beb936 got rid of akPureObject 2011-09-24 10:57:35 +02:00
Araq
ae0ab9a101 got rid of tyPureObject; broke bootstrapping; use generated C code 2011-09-24 09:46:58 +02:00
Araq
bd2d146c77 got rid of tyPureObject; broke bootstrapping; use generated C code 2011-09-24 09:35:00 +02:00
Araq
3824b6ea5f Merge branch 'master' of git@github.com:Araq/Nimrod 2011-09-24 00:46:54 +02:00
Araq
6023e994fb beginning of a taint mode; type system enhancements 2011-09-24 00:46:41 +02:00
dom96
6deda5a973 Fixed string concatenation and other bugs in the JS backend. Fixed a small bug in the IRC module. 2011-09-23 21:43:24 +01:00
Araq
2359b8b107 fixed some newly introduced bugs 2011-09-21 00:54:13 +02:00
Araq
57f184cf48 Merge pull request #54 from zah/pretty-print-ast
String interpolation implemented in terms of macros
2011-09-20 12:13:24 -07:00
Zahary Karadjov
9acfc43119 using statement (ala C#) implemented as macro (added as test).
simplified the usage of the interpolatedFragments iterator.
2011-09-20 14:13:45 +03:00
Zahary Karadjov
dbcca9b3b9 Moved the parseAST magics to evals.nim
Added string interpolation helper routines in parserutils

Added a proof-of-concept string interpolation user-land macros (currently, only as a test case):
  the interpolated expression could either be transformed to
  concat("literal string ", $(interpolated), " end") or
  "literal string $1 end" % [$(interpolated)]

Added a very initial definition of Optional[T] generic type

A new overload of ParseIdent was added in hope to get around the fact that the 
old one doesn't work correctly in macros, but the problem persists.
2011-09-20 14:13:45 +03:00
Zahary Karadjov
a28cf4e9cb Quick Fix:
Constant expressions used in when statements and tuple indexing are properly evaluated now

Even further step tested to be OK:

```nimrod
proc semConstExpr(c: PContext, n: PNode): PNode = 
  result = semAndEvalConstExpr(c, n)
```
2011-09-20 14:13:45 +03:00
Zahary Karadjov
91351e5996 Initial implementation of the parseExpr, parseStmt, getAst macro routines:
proc parseExpr*(s: string) : expr {.magic: "ParseExprToAst".}
  ## Compiles the passed string to its AST representation
  ## Expects a single expression

proc parseStmt*(s: string) : stmt {.magic: "ParseStmtToAst".}
  ## Compiles the passed string to its AST representation
  ## Expects one or more statements

proc getAst*(macroOrTemplate: expr): expr {.magic: "ExpandMacroToAst".}
  ## Obtains the AST nodes returned from a macro or template invocation
  ## example:
  ## macro FooMacro() = 
  ##   var ast = getAst(BarTemplate())

Handling of the node.toYaml magic moved to the evaluation engine.
2011-09-20 14:13:45 +03:00
Zahary Karadjov
d541815e4b Added AST introspection routines as a part of the standard library 2011-09-20 14:13:45 +03:00
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
Zahary Karadjov
0f0dfd6379 Nimrod can now compile itself with --lineDir enabled 2011-09-20 14:11:06 +03:00
Araq
fd62116f6e bugfixes for generics; new threads implementation still broken 2011-09-20 00:56:48 +02:00
Araq
d560e84fcc locks now in their own core module 2011-08-20 00:24:02 +02:00
Araq
5cba831c88 'pure' is now 'noStackFrame' for procs 2011-08-19 19:11:58 +02:00
Araq
ffefb736d9 small bugfix for eval 2011-08-19 09:07:23 +02:00