Commits

Taku Miyakawa committed 3eebfea

The new nomenclature on internal module names

Comments (0)

Files changed (53)

src/main/java/org/kink_lang/kink/internal/BaseMethods.java

     @Define
     public Value exact( @Receiver Value receiver , Value classVal ) {
         Value converted = receiver.call( CAST_GET_SITE , classVal );
-        Value mod = Modules.find( "internal/Exact" );
+        Value mod = Modules.find( "internal/EXACT" );
         return mod.tailCall( EXACTTYPED , converted , classVal );
     }
 

src/main/java/org/kink_lang/kink/internal/box/ValueListEnhancer.java

         }
 
 
-        /** Holder of ListSeq module. */
+        /** Holder of LIST_SEQ module. */
         private static final class ListSequenceModuleHolder {
-            static final Value SEQUENCE_MODULE = Modules.find( "internal/ListSeq" );
+            static final Value SEQUENCE_MODULE = Modules.find( "internal/LIST_SEQ" );
 
             private ListSequenceModuleHolder() {
                 throw new UnsupportedOperationException( "Should not be instantiated" );
 
         @Define
         public static Value rest( @Receiver Value list , Value rest ) {
-            Value restMod = Modules.find( "internal/Rest" );
+            Value restMod = Modules.find( "internal/REST" );
             return restMod.tailCall( REST , list , rest );
         }
 

src/main/java/org/kink_lang/kink/internal/box/number/NumberMethods.java

 
 
     private static final class NumberSeqModuleHolder {
-        static final Value NUMBER_SEQ = Modules.find( "internal/NumberSeq" );
+        static final Value NUMBER_SEQ = Modules.find( "internal/NUMBER_SEQ" );
 
         private NumberSeqModuleHolder() {
             throw new UnsupportedOperationException( "Should not be instantiated" );

src/main/java/org/kink_lang/kink/internal/module/Core.java

         /** Holder class of "any". */
         private static final class AnyHolder {
 
-            static final Value ANY = Modules.find( "internal/Any" ).call( new GetSite( "any" ) );
+            static final Value ANY = Modules.find( "internal/ANY" ).call( new GetSite( "any" ) );
 
             private AnyHolder() {
                 throw new UnsupportedOperationException( "Should not be instantiated" );
 
 
         private static final class RangeModuleHolder {
-            static final Value RANGE_MODULE = Modules.find( "internal/Range" );
+            static final Value RANGE_MODULE = Modules.find( "internal/RANGE" );
 
             private RangeModuleHolder() {
                 throw new UnsupportedOperationException( "Should not be instantiated" );
 
         @Define
         public static Value expand( @Receiver Value env , Value templateStr ) {
-            Value formatMod = Modules.find( "internal/Expand" );
+            Value formatMod = Modules.find( "internal/EXPAND" );
             return formatMod.tailCall( EXPAND , templateStr , env );
         }
 

src/main/java/org/kink_lang/kink/internal/module/CountLoop.java

 
 import java.math.BigDecimal;
 
-/** internal.CountLoop module. */
+/** internal.COUNT_LOOP module. */
 public final class CountLoop extends ModuleFactory {
 
 
     @Override
     public String getName() {
-        return "internal/CountLoop";
+        return "internal/COUNT_LOOP";
     }
 
 

src/main/java/org/kink_lang/kink/internal/start/Kink.java

     /** Launches the program. */
     private void run( String[] args ) {
         ValueList argsList = argsList( args );
-        Value start = Modules.find( "internal/Start" );
+        Value start = Modules.find( "internal/START" );
         start.call( START , Value.value( argsList ) );
     }
 

src/main/kink/_enhance/array_of/Primitive_boolean.kn

 # THE SOFTWARE.
 
 :enhance = { (:Proto)
-    use('internal/CommonArray')
-    Proto.setvars(*** CommonArray.arraytrait)
+    use('internal/COMMON_ARRAY')
+    Proto.setvars(*** COMMON_ARRAY.arraytrait)
 }

src/main/kink/_enhance/array_of/Primitive_byte.kn

 
 :enhance = { (:Proto)
 
-    use('internal/CommonArray')
-    Proto.setvars(*** CommonArray.arraytrait)
+    use('internal/COMMON_ARRAY')
+    Proto.setvars(*** COMMON_ARRAY.arraytrait)
 
     Proto.:program = { > :Array (:Name)
         use('org.kink_lang.kink.Program')

src/main/kink/_enhance/array_of/Primitive_char.kn

 # THE SOFTWARE.
 
 :enhance = { (:Proto)
-    use('internal/CommonArray')
-    Proto.setvars(*** CommonArray.arraytrait)
+    use('internal/COMMON_ARRAY')
+    Proto.setvars(*** COMMON_ARRAY.arraytrait)
 }

src/main/kink/_enhance/array_of/Primitive_double.kn

 # THE SOFTWARE.
 
 :enhance = { (:Proto)
-    use('internal/CommonArray')
-    Proto.setvars(*** CommonArray.arraytrait)
+    use('internal/COMMON_ARRAY')
+    Proto.setvars(*** COMMON_ARRAY.arraytrait)
 }

src/main/kink/_enhance/array_of/Primitive_float.kn

 # THE SOFTWARE.
 
 :enhance = { (:Proto)
-    use('internal/CommonArray')
-    Proto.setvars(*** CommonArray.arraytrait)
+    use('internal/COMMON_ARRAY')
+    Proto.setvars(*** COMMON_ARRAY.arraytrait)
 }

src/main/kink/_enhance/array_of/Primitive_int.kn

 # THE SOFTWARE.
 
 :enhance = { (:Proto)
-    use('internal/CommonArray')
-    Proto.setvars(*** CommonArray.arraytrait)
+    use('internal/COMMON_ARRAY')
+    Proto.setvars(*** COMMON_ARRAY.arraytrait)
 }

src/main/kink/_enhance/array_of/Primitive_long.kn

 # THE SOFTWARE.
 
 :enhance = { (:Proto)
-    use('internal/CommonArray')
-    Proto.setvars(*** CommonArray.arraytrait)
+    use('internal/COMMON_ARRAY')
+    Proto.setvars(*** COMMON_ARRAY.arraytrait)
 }

src/main/kink/_enhance/array_of/Primitive_short.kn

 # THE SOFTWARE.
 
 :enhance = { (:Proto)
-    use('internal/CommonArray')
-    Proto.setvars(*** CommonArray.arraytrait)
+    use('internal/COMMON_ARRAY')
+    Proto.setvars(*** COMMON_ARRAY.arraytrait)
 }

src/main/kink/_enhance/array_of/java/lang/Object.kn

 # THE SOFTWARE.
 
 :enhance = { (:Proto)
-    use('internal/CommonArray')
-    Proto.setvars(*** CommonArray.arraytrait)
+    use('internal/COMMON_ARRAY')
+    Proto.setvars(*** COMMON_ARRAY.arraytrait)
 }

src/main/kink/internal/ANY.kn

+#!/usr/bin/env kink
+# vim: et sw=4 sts=4
+
+# Copyright (c) 2013 Miyakawa Taku
+# 
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+# 
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+# 
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+# THE SOFTWARE.
+
+:Any = value(
+    'op_set' {}
+    'op_match' { true }
+    'show' { 'any' }
+)
+
+## Pattern that matches anything.
+## And the pattern has no-op op_set method
+:any = constfun(Any)

src/main/kink/internal/Any.kn

-#!/usr/bin/env kink
-# vim: et sw=4 sts=4
-
-# Copyright (c) 2013 Miyakawa Taku
-# 
-# Permission is hereby granted, free of charge, to any person obtaining a copy
-# of this software and associated documentation files (the "Software"), to deal
-# in the Software without restriction, including without limitation the rights
-# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-# copies of the Software, and to permit persons to whom the Software is
-# furnished to do so, subject to the following conditions:
-# 
-# The above copyright notice and this permission notice shall be included in
-# all copies or substantial portions of the Software.
-# 
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-# THE SOFTWARE.
-
-:Any = value(
-    'op_set' {}
-    'op_match' { true }
-    'show' { 'any' }
-)
-
-## Pattern that matches anything.
-## And the pattern has no-op op_set method
-:any = constfun(Any)

src/main/kink/internal/COMMON_ARRAY.kn

+#! kink
+# vim: et sw=4 sts=4
+
+# Copyright (c) 2013 Miyakawa Taku
+# 
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+# 
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+# 
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+# THE SOFTWARE.
+
+use('SEQ.seq')
+use('java.lang.reflect.Array')
+use('java.util.Arrays')
+
+:list = { > :Ary
+    :List = []
+    Array.getLength(Ary).times.loop { (:Index)
+        List.push(Array.get(Ary Index))
+    }
+    List
+}
+
+:_show = { > :Ary ()
+    Ary.object??.then {
+        :Content = Ary.list.map { \0.show } .join(' ')
+        expand('#{ Ary.getClass.getComponentType.getSimpleName }.array(#Content)')
+    } {
+        'null-array'
+    }
+}
+
+:arrayseq = { (:Ary :Index)
+    seq(
+        { Index < Ary.count }
+        { Ary.get(Index) }
+        { arrayseq(Ary Index + 1) }
+    )
+}
+
+:arraytrait = constfun([
+    'list' $list
+    'seq' { > :Ary ()
+        arrayseq(Ary 0)
+    }
+    'count' { > :Ary ()
+        Array.getLength(Ary)
+    }
+    'get' { > :Ary (:Index)
+        Array.get(Ary Index)
+    }
+    'head' { > :Ary (:Count)
+        :Count = [[0 Count].max Ary.count].min
+        Arrays.copyOf(Ary Count)
+    }
+    'drophead' { > :Ary (:Count)
+        :Count = [[0 Count].max Ary.count].min
+        Arrays.copyOfRange(Ary Count Ary.count)
+    }
+    'slice' { > :Ary (:Head_cut :Tail_cut)
+        :Head_cut = [[0 Head_cut].max Ary.count].min
+        :Tail_cut = [[Tail_cut Ary.count].min Head_cut].max
+        Arrays.copyOfRange(Ary Head_cut Tail_cut)
+    }
+    'op_eq' { > :X (:Y)
+        X.object??.then(
+            { Y.object?? && Y.getClass == X.getClass && Arrays.equals(X Y) }
+            { X.identity == Y.identity }
+        )
+    }
+    'hash' { > :Ary ()
+        Arrays.hashCode(Ary)
+    }
+    'show' $_show
+])

src/main/kink/internal/CommonArray.kn

-#! kink
-# vim: et sw=4 sts=4
-
-# Copyright (c) 2013 Miyakawa Taku
-# 
-# Permission is hereby granted, free of charge, to any person obtaining a copy
-# of this software and associated documentation files (the "Software"), to deal
-# in the Software without restriction, including without limitation the rights
-# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-# copies of the Software, and to permit persons to whom the Software is
-# furnished to do so, subject to the following conditions:
-# 
-# The above copyright notice and this permission notice shall be included in
-# all copies or substantial portions of the Software.
-# 
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-# THE SOFTWARE.
-
-use('SEQ.seq')
-use('java.lang.reflect.Array')
-use('java.util.Arrays')
-
-:list = { > :Ary
-    :List = []
-    Array.getLength(Ary).times.loop { (:Index)
-        List.push(Array.get(Ary Index))
-    }
-    List
-}
-
-:_show = { > :Ary ()
-    Ary.object??.then {
-        :Content = Ary.list.map { \0.show } .join(' ')
-        expand('#{ Ary.getClass.getComponentType.getSimpleName }.array(#Content)')
-    } {
-        'null-array'
-    }
-}
-
-:arrayseq = { (:Ary :Index)
-    seq(
-        { Index < Ary.count }
-        { Ary.get(Index) }
-        { arrayseq(Ary Index + 1) }
-    )
-}
-
-:arraytrait = constfun([
-    'list' $list
-    'seq' { > :Ary ()
-        arrayseq(Ary 0)
-    }
-    'count' { > :Ary ()
-        Array.getLength(Ary)
-    }
-    'get' { > :Ary (:Index)
-        Array.get(Ary Index)
-    }
-    'head' { > :Ary (:Count)
-        :Count = [[0 Count].max Ary.count].min
-        Arrays.copyOf(Ary Count)
-    }
-    'drophead' { > :Ary (:Count)
-        :Count = [[0 Count].max Ary.count].min
-        Arrays.copyOfRange(Ary Count Ary.count)
-    }
-    'slice' { > :Ary (:Head_cut :Tail_cut)
-        :Head_cut = [[0 Head_cut].max Ary.count].min
-        :Tail_cut = [[Tail_cut Ary.count].min Head_cut].max
-        Arrays.copyOfRange(Ary Head_cut Tail_cut)
-    }
-    'op_eq' { > :X (:Y)
-        X.object??.then(
-            { Y.object?? && Y.getClass == X.getClass && Arrays.equals(X Y) }
-            { X.identity == Y.identity }
-        )
-    }
-    'hash' { > :Ary ()
-        Arrays.hashCode(Ary)
-    }
-    'show' $_show
-])

src/main/kink/internal/EXACT.kn

+#! kink
+# vim: et sw=4 sts=4
+
+# Copyright (c) 2013 Miyakawa Taku
+# 
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+# 
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+# 
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+# THE SOFTWARE.
+
+:exacttyped = { (:Value :Class)
+    _cast(Value.cast(Class) Class)
+}
+
+:_cast = { (:Converted :Class)
+    Converted.child(
+        'cancast?' { \0 == Class }
+        'show' {
+            expand('#{Converted.show}.exact(#{Class.show})')
+        }
+    )
+}

src/main/kink/internal/EXPAND.kn

+#!/usr/bin/env kink
+# vim: et sw=4 sts=4
+
+# Copyright (c) 2013 Miyakawa Taku
+# 
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+# 
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+# 
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+# THE SOFTWARE.
+
+use('java.lang.StringBuilder')
+
+:expand = { (:Template :Env)
+    :Builder = StringBuilder.new
+    :Brace_matcher = %'(\})|\{'.matcher(Template)
+    :parse_nested_block = { (:Index)
+        Brace_matcher.switch(
+            { ! \0.find(Index) } {
+                throw( 'No closing brace' )
+            }
+            { \0.group(1).object?? } {
+                Brace_matcher.end
+            }
+            (any) {
+                :Nested_end = parse_nested_block(Brace_matcher.end)
+                parse_nested_block(Nested_end)
+            }
+        )
+    }
+    :parse_block = { (:Open :Index)
+        Brace_matcher.switch(
+            { ! \0.find(Index) } {
+                throw('No closing brace')
+            }
+            { \0.group(1).object?? } {
+                :Script = Template.slice(Open Brace_matcher.start)
+                :_fun = Script.program('(expand)').compile
+                Builder.append(_fun(Env).str)
+                parse(Brace_matcher.end)
+            }
+            (any) {
+                :Nested_end = parse_nested_block(Brace_matcher.end)
+                parse_block(Open Nested_end)
+            }
+        )
+    }
+    :parse.do(0) { (:Index)
+        :Matcher = %'([^#]*)(#(?:([A-Z][A-Za-z0-9?_]*)|(\{)|#)?)?'.matcher(Template)
+        Matcher.find(Index)
+        Builder.append(Matcher.group(1))
+        Matcher.switch(
+            { \0.group(3).object?? } {
+                Builder.append(Env.var(Matcher.group(3)).get.str)
+                parse(Matcher.end)
+            }
+            { \0.group(4).object?? } {
+                parse_block(Matcher.end Matcher.end)
+            }
+            { \0.group(2).object?? } {
+                Builder.append('#')
+                parse(Matcher.end)
+            }
+        )
+    }
+    Builder.toString
+}

src/main/kink/internal/Exact.kn

-#! kink
-# vim: et sw=4 sts=4
-
-# Copyright (c) 2013 Miyakawa Taku
-# 
-# Permission is hereby granted, free of charge, to any person obtaining a copy
-# of this software and associated documentation files (the "Software"), to deal
-# in the Software without restriction, including without limitation the rights
-# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-# copies of the Software, and to permit persons to whom the Software is
-# furnished to do so, subject to the following conditions:
-# 
-# The above copyright notice and this permission notice shall be included in
-# all copies or substantial portions of the Software.
-# 
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-# THE SOFTWARE.
-
-:exacttyped = { (:Value :Class)
-    _cast(Value.cast(Class) Class)
-}
-
-:_cast = { (:Converted :Class)
-    Converted.child(
-        'cancast?' { \0 == Class }
-        'show' {
-            expand('#{Converted.show}.exact(#{Class.show})')
-        }
-    )
-}

src/main/kink/internal/Expand.kn

-#!/usr/bin/env kink
-# vim: et sw=4 sts=4
-
-# Copyright (c) 2013 Miyakawa Taku
-# 
-# Permission is hereby granted, free of charge, to any person obtaining a copy
-# of this software and associated documentation files (the "Software"), to deal
-# in the Software without restriction, including without limitation the rights
-# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-# copies of the Software, and to permit persons to whom the Software is
-# furnished to do so, subject to the following conditions:
-# 
-# The above copyright notice and this permission notice shall be included in
-# all copies or substantial portions of the Software.
-# 
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-# THE SOFTWARE.
-
-use('java.lang.StringBuilder')
-
-:expand = { (:Template :Env)
-    :Builder = StringBuilder.new
-    :Brace_matcher = %'(\})|\{'.matcher(Template)
-    :parse_nested_block = { (:Index)
-        Brace_matcher.switch(
-            { ! \0.find(Index) } {
-                throw( 'No closing brace' )
-            }
-            { \0.group(1).object?? } {
-                Brace_matcher.end
-            }
-            (any) {
-                :Nested_end = parse_nested_block(Brace_matcher.end)
-                parse_nested_block(Nested_end)
-            }
-        )
-    }
-    :parse_block = { (:Open :Index)
-        Brace_matcher.switch(
-            { ! \0.find(Index) } {
-                throw('No closing brace')
-            }
-            { \0.group(1).object?? } {
-                :Script = Template.slice(Open Brace_matcher.start)
-                :_fun = Script.program('(expand)').compile
-                Builder.append(_fun(Env).str)
-                parse(Brace_matcher.end)
-            }
-            (any) {
-                :Nested_end = parse_nested_block(Brace_matcher.end)
-                parse_block(Open Nested_end)
-            }
-        )
-    }
-    :parse.do(0) { (:Index)
-        :Matcher = %'([^#]*)(#(?:([A-Z][A-Za-z0-9?_]*)|(\{)|#)?)?'.matcher(Template)
-        Matcher.find(Index)
-        Builder.append(Matcher.group(1))
-        Matcher.switch(
-            { \0.group(3).object?? } {
-                Builder.append(Env.var(Matcher.group(3)).get.str)
-                parse(Matcher.end)
-            }
-            { \0.group(4).object?? } {
-                parse_block(Matcher.end Matcher.end)
-            }
-            { \0.group(2).object?? } {
-                Builder.append('#')
-                parse(Matcher.end)
-            }
-        )
-    }
-    Builder.toString
-}

src/main/kink/internal/LIST_SEQ.kn

+#!/usr/bin/env kink
+# vim: et sw=4 sts=4
+
+# Copyright (c) 2013 Miyakawa Taku
+# 
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+# 
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+# 
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+# THE SOFTWARE.
+
+use('SEQ.seq')
+
+:List_seq_proto = seq(
+    { (:Seq) Seq.From < Seq.To && Seq.From < Seq.List.count }
+    { (:Seq) Seq.List.get(Seq.From) }
+    { (:Seq) listseq(Seq.List (Seq.From + 1) Seq.To) }
+).setvars(
+    'head' { > :Seq (:Count)
+        :New_to = [Seq.To (Seq.From + Count)].min
+        listseq(Seq.List Seq.From New_to)
+    }
+    'drophead' { > :Seq (:Count)
+        :New_from = [0 Count].max
+        listseq(Seq.List (Seq.From + New_from) Seq.To)
+    }
+    'slice' { > :Seq (:From :To)
+        :New_from = [0 From].max
+        :New_to = [Seq.To (Seq.From + To)].min
+        listseq(Seq.List (Seq.From + New_from) New_to)
+    }
+)
+
+:listseq = { (:List :From :To)
+    List_seq_proto.child(
+        'List' List
+        'From' From
+        'To' To
+    )
+}

src/main/kink/internal/ListSeq.kn

-#!/usr/bin/env kink
-# vim: et sw=4 sts=4
-
-# Copyright (c) 2013 Miyakawa Taku
-# 
-# Permission is hereby granted, free of charge, to any person obtaining a copy
-# of this software and associated documentation files (the "Software"), to deal
-# in the Software without restriction, including without limitation the rights
-# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-# copies of the Software, and to permit persons to whom the Software is
-# furnished to do so, subject to the following conditions:
-# 
-# The above copyright notice and this permission notice shall be included in
-# all copies or substantial portions of the Software.
-# 
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-# THE SOFTWARE.
-
-use('SEQ.seq')
-
-:List_seq_proto = seq(
-    { (:Seq) Seq.From < Seq.To && Seq.From < Seq.List.count }
-    { (:Seq) Seq.List.get(Seq.From) }
-    { (:Seq) listseq(Seq.List (Seq.From + 1) Seq.To) }
-).setvars(
-    'head' { > :Seq (:Count)
-        :New_to = [Seq.To (Seq.From + Count)].min
-        listseq(Seq.List Seq.From New_to)
-    }
-    'drophead' { > :Seq (:Count)
-        :New_from = [0 Count].max
-        listseq(Seq.List (Seq.From + New_from) Seq.To)
-    }
-    'slice' { > :Seq (:From :To)
-        :New_from = [0 From].max
-        :New_to = [Seq.To (Seq.From + To)].min
-        listseq(Seq.List (Seq.From + New_from) New_to)
-    }
-)
-
-:listseq = { (:List :From :To)
-    List_seq_proto.child(
-        'List' List
-        'From' From
-        'To' To
-    )
-}

src/main/kink/internal/NUMBER_SEQ.kn

+#!/usr/bin/env kink
+# vim: et sw=4 sts=4
+
+# Copyright (c) 2013 Miyakawa Taku
+# 
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+# 
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+# 
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+# THE SOFTWARE.
+
+use('SEQ.seq')
+use('internal/COUNT_LOOP')
+
+:upseq = { (:First :Step)
+    seq(
+        { true }
+        { First }
+        { upseq(First + Step Step) }
+    )
+}
+
+:downseq = { (:First :Step)
+    upseq(First (- Step))
+}
+
+:To_seq_proto = seq(
+    { (:Seq) Seq.First <= Seq.Max }
+    { (:Seq) Seq.First }
+    { (:Seq) toseq(Seq.First + 1 Seq.Max) }
+).setvars(
+    'loop' { > :Seq (:body)
+        COUNT_LOOP.up(Seq.First Seq.Max 1 $body)
+    }
+)
+
+:toseq = { (:First :Max)
+    To_seq_proto.child('First' First 'Max' Max)
+}
+
+:timesseq = { (:Times)
+    toseq(0 Times - 1)
+}
+
+:Down_to_seq_proto = seq(
+    { (:Seq) Seq.Min <= Seq.First }
+    { (:Seq) Seq.First }
+    { (:Seq) downtoseq(Seq.First - 1 Seq.Min) }
+).setvars(
+    'loop' { > :Seq (:body)
+        COUNT_LOOP.down(Seq.First Seq.Min 1 $body)
+    }
+)
+
+:downtoseq = { (:First :Min)
+    Down_to_seq_proto.child('First' First 'Min' Min)
+}

src/main/kink/internal/NumberSeq.kn

-#!/usr/bin/env kink
-# vim: et sw=4 sts=4
-
-# Copyright (c) 2013 Miyakawa Taku
-# 
-# Permission is hereby granted, free of charge, to any person obtaining a copy
-# of this software and associated documentation files (the "Software"), to deal
-# in the Software without restriction, including without limitation the rights
-# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-# copies of the Software, and to permit persons to whom the Software is
-# furnished to do so, subject to the following conditions:
-# 
-# The above copyright notice and this permission notice shall be included in
-# all copies or substantial portions of the Software.
-# 
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-# THE SOFTWARE.
-
-use('SEQ.seq')
-use('internal/CountLoop')
-
-:upseq = { (:First :Step)
-    seq(
-        { true }
-        { First }
-        { upseq(First + Step Step) }
-    )
-}
-
-:downseq = { (:First :Step)
-    upseq(First (- Step))
-}
-
-:To_seq_proto = seq(
-    { (:Seq) Seq.First <= Seq.Max }
-    { (:Seq) Seq.First }
-    { (:Seq) toseq(Seq.First + 1 Seq.Max) }
-).setvars(
-    'loop' { > :Seq (:body)
-        CountLoop.up(Seq.First Seq.Max 1 $body)
-    }
-)
-
-:toseq = { (:First :Max)
-    To_seq_proto.child('First' First 'Max' Max)
-}
-
-:timesseq = { (:Times)
-    toseq(0 Times - 1)
-}
-
-:Down_to_seq_proto = seq(
-    { (:Seq) Seq.Min <= Seq.First }
-    { (:Seq) Seq.First }
-    { (:Seq) downtoseq(Seq.First - 1 Seq.Min) }
-).setvars(
-    'loop' { > :Seq (:body)
-        CountLoop.down(Seq.First Seq.Min 1 $body)
-    }
-)
-
-:downtoseq = { (:First :Min)
-    Down_to_seq_proto.child('First' First 'Min' Min)
-}

src/main/kink/internal/RANGE.kn

+#!/usr/bin/env kink
+# vim: et sw=4 sts=4
+
+# Copyright (c) 2013 Miyakawa Taku
+# 
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+# 
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+# 
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+# THE SOFTWARE.
+
+## Lower..Upper
+:range_ii = { (:Lower :Upper)
+    _range(_inclusive(Lower) _inclusive(Upper))
+}
+
+## Lower..<Upper
+:range_ie = { (:Lower :Upper)
+    _range(_inclusive(Lower) _exclusive(Upper))
+}
+
+## Lower<..Upper
+:range_ei = { (:Lower :Upper)
+    _range(_exclusive(Lower) _inclusive(Upper))
+}
+
+## Lower<..<Upper
+:range_ee = { (:Lower :Upper)
+    _range(_exclusive(Lower) _exclusive(Upper))
+}
+
+## Range from lower and upper boundaries
+:_range = { (:Lower_bound :Upper_bound)
+    value(
+        'lower' { Lower_bound.value }
+        'upper' { Upper_bound.value }
+        'lower_inclusive?' { Lower_bound.inclusive? }
+        'upper_inclusive?' { Upper_bound.inclusive? }
+        'op_match' { (:Case)
+            Lower_bound.bounds_lower?(Case) && Upper_bound.bounds_upper?(Case)
+        }
+        'show' { Lower_bound.show_as_lower + '..' + Upper_bound.show_as_upper }
+    )
+}
+
+## Inclusive boundary
+:_inclusive = { (:Value)
+    value(
+        'inclusive?' { true }
+        'value' { Value }
+        'bounds_lower?' { Value <= \0 }
+        'bounds_upper?' { \0 <= Value }
+        'show_as_lower' { Value.show }
+        'show_as_upper' { Value.show }
+    )
+}
+
+## Exclusive boundary
+:_exclusive = { (:Value)
+    value(
+        'inclusive?' { false }
+        'value' { Value }
+        'bounds_lower?' { Value < \0 }
+        'bounds_upper?' { \0 < Value }
+        'show_as_lower' { Value.show + '<' }
+        'show_as_upper' { '<' + Value.show }
+    )
+}

src/main/kink/internal/REST.kn

+#!/usr/bin/env kink
+# vim: et sw=4 sts=4
+
+# Copyright (c) 2013 Miyakawa Taku
+# 
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+# 
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+# 
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+# THE SOFTWARE.
+
+:rest = { (:Lead :Rest)
+    :Value = value(
+        'op_set' { (:Args)
+            Lead = Args.head(Lead.count)
+            Rest = Args.drophead(Lead.count)
+            Value
+        }
+        'op_match' { (:Case)
+            Case.head(Lead.count) =~ Lead && Case.drophead(Lead.count) =~ Rest
+        }
+        'show' { ()
+            expand('#{ Lead.show }.rest(#{ Rest.show })')
+        }
+    )
+    Value
+}

src/main/kink/internal/Range.kn

-#!/usr/bin/env kink
-# vim: et sw=4 sts=4
-
-# Copyright (c) 2013 Miyakawa Taku
-# 
-# Permission is hereby granted, free of charge, to any person obtaining a copy
-# of this software and associated documentation files (the "Software"), to deal
-# in the Software without restriction, including without limitation the rights
-# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-# copies of the Software, and to permit persons to whom the Software is
-# furnished to do so, subject to the following conditions:
-# 
-# The above copyright notice and this permission notice shall be included in
-# all copies or substantial portions of the Software.
-# 
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-# THE SOFTWARE.
-
-## Lower..Upper
-:range_ii = { (:Lower :Upper)
-    _range(_inclusive(Lower) _inclusive(Upper))
-}
-
-## Lower..<Upper
-:range_ie = { (:Lower :Upper)
-    _range(_inclusive(Lower) _exclusive(Upper))
-}
-
-## Lower<..Upper
-:range_ei = { (:Lower :Upper)
-    _range(_exclusive(Lower) _inclusive(Upper))
-}
-
-## Lower<..<Upper
-:range_ee = { (:Lower :Upper)
-    _range(_exclusive(Lower) _exclusive(Upper))
-}
-
-## Range from lower and upper boundaries
-:_range = { (:Lower_bound :Upper_bound)
-    value(
-        'lower' { Lower_bound.value }
-        'upper' { Upper_bound.value }
-        'lower_inclusive?' { Lower_bound.inclusive? }
-        'upper_inclusive?' { Upper_bound.inclusive? }
-        'op_match' { (:Case)
-            Lower_bound.bounds_lower?(Case) && Upper_bound.bounds_upper?(Case)
-        }
-        'show' { Lower_bound.show_as_lower + '..' + Upper_bound.show_as_upper }
-    )
-}
-
-## Inclusive boundary
-:_inclusive = { (:Value)
-    value(
-        'inclusive?' { true }
-        'value' { Value }
-        'bounds_lower?' { Value <= \0 }
-        'bounds_upper?' { \0 <= Value }
-        'show_as_lower' { Value.show }
-        'show_as_upper' { Value.show }
-    )
-}
-
-## Exclusive boundary
-:_exclusive = { (:Value)
-    value(
-        'inclusive?' { false }
-        'value' { Value }
-        'bounds_lower?' { Value < \0 }
-        'bounds_upper?' { \0 < Value }
-        'show_as_lower' { Value.show + '<' }
-        'show_as_upper' { '<' + Value.show }
-    )
-}

src/main/kink/internal/Rest.kn

-#!/usr/bin/env kink
-# vim: et sw=4 sts=4
-
-# Copyright (c) 2013 Miyakawa Taku
-# 
-# Permission is hereby granted, free of charge, to any person obtaining a copy
-# of this software and associated documentation files (the "Software"), to deal
-# in the Software without restriction, including without limitation the rights
-# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-# copies of the Software, and to permit persons to whom the Software is
-# furnished to do so, subject to the following conditions:
-# 
-# The above copyright notice and this permission notice shall be included in
-# all copies or substantial portions of the Software.
-# 
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-# THE SOFTWARE.
-
-:rest = { (:Lead :Rest)
-    :Value = value(
-        'op_set' { (:Args)
-            Lead = Args.head(Lead.count)
-            Rest = Args.drophead(Lead.count)
-            Value
-        }
-        'op_match' { (:Case)
-            Case.head(Lead.count) =~ Lead && Case.drophead(Lead.count) =~ Rest
-        }
-        'show' { ()
-            expand('#{ Lead.show }.rest(#{ Rest.show })')
-        }
-    )
-    Value
-}

src/main/kink/internal/START.kn

+#!/usr/bin/env kink
+# vim: et sw=4 sts=4
+
+# Copyright (c) 2013 Miyakawa Taku
+# 
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+# 
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+# 
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+# THE SOFTWARE.
+
+# Sart the program
+:start = { (:Args)
+    { _parse_and_do_command(Args) } .try.switch(
+        [true :Result] { Result }
+        [false :Exception] {
+            Exception.setStackTrace([])
+            Exception.throw
+        }
+    )
+}
+
+# Help text of the kink command
+:_help = { (:Out)
+    use('USING.using')
+    use('org.kink_lang.kink.Value')
+    using(Value.getClassLoader.getResourceAsStream('org/kink_lang/kink/help.txt')) {
+        \0.lines.map {
+            \0.chomp
+        } .loop {
+            Out.printline(\0)
+        }
+    }
+}
+
+# Parse Args as command and do it
+:_parse_and_do_command = { (:Args)
+    use('PARSE_COMMAND')
+    :Execute = ()
+    :Parser = PARSE_COMMAND.parser
+    .strictorder
+    .noarg('--help' '-h') {
+        _help(stdout)
+        exit
+    }
+    .noarg('--version' '-v') {
+        use('KINK_VERSION')
+        printline(expand('kink #{KINK_VERSION.version}'))
+        exit
+    }
+    .reqarg('--execute' '-e') {
+        :Execute.solid = \0
+    }
+    .onerror { (:Message)
+        stderr.printline(Message)
+        stderr.printline('')
+        _help(stderr)
+        die
+    }
+    :Args_after_opts = Parser.parse(Args)
+    switch(
+        { Execute.str?? } {
+            :Program = Execute.program('(execute)')
+            _run(Program Args_after_opts)
+        }
+        { ! Args_after_opts.any? } {
+            use('REPL')
+            REPL.repl.run
+        }
+        { Args_after_opts.first == '-' } {
+            :Program = stdin.bytes.program('(stdin)')
+            _run(Program Args_after_opts.drophead(1))
+        }
+        (any) {
+            :Filename = Args_after_opts.first
+            :Program = { path(Filename).program } .try.switch(
+                [true :Result] { Result }
+                [false :Exception] { die(Exception.message) }
+            )
+            _run(Program Args_after_opts.drophead(1))
+        }
+    )
+}
+
+# Run Program with Argv
+:_run = { (:Program :Argv)
+    :Env = module('CORE').child(
+        'Argv' Argv
+        'show' { > :Env
+            '<env:#of=' + Program.name.show + ':hash=' + Env.hash + '>'
+        }
+    )
+    Program.valid? || die(expand('#{Program.errordesc}'))
+    :runsource = Program.compile.notrace
+    runsource(Env)
+}

src/main/kink/internal/Start.kn

-#!/usr/bin/env kink
-# vim: et sw=4 sts=4
-
-# Copyright (c) 2013 Miyakawa Taku
-# 
-# Permission is hereby granted, free of charge, to any person obtaining a copy
-# of this software and associated documentation files (the "Software"), to deal
-# in the Software without restriction, including without limitation the rights
-# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-# copies of the Software, and to permit persons to whom the Software is
-# furnished to do so, subject to the following conditions:
-# 
-# The above copyright notice and this permission notice shall be included in
-# all copies or substantial portions of the Software.
-# 
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-# THE SOFTWARE.
-
-# Sart the program
-:start = { (:Args)
-    { _parse_and_do_command(Args) } .try.switch(
-        [true :Result] { Result }
-        [false :Exception] {
-            Exception.setStackTrace([])
-            Exception.throw
-        }
-    )
-}
-
-# Help text of the kink command
-:_help = { (:Out)
-    use('USING.using')
-    use('org.kink_lang.kink.Value')
-    using(Value.getClassLoader.getResourceAsStream('org/kink_lang/kink/help.txt')) {
-        \0.lines.map {
-            \0.chomp
-        } .loop {
-            Out.printline(\0)
-        }
-    }
-}
-
-# Parse Args as command and do it
-:_parse_and_do_command = { (:Args)
-    use('PARSE_COMMAND')
-    :Execute = ()
-    :Parser = PARSE_COMMAND.parser
-    .strictorder
-    .noarg('--help' '-h') {
-        _help(stdout)
-        exit
-    }
-    .noarg('--version' '-v') {
-        use('KINK_VERSION')
-        printline(expand('kink #{KINK_VERSION.version}'))
-        exit
-    }
-    .reqarg('--execute' '-e') {
-        :Execute.solid = \0
-    }
-    .onerror { (:Message)
-        stderr.printline(Message)
-        stderr.printline('')
-        _help(stderr)
-        die
-    }
-    :Args_after_opts = Parser.parse(Args)
-    switch(
-        { Execute.str?? } {
-            :Program = Execute.program('(execute)')
-            _run(Program Args_after_opts)
-        }
-        { ! Args_after_opts.any? } {
-            use('REPL')
-            REPL.repl.run
-        }
-        { Args_after_opts.first == '-' } {
-            :Program = stdin.bytes.program('(stdin)')
-            _run(Program Args_after_opts.drophead(1))
-        }
-        (any) {
-            :Filename = Args_after_opts.first
-            :Program = { path(Filename).program } .try.switch(
-                [true :Result] { Result }
-                [false :Exception] { die(Exception.message) }
-            )
-            _run(Program Args_after_opts.drophead(1))
-        }
-    )
-}
-
-# Run Program with Argv
-:_run = { (:Program :Argv)
-    :Env = module('CORE').child(
-        'Argv' Argv
-        'show' { > :Env
-            '<env:#of=' + Program.name.show + ':hash=' + Env.hash + '>'
-        }
-    )
-    Program.valid? || die(expand('#{Program.errordesc}'))
-    :runsource = Program.compile.notrace
-    runsource(Env)
-}

src/test/java/org/kink_lang/kink/ModulesTest.java

 
     @Test
     public void find_start_module_twice() {
-        Value start = Modules.find( "internal/Start" );
-        assertThat( Modules.find( "internal/Start" ) , is( start ) );
+        Value start = Modules.find( "internal/START" );
+        assertThat( Modules.find( "internal/START" ) , is( start ) );
     }
 
 
     @Test
     public void can_find_start_script() {
-        Value start = Modules.findKink( "internal/Start" );
+        Value start = Modules.findKink( "internal/START" );
         assertThat( start , is( notNullValue() ) );
     }
 
 
     @Test
     public void find_start_program() {
-        Program program = Modules.findProgram( "internal/Start" );
+        Program program = Modules.findProgram( "internal/START" );
         assertThat( program , is( notNullValue() ) );
     }
 

src/test/java/org/kink_lang/kink/internal/EnvsTest.java

 
     @Test
     public void use_module() {
-        Envs.use( env , "internal/Start" );
-        assertThat( env.get( new GetSite( "Start" ) ) , is( Modules.find( "internal/Start" ) ) );
+        Envs.use( env , "internal/START" );
+        assertThat( env.get( new GetSite( "START" ) ) , is( Modules.find( "internal/START" ) ) );
         assertThat( env.has( new GetSite( "start" ) ) , is( false ) );
     }
 
 
     @Test
     public void use_method() {
-        Envs.use( env , "internal/Start.start" );
-        assertThat( env.has( new GetSite( "Start" ) ) , is( false ) );
+        Envs.use( env , "internal/START.start" );
+        assertThat( env.has( new GetSite( "START" ) ) , is( false ) );
         assertThat( env.get( new GetSite( "start" ) ) , is( notNullValue() ) );
         assertThat( Envs.isImported( env , "start" ) , is( true ) );
     }
     public void use_fails_if_the_method_is_not_found() {
         expectedException.expect( KinkException.class );
         expectedException.expectMessage( "unknownmethod" );
-        Envs.use( env , "internal/Start.unknownmethod" );
+        Envs.use( env , "internal/START.unknownmethod" );
     }
 
 
 
     @Test
     public void use_succeeds_though_the_specified_module_is_already_defined() {
-        env.set( new SetSite( "Start" ) , Value.value() );
-        Envs.use( env , "internal/Start" );
-        assertThat( env.get( new GetSite( "Start" ) ) , is( Modules.find( "internal/Start" ) ) );
+        env.set( new SetSite( "START" ) , Value.value() );
+        Envs.use( env , "internal/START" );
+        assertThat( env.get( new GetSite( "START" ) ) , is( Modules.find( "internal/START" ) ) );
     }
 
 
     @Test
     public void use_succeeds_though_the_specified_method_is_already_defined() {
         env.set( new SetSite( "start" ) , Value.value() );
-        Envs.use( env , "internal/Start.start" );
+        Envs.use( env , "internal/START.start" );
         assertThat( env.get( new GetSite( "start" ) )
-                , is( Modules.find( "internal/Start" ).get( new GetSite( "start" ) ) ) );
+                , is( Modules.find( "internal/START" ).get( new GetSite( "start" ) ) ) );
     }
 
 

src/test/java/org/kink_lang/kink/internal/module/CoreTest.java

     @Test
     public void use_internal_start() {
         Value env = Envs.env();
-        env.call( USE , Value.value( "internal/Start" ) );
-        assertThat( env.get( new GetSite( "Start" ) ) , is( Modules.find( "internal/Start" ) ) );
+        env.call( USE , Value.value( "internal/START" ) );
+        assertThat( env.get( new GetSite( "START" ) ) , is( Modules.find( "internal/START" ) ) );
         assertThat( env.has( new GetSite( "start" ) ) , is( false ) );
     }
 
     @Test
     public void use_method_of_internal_start() {
         Value env = Envs.env();
-        env.call( USE , Value.value( "internal/Start.start" ) );
-        assertThat( env.has( new GetSite( "Start" ) ) , is( false ) );
+        env.call( USE , Value.value( "internal/START.start" ) );
+        assertThat( env.has( new GetSite( "START" ) ) , is( false ) );
         assertThat( env.get( new GetSite( "start" ) ) , is( notNullValue() ) );
     }
 

src/test/java/org/kink_lang/kink/internal/module/CountLoopTest.java

 
 
     /** CountLoop module. */
-    private final Value countLoop = Modules.find( "internal/CountLoop" );
+    private final Value countLoop = Modules.find( "internal/COUNT_LOOP" );
 
 
     @Test

src/test/kink/internal/ANY_TEST.kn

+#!/usr/bin/env kink
+# vim: et sw=4 sts=4
+
+# Copyright (c) 2013 Miyakawa Taku
+# 
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+# 
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+# 
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+# THE SOFTWARE.
+
+use('internal/ANY')
+use('TEST.test')
+
+test { ANY.any = 100 }
+test { 100.check(ANY.any) }
+test { 'foobar'.check(ANY.any) }
+test { ANY.any.show.check('any') }

src/test/kink/internal/AnyTest.kn

-#!/usr/bin/env kink
-# vim: et sw=4 sts=4
-
-# Copyright (c) 2013 Miyakawa Taku
-# 
-# Permission is hereby granted, free of charge, to any person obtaining a copy
-# of this software and associated documentation files (the "Software"), to deal
-# in the Software without restriction, including without limitation the rights
-# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-# copies of the Software, and to permit persons to whom the Software is
-# furnished to do so, subject to the following conditions:
-# 
-# The above copyright notice and this permission notice shall be included in
-# all copies or substantial portions of the Software.
-# 
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-# THE SOFTWARE.
-
-use('internal/Any')
-use('TEST.test')
-
-test { Any.any = 100 }
-test { 100.check(Any.any) }
-test { 'foobar'.check(Any.any) }
-test { Any.any.show.check('any') }

src/test/kink/internal/EXACT_TEST.kn

+#! kink
+# vim: et sw=4 sts=4
+
+# Copyright (c) 2013 Miyakawa Taku
+# 
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+# 
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+# 
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+# THE SOFTWARE.
+
+use('internal/EXACT.exacttyped')
+use('TEST.test')
+use('TEST.checkthrown')
+
+test {
+    use('JAVA.int')
+    use('java.lang.String')
+    use('java.lang.Object')
+    exacttyped('foobar' String).cancast?(String).check(true)
+    exacttyped('foobar' String).cancast?(Object).check(false)
+    exacttyped('foobar' String).cancast?(int).check(false)
+}
+
+test {
+    use('JAVA.int')
+    use('java.lang.String')
+    use('java.lang.Object')
+    exacttyped('foobar' Object).cancast?(String).check(false)
+    exacttyped('foobar' Object).cancast?(Object).check(true)
+    exacttyped('foobar' Object).cancast?(int).check(false)
+}
+
+test {
+    use('java.lang.String')
+    exacttyped('foobar' String).cast(String).check('foobar')
+}
+
+test {
+    use('java.lang.String')
+    exacttyped('foobar' String).show.check(expand("'foobar'.exact(#{String.show})"))
+}

src/test/kink/internal/EXPAND_TEST.kn

+#!/usr/bin/env kink
+# vim: et sw=4 sts=4
+
+# Copyright (c) 2013 Miyakawa Taku
+# 
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+# 
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+# 
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+# THE SOFTWARE.
+
+use('internal/EXPAND')
+use('TEST.test')
+use('TEST.checkthrown')
+
+test {
+    EXPAND.expand('no placeholder' \env).check('no placeholder')
+}
+
+test {
+    EXPAND.expand('## hash ##' \env).check('# hash #')
+}
+
+test {
+    EXPAND.expand('#-#-#' \env).check('#-#-#')
+}
+
+test {
+    [:Num :Str] = [42 'peng!']
+    EXPAND.expand('#Num  #Str' \env).check('42  peng!')
+}
+
+test {
+    :List = [10 20 30]
+    :Template = 'count=#{ List.count }'
+    EXPAND.expand(Template \env).check('count=3')
+}
+
+test {
+    :List = [10 20 30]
+    :Template = 'sum=#{ List.fold( 0 ) { \0 + \1 } }'
+    EXPAND.expand(Template \env).check('sum=60')
+}
+
+test {
+    :List = [10 20 30]
+    :Template = 'sum=#{ :calc = { List.fold( 0 ) { \0 + \1 } }  calc }'
+    EXPAND.expand(Template \env).check('sum=60')
+}
+
+test {
+    :List = [10 20 30]
+    EXPAND.expand('list=#List' \env).check('list=[10 20 30]')
+}
+
+test {
+    :List = [10 20 30]
+    EXPAND.expand('list=#{List}' \env).check('list=[10 20 30]')
+}
+
+test {
+    checkthrown { EXPAND.expand('invalid #{...'  \env) }
+}
+
+test {
+    [:Num :Str] = [42 'peng!']
+    EXPAND.expand('[#Num : #Str]' \env).check('[42 : peng!]')
+    EXPAND.expand('#Num ## #Str' \env).check('42 # peng!')
+    EXPAND.expand('#Num ## #{ Str.show }' \env).check("42 # 'peng!'")
+    EXPAND.expand("number:\n\t#Num" \env).check("number:\n\t42")
+    EXPAND.expand("#Num\n#Num" \env).check("42\n42")
+    EXPAND.expand("number:#{ Num\n }" \env).check("number:42")
+}

src/test/kink/internal/ExactTest.kn

-#! kink
-# vim: et sw=4 sts=4
-
-# Copyright (c) 2013 Miyakawa Taku
-# 
-# Permission is hereby granted, free of charge, to any person obtaining a copy
-# of this software and associated documentation files (the "Software"), to deal
-# in the Software without restriction, including without limitation the rights
-# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-# copies of the Software, and to permit persons to whom the Software is
-# furnished to do so, subject to the following conditions:
-# 
-# The above copyright notice and this permission notice shall be included in
-# all copies or substantial portions of the Software.
-# 
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-# THE SOFTWARE.
-
-use('internal/Exact.exacttyped')
-use('TEST.test')
-use('TEST.checkthrown')
-
-test {
-    use('JAVA.int')
-    use('java.lang.String')
-    use('java.lang.Object')
-    exacttyped('foobar' String).cancast?(String).check(true)
-    exacttyped('foobar' String).cancast?(Object).check(false)
-    exacttyped('foobar' String).cancast?(int).check(false)
-}
-
-test {
-    use('JAVA.int')
-    use('java.lang.String')
-    use('java.lang.Object')
-    exacttyped('foobar' Object).cancast?(String).check(false)
-    exacttyped('foobar' Object).cancast?(Object).check(true)
-    exacttyped('foobar' Object).cancast?(int).check(false)
-}
-
-test {
-    use('java.lang.String')
-    exacttyped('foobar' String).cast(String).check('foobar')
-}
-
-test {
-    use('java.lang.String')
-    exacttyped('foobar' String).show.check(expand("'foobar'.exact(#{String.show})"))
-}

src/test/kink/internal/ExpandTest.kn

-#!/usr/bin/env kink
-# vim: et sw=4 sts=4
-
-# Copyright (c) 2013 Miyakawa Taku
-# 
-# Permission is hereby granted, free of charge, to any person obtaining a copy
-# of this software and associated documentation files (the "Software"), to deal
-# in the Software without restriction, including without limitation the rights
-# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-# copies of the Software, and to permit persons to whom the Software is
-# furnished to do so, subject to the following conditions:
-# 
-# The above copyright notice and this permission notice shall be included in
-# all copies or substantial portions of the Software.
-# 
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-# THE SOFTWARE.
-
-use('internal/Expand')
-use('TEST.test')
-use('TEST.checkthrown')
-
-test {
-    Expand.expand('no placeholder' \env).check('no placeholder')
-}
-
-test {
-    Expand.expand('## hash ##' \env).check('# hash #')
-}
-
-test {
-    Expand.expand('#-#-#' \env).check('#-#-#')
-}
-
-test {
-    [:Num :Str] = [42 'peng!']
-    Expand.expand('#Num  #Str' \env).check('42  peng!')
-}
-
-test {
-    :List = [10 20 30]
-    :Template = 'count=#{ List.count }'
-    Expand.expand(Template \env).check('count=3')
-}
-
-test {
-    :List = [10 20 30]
-    :Template = 'sum=#{ List.fold( 0 ) { \0 + \1 } }'
-    Expand.expand(Template \env).check('sum=60')
-}
-
-test {
-    :List = [10 20 30]
-    :Template = 'sum=#{ :calc = { List.fold( 0 ) { \0 + \1 } }  calc }'
-    Expand.expand(Template \env).check('sum=60')
-}
-
-test {
-    :List = [10 20 30]
-    Expand.expand('list=#List' \env).check('list=[10 20 30]')
-}
-
-test {
-    :List = [10 20 30]
-    Expand.expand('list=#{List}' \env).check('list=[10 20 30]')
-}
-
-test {
-    checkthrown { Expand.expand('invalid #{...'  \env) }
-}
-
-test {
-    [:Num :Str] = [42 'peng!']
-    Expand.expand('[#Num : #Str]' \env).check('[42 : peng!]')
-    Expand.expand('#Num ## #Str' \env).check('42 # peng!')
-    Expand.expand('#Num ## #{ Str.show }' \env).check("42 # 'peng!'")
-    Expand.expand("number:\n\t#Num" \env).check("number:\n\t42")
-    Expand.expand("#Num\n#Num" \env).check("42\n42")
-    Expand.expand("number:#{ Num\n }" \env).check("number:42")
-}