aboutsummaryrefslogtreecommitdiff
path: root/core/collections.nom
diff options
context:
space:
mode:
authorBruce Hill <bitbucket@bruce-hill.com>2018-07-22 15:01:05 -0700
committerBruce Hill <bitbucket@bruce-hill.com>2018-07-22 15:01:05 -0700
commitaddac10a47693a976808bf75fe63aed19f8dbb63 (patch)
treeb072998c987f86eb1ecd381fd36eee0d1e3a6091 /core/collections.nom
parent4fa9757fa27d79a0cda399dcf3b711f4d0d60457 (diff)
Re-autoformatted everything. The main changes are: no longer adding a
newline after 1-line indented code inside blocks, and forcing files to have a trailing newline. The trailing newline thing created a lot of spurious changes.
Diffstat (limited to 'core/collections.nom')
-rw-r--r--core/collections.nom13
1 files changed, 1 insertions, 12 deletions
diff --git a/core/collections.nom b/core/collections.nom
index f74b24d..6f2d4c8 100644
--- a/core/collections.nom
+++ b/core/collections.nom
@@ -29,7 +29,6 @@ test:
action [%item is in %list, %list contains %item, %list has %item]:
for %key = %value in %list:
if (%key is %item): return (yes)
-
return (no)
test:
@@ -41,7 +40,6 @@ action [..]
..:
for %key = %value in %list:
if (%key is %item): return (no)
-
return (yes)
test:
@@ -94,7 +92,6 @@ parse [%expression for %item in %iterable] as (..)
%comprehension = []
for %item in %iterable:
add %expression to %comprehension
-
return %comprehension
parse [..]
@@ -105,7 +102,6 @@ parse [..]
%comprehension = []
for %index in %start to %stop via %step:
add %expression to %comprehension
-
return %comprehension
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -127,10 +123,8 @@ parse [..]
%comprehension = []
for %key = %value in %iterable:
add %expression to %comprehension
-
return %comprehension
-
# Dict comprehensions
test:
assume (((% * %) = % for % in [1, 2, 3]) == {1:1, 4:2, 9:3})
@@ -141,7 +135,6 @@ parse [%key = %value for %item in %iterable, %key %value for %item in %iterable]
%comprehension = {}
for %item in %iterable:
%comprehension.%key = %value
-
return %comprehension
test:
@@ -155,7 +148,6 @@ parse [..]
%comprehension = {}
for %src_key = %src_value in %iterable:
%comprehension.%key = %value
-
return %comprehension
parse [..]
@@ -166,7 +158,6 @@ parse [..]
%comprehension = {}
for %item in %start to %stop via %step:
%comprehension.%key = %value
-
return %comprehension
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -186,7 +177,6 @@ action [%lists flattened]:
%flat = []
for %list in %lists:
for %item in %list: add %item to %flat
-
return %flat
test:
@@ -222,7 +212,6 @@ compile [%dict with fallback %key -> %value] to (..)
return value
end})
-
# Sorting
test:
%x = [3, 1, 2]
@@ -267,4 +256,4 @@ action [unique %items]:
add % to %unique
%seen.% = (yes)
- return %unique \ No newline at end of file
+ return %unique