mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-30 18:02:05 +00:00
42e0b082144a2c03ef18e0cabc372c90f1753148
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)
===========================================================
Nimrod Compiler
===========================================================
This is the **Nimrod Compiler**. Nimrod is a new statically typed, imperative
programming language, that supports procedural, functional, object oriented and
generic programming styles while remaining simple and efficient. A special
feature that Nimrod inherited from Lisp is that Nimrod's abstract syntax tree
(AST) is part of the specification - this allows a powerful macro system which
can be used to create domain specific languages.
*Nimrod* is a compiled, garbage-collected systems programming language
which has an excellent productivity/performance ratio. Nimrod's design
focuses on the 3E: efficiency, expressiveness, elegance (in the order of
priority).
See the file ``install.txt`` for installation instructions. See the file
``doc/intern.txt`` for the internal documentation for developers.
Copyright (c) 2004-2012 Andreas Rumpf.
All rights reserved.
Description
Nim is a statically typed compiled systems programming language. It combines successful concepts from mature languages like Python, Ada and Modula. Its design focuses on efficiency, expressiveness, and elegance (in that order of priority).
Readme
642 MiB
Languages
Nim
96.6%
HTML
1.8%
Python
0.5%
C
0.4%
Shell
0.4%
Other
0.2%