Cabbage Logo
Back to Cabbage Site

Was playing around and found

Was playing around with cabbageCreate and found that when defining something’s colour attributes and you are passing a string that cabbage doesn’t require that string to be quoted. I also tried this with the “shape” attribute, and it doesn’t require a quoted string either…

So, my question is when are quotes really required? Is this something we should avoid? (Should we continue to make these quoted strings anyway?)

Thanks,

Mike

Darn it, no one was supposed to know!! :rofl:

It is true that you can write colour(purple), but wrapping it in "s means it easier to read because of syntax highlighting. Also, if you have a string token with a space, it will need to be wrapped, or Cabbage will try to parse 2 tokens. I’ve started using the {{ }} syntax for create strings. It means you don’t have to escape every ".

Not that I will make a habit of using unquoted strings, I will start using {{ }} more!

Ok, Rory, just wondered what the chances would be to have the syntax highlighting for the strings created with {{ }}? It’s obviously not that important, but it would be nice…

Hmm, that would be nice indeed. I’ll take a look…

Actually, it is nice having the syntax highlighting for the identifiers. I went back to a project that I started a while ago, and typing this out, I’ve kind of grown to like the “code” syntax highlighting its doing now… Maybe you need to get other people’s opinions…