summary refs log tree commit diff stats
path: root/tests/accept/run
diff options
context:
space:
mode:
authorrumpf_a@web.de <>2010-02-21 23:44:53 +0100
committerrumpf_a@web.de <>2010-02-21 23:44:53 +0100
commit6da95ed9ca899db702c6a7b17d2d7db14dbb0de4 (patch)
treed29e92a1e0f863091e5a544a5b55073c7b53be45 /tests/accept/run
parentd913fdb2800d83680e413cd8a5f07b7f85deac6e (diff)
downloadNim-6da95ed9ca899db702c6a7b17d2d7db14dbb0de4.tar.gz
start of yamllexer
Diffstat (limited to 'tests/accept/run')
-rw-r--r--tests/accept/run/mbind3.nim9
-rw-r--r--tests/accept/run/tbug511622.nim9
2 files changed, 18 insertions, 0 deletions
diff --git a/tests/accept/run/mbind3.nim b/tests/accept/run/mbind3.nim
new file mode 100644
index 000000000..586222eb8
--- /dev/null
+++ b/tests/accept/run/mbind3.nim
@@ -0,0 +1,9 @@
+# Module A
+var 
+  lastId = 0
+
+template genId*: expr =
+  inc(bind lastId)
+  lastId
+
+
diff --git a/tests/accept/run/tbug511622.nim b/tests/accept/run/tbug511622.nim
new file mode 100644
index 000000000..296c36b9c
--- /dev/null
+++ b/tests/accept/run/tbug511622.nim
@@ -0,0 +1,9 @@
+import StrUtils, Math
+
+proc FibonacciA(n: int): int64 =
+  var fn = float64(n)
+  var p: float64 = (1.0 + sqrt(5.0)) / 2.0
+  var q: float64 = 1.0 / p
+  return int64((pow(p, fn) + pow(q, fn)) / sqrt(5.0))
+
+echo FibonacciA(4) #OUT 10