Commits

Taku Miyakawa committed b02102b

Revert the name /str.to_lines -> .lines because the method is rather an attribute than conversion

Comments (0)

Files changed (5)

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

 
 
         @Define
-        public static Value to_lines( @Receiver String str ) {
+        public static Value lines( @Receiver String str ) {
             Matcher matcher = LF_PATTERN.matcher( str );
             ValueList result = new ValueList();
             int prevEnd = 0;

src/main/kink/REPL.kn

     'Program_num' 1
     'Prefix' 'kink'
     '_line_num' { > :Repl ()
-        Repl.Script.to_lines.count + 1
+        Repl.Script.lines.count + 1
     }
     'Env' Env_proto.child
     '_program_name' { > :Repl ()

src/test/bintest/test_module_test.kn

             Stdout.read_text
         }
         :Exit_status = Kink_process.waitFor
-        Stdout_text.to_lines.loop { (:Line)
+        Stdout_text.lines.loop { (:Line)
             print('Child (TEST.main/success): ' + Line)
         }
         Exit_status.check(0)
             Stdout.read_text
         }
         :Exit_status = Kink_process.waitFor
-        Stdout_text.to_lines.loop { (:Line)
+        Stdout_text.lines.loop { (:Line)
             print('Child (TEST.main/fail): ' + Line)
         }
         Exit_status.check(not(0))

src/test/java/org/kink_lang/kink/internal/box/StringEnhancerTest.java

     }
 
 
-    /** GetSite of {@code to_lines}. */
-    private static final GetSite TO_LINES = new GetSite( "to_lines" );
+    /** GetSite of {@code lines}. */
+    private static final GetSite LINES = new GetSite( "lines" );
 
 
     @Test
     public void test_lines_terminated_by_lf() {
         Value str = Value.value( "foo\nbar\n\nbaz\n\n" );
-        Value lines = str.call( TO_LINES );
+        Value lines = str.call( LINES );
         assertThat( lines.asList( () -> "" ).unboxElements( String.class )
                 , is( Arrays.asList( "foo\n" , "bar\n" , "\n" , "baz\n" , "\n" ) ) );
     }
     @Test
     public void test_lines_not_terminated_by_lf() {
         Value str = Value.value( "foo\nbar\n\nbaz" );
-        Value lines = str.call( TO_LINES );
+        Value lines = str.call( LINES );
         assertThat( lines.asList( () -> "" ).unboxElements( String.class )
                 , is( Arrays.asList( "foo\n" , "bar\n" , "\n" , "baz" ) ) );
     }

src/test/kink/issue/issue_0063_test.kn

 }
 
 test {
-    "foo\nbar\r\nbaz".to_lines.check( [ "foo\n"  "bar\r\n"  "baz" ] )
+    "foo\nbar\r\nbaz".lines.check( [ "foo\n"  "bar\r\n"  "baz" ] )
 }