Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

AirCode doesn't like block comments

edited May 2014 in Bugs Posts: 212

Aircode does not like --[[ ]]-- comments. If they're in your code, any code that occurs after they close will not be highlighted with the proper syntax highlighting. it'll all appear as comments.

This is with the latest version of Codea, using AirCode inside Chrome.

Comments

  • Jmv38Jmv38 Mod
    edited May 2014 Posts: 3,295

    the ending of a block comment should be --]] and not ]]--. Maybe that is the pb?

  • Posts: 212

    yup, that fixed it! Thanks! derp derp on my part!

  • Posts: 212

    It's still odd that ]] followed by -- would result in all text following the --'s would be formatted as comments

  • Jmv38Jmv38 Mod
    edited May 2014 Posts: 3,295

    i am not sure it is odd. '[[ ... ]]' is one big text bloc (with multiple line returns allowed).
    So '--[[ ... ]]' is: comment this text bloc.
    then '--[[ ... ]]-- xxx' is: comment this '--[[ ... ]]' then comment that '-- xxx'.
    This could be the logic.

  • Posts: 1,595

    @Jmv38 You're correct, it works like that --[[ comment here ]] end of comment, the two dashes at the end don't make a difference to the block comment but that line after it.

  • Posts: 212

    Just an update that AirCode still doesn't like block comments at the top of a file.

    paste this code here into a tab and open it in AirCode, you'll see what I mean:

    http://codea.io/talk/discussion/2806/long-press-event-detection/p1

  • edited October 2014 Posts: 99

    On my mac, the same problem.

    I add comment to the code:

    for i,v in pairs(box) do
          --print("box."..i.."="..v)
          print(v)
    end
    

    Pic before block comment:
    image

    Pic after block comment:
    image

    image

  • This problem still exists @luatee @simeon

  • Posts: 1,976

    @matkatmusic Codea hasn't received an update yet, why did you assume it was fixed?

  • @matkatmusis I have the same problem with air code. I'd avoid using it till its farther on in development. Theres lot of other problems that make it hard to seriously try to use it for any duration.

  • dave1707dave1707 Mod
    Posts: 7,554

    @matkatmusic I don't use Air Code so I can't try this. But the block comment below also works in Codea. Does it work in Air Code. The ending --]] doesn't require the --.


    --[[ some code ]]
Sign In or Register to comment.