0

I'm creating a gradle plugin using kotlin and I am inserting some ascii art. Rather than trying to escape a load of backslashes, I decided to use raw strings but now I'm encountering bizarre nameless errors whenever my line contains 2 vertical bars.

Here's some sample code:

println("""
        ] |___1
        ] ||__2
        ] |||_3 
        ] ||||4
        """.trimMargin("]"))

This results in the following errors in my message log:

Error:__2
Error:|_3
Error:||4

Does anyone know why this error is happening? I've overwritten the margin character so I don't understand why the vertical bar is still affecting the raw string. It's odd that it only happens from the second bar onward.

It's a purely cosmetic part of the project so it's not a huge deal if I have to remove it.

Any insight is appreciated!

Edit:

I've since restarted my computer and IDE and now the sample string I supplied doesn't cause those errors. However my ascii string still does so I'll supply a snippet of the art that gives errors.

I'm also using kotlin 1.1.0 and have tried downgrading to 1.0.6 and still see the errors.

New sample code:

println("""
        ]                      \                    ^    /^
        ]                       \                  / \  // \
        ]                        \   |\___/|      /   \//  .\
        ]                         \  /O  O  \__  /    //  | \ \           *----*
        ]                           /     /  \/_/    //   |  \  \          \   |
        ]                           @___@`    \/_   //    |   \   \         \/\ \
        ]                          0/0/|       \/_ //     |    \    \         \  \
        ]                      0/0/0/0/|        \///      |     \     \       |  |
        ]                   0/0/0/0/0/_|_ /   (  //       |      \     _\     |  /
        ]                0/0/0/0/0/0/`/,_ _ _/  ) ; -.    |    _ _\.-~       /   /
        """.trimMargin("]"))

Gives these errors:

Error:/   \//  .\
Error:
Error:\    \         \  \
Error:\     \       |  |
Error:\     _\     |  /
ddowney
  • 1
  • 1

0 Answers0