I've noticed that the algorithm used to color code the code in code blocks doesn't like the very popular practice of not closing your double quotes. This leads to sections of code being incorrectly colored as strings (green #080).

As you all know, in ti-basic, there are only 2 possible situations where an unclosed quote is assumed to be closed, and they can both be fairly easily accounted for:

  1. The end of the line is reached
  2. A → token is reached
We added code colors way back in the day and it was a very simple implementation, as you've discovered. I'm going to go ahead and move this topic to "Website Suggestions" since it's probably worth exploring how to make it smarter.
While we're at it, we could use some library to color code different languages. (I'm sure there is one that's available) It would be really easy to implement if we don't actually have to write it... And we would of course have regular code tags default to our ti-basic coloring.
Because right now, this happens...

Code:
for(int i = 0 ; i < 10; i++){
     System.out.println("Line" + i);
}

The tags could take arguments like this:
[code=java][/code]
So, what is the question? You don't like green color?
uchastokk wrote:
So, what is the question? You don't like green color?

mr womp womp is addressing the fact that the automatic code coloring doesn’t always work properly. This has nothing to do with color preferences.

I like the idea for the languages, though I don’t currently see how the coloring would need much change between different languages. Would be good to have some of that string coloring fixed though for sure.
uchastokk wrote:
So, what is the question? You don't like green color?

I'd completely forgotten about this thread, but no, it had nothing to do with what the colors are, but rather the fact that in TI-Basic, its very common to open quotes and never close them, because the parser is smart enough to deal with it. However, the code responsible for coloring code blocks on Cemetech isn't as smart as the TI-Basic parser in that regard and colors everything after an unclosed quote as if it were part of the string, even if it is on a different line or after a "→" token. I was proposing that the code behind the coloring be updated to account for these 2 extra rules.
Years later and it still isn’t fixed Razz
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement