Jump to content




How much chars can be comment out?


  • You cannot reply to this topic
4 replies to this topic

#1 Sewbacca

  • Members
  • 450 posts
  • LocationStar Wars

Posted 24 January 2016 - 12:59 PM

I want to comment out a serialized table:

--[[
...
serialized table
---
]]

But if the table is too big, it return an error.
How many chars can be comment out?

Edited by Sewbacca, 24 January 2016 - 05:48 PM.


#2 TheOddByte

    Lazy Coder

  • Members
  • 1,607 posts
  • LocationSweden

Posted 24 January 2016 - 01:08 PM

What error are you getting? What code are you using to comment out the table?( if you're not doing it manually ).
I don't think there is a limit to how much you can comment out, but I'm not 100% sure either.

#3 Wojbie

  • Members
  • 631 posts
  • LocationKinda lost

Posted 24 January 2016 - 01:38 PM

Could you provide example contents of table? It can be possible that inside of table you have ]] somewhere closing the long comment?
If that is the problem you can try making it less likely by using higher level long comments like:
--[======[
This is level 6 long comment.
]======]
Amount of = signifies level of comment. (no = is called lvl 0). It also allows you to comment out code that is already partially commented out by using higher level one.

Edited by Wojbie, 24 January 2016 - 01:40 PM.


#4 Bomb Bloke

    Hobbyist Coder

  • Moderators
  • 7,099 posts
  • LocationTasmania (AU)

Posted 24 January 2016 - 02:20 PM

Running some quick tests, I got up to over 15mb worth of a single block comment before getting bored. I reckon Wojbie's got the answer.

Edit:

Either that, or you're not testing your code within ComputerCraft itself. Emulators and whatever have differing behaviour, and that may well extend to comment parsing.

Edited by Bomb Bloke, 24 January 2016 - 02:27 PM.


#5 Sewbacca

  • Members
  • 450 posts
  • LocationStar Wars

Posted 24 January 2016 - 05:53 PM

Thanks





2 user(s) are reading this topic

0 members, 2 guests, 0 anonymous users