aboutsummaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2018-11-26 16:28:06 -0800
committerBruce Hill <bruce@bruce-hill.com>2018-11-26 16:28:06 -0800
commit5027bd4f0f2c6dcebf667a6924c50b0ca3df235f (patch)
treeda3ed710dcbfc065a24ac3ab0c8b4917a22b6991 /core
parent8e5f1b9e1e912f781738a564843e024b0e0b2e96 (diff)
Upgraded/autoformatted.
Diffstat (limited to 'core')
-rw-r--r--core/collections.nom2
-rw-r--r--core/control_flow.nom29
-rw-r--r--core/coroutines.nom2
-rw-r--r--core/errors.nom2
-rw-r--r--core/id.nom2
-rw-r--r--core/io.nom2
-rw-r--r--core/math.nom2
-rw-r--r--core/metaprogramming.nom5
-rw-r--r--core/operators.nom2
-rw-r--r--core/text.nom2
10 files changed, 29 insertions, 21 deletions
diff --git a/core/collections.nom b/core/collections.nom
index 9272d13..c34e8bc 100644
--- a/core/collections.nom
+++ b/core/collections.nom
@@ -1,4 +1,4 @@
-#!/usr/bin/env nomsu -V4.11.12.8
+#!/usr/bin/env nomsu -V4.12.12.8
#
This file contains code that supports manipulating and using collections like lists
and dictionaries.
diff --git a/core/control_flow.nom b/core/control_flow.nom
index 4fe94e4..6cc2599 100644
--- a/core/control_flow.nom
+++ b/core/control_flow.nom
@@ -1,4 +1,4 @@
-#!/usr/bin/env nomsu -V4.11.12.8
+#!/usr/bin/env nomsu -V4.12.12.8
#
This file contains compile-time actions that define basic control flow structures
like "if" statements and loops.
@@ -87,10 +87,16 @@ test:
assume (%i == 0)
(--- %label ---) compiles to "\
- ..::label_\((%label.stub::as lua id) if (%label.type == "Action") else (%label as lua identifier))::"
+ ..::label_\(..)
+ (%label.stub::as lua id) if (%label.type == "Action") else (..)
+ %label as lua identifier
+ ..::"
(go to %label) compiles to "\
- ..goto label_\((%label.stub::as lua id) if (%label.type == "Action") else (%label as lua identifier))"
+ ..goto label_\(..)
+ (%label.stub::as lua id) if (%label.type == "Action") else (..)
+ %label as lua identifier
+ .."
# Basic loop control
(stop %var) compiles to:
@@ -105,11 +111,8 @@ test:
..else:
return (Lua "goto continue")
-(---stop %var ---) compiles to "\
- ..::stop_\(%var as lua identifier)::"
-
-(---next %var ---) compiles to "\
- ..::continue_\(%var as lua identifier)::"
+(---stop %var ---) compiles to "::stop_\(%var as lua identifier)::"
+(---next %var ---) compiles to "::continue_\(%var as lua identifier)::"
# While loops
test:
@@ -124,12 +127,14 @@ test:
do next
barf "Failed to 'do next'"
assume (%x == 20)
+
(repeat while %condition %body) compiles to:
%lua = (Lua "while \(%condition as lua expr) do\n \(%body as lua)")
if (%body has subtree \(do next)):
%lua::append "\n ::continue::"
%lua::append "\nend --while-loop"
return %lua
+
(repeat %body) parses as (repeat while (yes) %body)
(repeat until %condition %body) parses as (repeat while (not %condition) %body)
@@ -185,10 +190,11 @@ test:
test:
%x = 0
- repeat 5 times: %x += 1
+ repeat 5 times:
+ %x += 1
assume %x == 5
-(repeat %n times %body) parses as (for (=lua "_XXX_") in 1 to %n %body)
+(repeat %n times %body) parses as (for (=lua "_XXX_") in 1 to %n %body)
test:
%a = [10, 20, 30, 40, 50]
%b = []
@@ -229,7 +235,8 @@ test:
%lua::append "\nend -- end of scope for stopping for-loop"
return %lua
-(for %var in %iterable %body) parses as (for %var in %iterable at (=lua "__") %body)
+(for %var in %iterable %body) parses as (..)
+ for %var in %iterable at (=lua "__") %body
test:
%d = {a: 10, b: 20, c: 30, d: 40, e: 50}
diff --git a/core/coroutines.nom b/core/coroutines.nom
index 73b6854..f34f0c9 100644
--- a/core/coroutines.nom
+++ b/core/coroutines.nom
@@ -1,4 +1,4 @@
-#!/usr/bin/env nomsu -V4.11.12.8
+#!/usr/bin/env nomsu -V4.12.12.8
#
This file defines the code that creates and manipulates coroutines
diff --git a/core/errors.nom b/core/errors.nom
index aa5346b..a7e4cff 100644
--- a/core/errors.nom
+++ b/core/errors.nom
@@ -1,4 +1,4 @@
-#!/usr/bin/env nomsu -V4.11.12.8
+#!/usr/bin/env nomsu -V4.12.12.8
#
This file contains basic error reporting code
diff --git a/core/id.nom b/core/id.nom
index 9ee961d..78af96c 100644
--- a/core/id.nom
+++ b/core/id.nom
@@ -1,4 +1,4 @@
-#!/usr/bin/env nomsu -V4.11.12.8
+#!/usr/bin/env nomsu -V4.12.12.8
#
A simple UUID function based on RFC 4122: http://www.ietf.org/rfc/rfc4122.txt
diff --git a/core/io.nom b/core/io.nom
index 04efb91..8f22b07 100644
--- a/core/io.nom
+++ b/core/io.nom
@@ -1,4 +1,4 @@
-#!/usr/bin/env nomsu -V4.11.12.8
+#!/usr/bin/env nomsu -V4.12.12.8
#
This file contains basic input/output code
diff --git a/core/math.nom b/core/math.nom
index ae01620..bef6bbb 100644
--- a/core/math.nom
+++ b/core/math.nom
@@ -1,4 +1,4 @@
-#!/usr/bin/env nomsu -V4.11.12.8
+#!/usr/bin/env nomsu -V4.12.12.8
#
This file defines some common math literals and functions
diff --git a/core/metaprogramming.nom b/core/metaprogramming.nom
index 420c62d..99488c7 100644
--- a/core/metaprogramming.nom
+++ b/core/metaprogramming.nom
@@ -1,4 +1,4 @@
-#!/usr/bin/env nomsu -V4.11.12.8
+#!/usr/bin/env nomsu -V4.12.12.8
#
This File contains actions for making actions and compile-time actions and some helper
functions to make that easier.
@@ -373,7 +373,8 @@ externally (type of %) means:
test:
assume ((run "return (2 + 99)") == 101)
%x = 0
- externally (set to %) means: external %x = %
+ externally (set to %) means:
+ external %x = %
run "set to 1"
assume %x == 1
assume (run \(return \(\(5) + \(5)))) == 10
diff --git a/core/operators.nom b/core/operators.nom
index 1a28a6a..9997a47 100644
--- a/core/operators.nom
+++ b/core/operators.nom
@@ -1,4 +1,4 @@
-#!/usr/bin/env nomsu -V4.11.12.8
+#!/usr/bin/env nomsu -V4.12.12.8
#
This file contains definitions of operators like "+" and "and".
diff --git a/core/text.nom b/core/text.nom
index 1245235..fcdf678 100644
--- a/core/text.nom
+++ b/core/text.nom
@@ -1,4 +1,4 @@
-#!/usr/bin/env nomsu -V4.11.12.8
+#!/usr/bin/env nomsu -V4.12.12.8
#
This file contains some definitions of text escape sequences, including ANSI console
color codes.