Files
Nim/compiler
Zahary Karadjov 42e0b08214 fix the usage of definedInScope in pegs.=~
template `=~`*(s: string, pattern: TPeg): bool =
   when not definedInScope(matches):
      var matches: array[0..maxSubpatterns-1, string]

It seems that this never worked as intended.
I discovered it now, because when variables' names are preserved, multiple
variables named `matches` were created. The reason this happens is that
when the template is used as an if condition, the if scope is already entered,
but the variables end up in the outer scope.

This patch is consistent with how `expr` templates work, but makes the
definition of a variable injection template like := a bit harder, yet still possible.
(note that if foo := bar(): is still not creating properly scoped variable prior to the patch)
2012-04-14 13:32:51 +03:00
..
2012-02-29 00:04:34 +01:00
2012-02-29 00:04:34 +01:00
2012-01-02 23:07:35 +01:00
2012-03-28 16:43:05 +02:00
2012-01-02 23:07:35 +01:00
2012-01-02 23:07:35 +01:00
2011-04-12 01:13:42 +02:00
2012-02-09 20:13:36 +01:00
2012-01-02 23:07:35 +01:00
2011-04-12 01:13:42 +02:00
2012-03-23 00:16:29 +01:00
2012-01-02 23:07:35 +01:00
2012-03-31 18:50:48 +03:00
2012-03-31 18:50:48 +03:00
2012-03-28 16:43:05 +02:00
2012-03-31 18:50:48 +03:00
2012-02-06 00:19:56 +01: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.