Seems the use of // comments, whitespace, ordering things, all break things for reasons that I can’t make sense of. Perhaps just part of the way it is checked for errors? Not sure.

Anyway, I’ve made a generator here: https://perchance.org/1jt36ldioy#edit demonstrating. All the error-producing code is commented out so it doesn’t raise an error. Just uncomment one and you’ll see the error for that particular one.

  • VioneTM
    link
    English
    1
    edit-2
    2 months ago

    The // comment comments only work on the Lists Panel. Or on the <script> tag on the HTML panel. Or within square brackets.

    You need to use standard <!-- Comment --> for the HTML panel.

    [
      a = 'hello'
      // test
      // last output on square brackets should always output something displayable (text)
      b = 'world'
      'a text'
    ]
    <br>
    [
      a+b
    ]
    

    This works on the HTML panel.

    • @wthit56OP
      link
      English
      12 months ago
      ["hello"
      // hi
      ]
      

      That is a square-bracket piece of code, with a comment inside, as you said. All the examples are in square-bracket code. So… 👀

      The last output in those square brackets is "hello", a displayable text string. The comment should be ignored, right? That’s the point of a comment; that it’s not processed in any way.

      I think there’s just something about the way it’s processed and it’s erroneously thinking the comment is meant to be output. Which is definitely not the expected way comments work. Hence “odd errors and messages.” It’s not consistent with the concept of a comment, or just generally how comments work.

      (Plus those other weird situations too.)