GIDForums  

Go Back   GIDForums > Site Info and Feedback > GIDNetwork™ > GIDForums™
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 04-Sep-2004, 06:13
JdS's Avatar
JdS JdS is offline
Senior Member
 
Join Date: Aug 2001
Location: KUL, Malaysia
Posts: 3,371
JdS will become famous soon enough

[todo] : bugs - C++ Syntax Highlighter


This is a list of forum pages that contain / display bugs within the syntax highlighted code for c/c++. Please feel free to reply to this thread with any new examples so I may keep the list updated.

The really obvious bug with highlighted_keywords (when used as part of a variable name) is one the first things I am going to fix when I re-do the syntax highlighter so it is not necessary to point out threads that contain them. For example, look at new_rec in the example code below:

CPP / C++ / C Code:
int insert_record(char *word,char *where)
{
  struct node *cur_ptr;    //to hold the current record to work on
  struct node *new_rec;  //create a new node to insert
  struct node *prev;
  #2  
Old 20-May-2005, 08:42
admin's Avatar
admin admin is offline
Administrator
 
Join Date: Sep 2002
Posts: 754
admin will become famous soon enough
I am pleased to announce that the C/C++ syntax highlighter bbcode on GIDForums™ is now upgraded.

The bugs that existed before this upgrade, are now all fixed. Please let me know if you find new ones.
__________________
Custom BB codes you can use here:
[HTML] | [C++] | [CSS] | [JAVA] | [PY] | [VB]
  #3  
Old 27-Mar-2006, 08:18
cable_guy_67's Avatar
cable_guy_67 cable_guy_67 is offline
Senior Member
 
Join Date: Oct 2004
Location: Nescopeck, PA
Posts: 1,109
cable_guy_67 is a jewel in the roughcable_guy_67 is a jewel in the roughcable_guy_67 is a jewel in the roughcable_guy_67 is a jewel in the rough

Re: [todo] : bugs - C++ Syntax Highlighter


During the thread moves LuciWiz and I have both noticed a disturbing break of the [c] tag.

Example:
[c]
/* code to show bug in
CPP / C++ / C Code:
...
bbcode */
int i[50];
int c = 10;
printf("i
CPP / C++ / C Code:
 = %d",i[c]);

Same thing in a noparse tag

/* code to show bug in [c]...[/c] bbcode */
int i[50];
int c = 10;
printf("i[c] = %d",i[c]);


MORE TESTING BELOW
[c++]
/* code to show bug in
CPP / C++ / C Code:
...
bbcode */
int i[50];
int c = 10;
printf("i
CPP / C++ / C Code:
 = %d",i[c++]);
c++;

Same thing in a noparse tag

/* code to show bug in [noparse]... bbcode */
int i[50];
int noparse = 10;
printf("i = %d",i[noparse]);
__________________
"Opportunity is missed by most people because it comes dressed in overalls and looks like work."
--Thomas Alva Edison
"Those who would give up essential liberty to purchase a little temporary safety, deserve neither liberty nor safety."
--Benjamin Franklin
"A happy person is not a person in a certain set of circumstances, but rather a person with a certain set of attitudes."
--Hugh Downs
  #4  
Old 04-Apr-2006, 09:43
LuciWiz's Avatar
LuciWiz LuciWiz is offline
Moderator
 
Join Date: Jul 2004
Location: Cluj-Napoca (Romania)
Posts: 893
LuciWiz is a jewel in the roughLuciWiz is a jewel in the roughLuciWiz is a jewel in the roughLuciWiz is a jewel in the rough

Re: [todo] : bugs - C++ Syntax Highlighter


Will try


/*//tricky comment
*/


CPP / C++ / C Code:
/*//tricky comment
*/

A space seems to solve the problem:

CPP / C++ / C Code:
/* //tricky comment
*/

Note: These kind of imbricated comments are allowed in C++/Java, and are used prety frequently used even in production code. Of course, I guess they are usually on separate rows, like:
CPP / C++ / C Code:
/*
// one-lin comment
// another one of those
*/

Or rather, many experienced programmers would use an #idef, like:

CPP / C++ / C Code:
#ifdef 0
    // one-lin comment
    // another one of those
#endif

Therefore, the problem has a small incidence.

Best regards,
Lucian
__________________
Please read these Guidelines before posting on the forum

"A person who never made a mistake never tried anything new."
Einstein
  #5  
Old 04-Apr-2006, 22:20
admin's Avatar
admin admin is offline
Administrator
 
Join Date: Sep 2002
Posts: 754
admin will become famous soon enough

Re: [todo] : bugs - C++ Syntax Highlighter


Mark,

I really don't understand the bug you're trying to describe. Can you try again... or send me a link to an existing thread that has this problem?

Lucian,

I will try to figure out how to fix this right now.
__________________
Custom BB codes you can use here:
[HTML] | [C++] | [CSS] | [JAVA] | [PY] | [VB]
  #6  
Old 04-Apr-2006, 23:55
WaltP's Avatar
WaltP WaltP is offline
Outstanding Member
 
Join Date: Feb 2004
Location: Midwest US
Posts: 3,243
WaltP is a name known to allWaltP is a name known to allWaltP is a name known to allWaltP is a name known to allWaltP is a name known to allWaltP is a name known to all

Re: [todo] : bugs - C++ Syntax Highlighter


He's saying that if you have code in c-tags like this:

[c]
/* code to show bug in [c]...[/c] bbcode */
int i[50];
int c = 10;
printf("i[c] = %d",i[c]);
[/c]

The code tags are not parsed properly, giving

[c]
/* code to show bug in
CPP / C++ / C Code:
...
bbcode */
int i[50];
int c = 10;
printf("i[c] = %d",i
CPP / C++ / C Code:
);
__________________

Age is unimportant -- except in cheese
  #7  
Old 05-Apr-2006, 06:05
admin's Avatar
admin admin is offline
Administrator
 
Join Date: Sep 2002
Posts: 754
admin will become famous soon enough

Re: [todo] : bugs - C++ Syntax Highlighter


Testing 1, 2, 3...

CPP / C++ / C Code:
/* code to show bug in [c]...[/c] bbcode */
int i[50];
int c = 10;
printf("i[c] = %d",i[c]);

Well, there is nothing much I can do to fix this issue. But if you really must use [c] in your example code, you should use the [c++] bbcode instead -- which is why it exists.
__________________
Custom BB codes you can use here:
[HTML] | [C++] | [CSS] | [JAVA] | [PY] | [VB]
  #8  
Old 05-Apr-2006, 21:41
admin's Avatar
admin admin is offline
Administrator
 
Join Date: Sep 2002
Posts: 754
admin will become famous soon enough

Re: [todo] : bugs - C++ Syntax Highlighter


I fixed the multiline comment issue...

CPP / C++ / C Code:
/**/
int i[50];
/*/
 testing
*/
int j[50];
__________________
Custom BB codes you can use here:
[HTML] | [C++] | [CSS] | [JAVA] | [PY] | [VB]
 
 

Recent GIDBlogMeeting the local Iraqis by crystalattice

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Winsock error when compiling FLTK 2.0 Projects mauriciorossi FLTK Forum 3 16-Aug-2005 10:18
Help with syntax errors PeteGallo C Programming Language 7 08-Aug-2005 20:30
C++ PhoneBook marita C++ Forum 46 12-Jun-2005 12:10
Syntax Highlighter BBCode ashishjha54 GIDForums™ 1 20-May-2005 06:14
C++ Syntax Highlighter related question JdS GIDForums™ 4 25-Oct-2004 08:00

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 19:45.


vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.