The PocketMatrix forums now provide C / C++ syntactic keyword coloring for source code wrapped with the [ code ] tags.
If you see any problems, or have suggestions, please post them to this thread.
There are a few known limitations to this script:
Precompiler directives are not properly recognized if the pound sign (#) is not immediately in front of the directive name.
Filename strings for #include directives that specify a search path are not colored as a string.
Tabs are currently replaced with 4 spaces. That will cause alignment problems when the tabs are not the first characters on the line. This problem already existed with the [ code ] tags before the new script.
I am also considering not displaying line numbers if there are less than a predefined number of lines. Same with the source code stats. Give some suggestions on what you feel the cutoff number of lines should be (probably 3 or 4).
Finally, the CODE blocks are now C / C++ specific. If you use them to post other languages, the coloring will not properly match.
Here's a sample showing the above issues:
Dan East
If you see any problems, or have suggestions, please post them to this thread.
There are a few known limitations to this script:
Precompiler directives are not properly recognized if the pound sign (#) is not immediately in front of the directive name.
Filename strings for #include directives that specify a search path are not colored as a string.
Tabs are currently replaced with 4 spaces. That will cause alignment problems when the tabs are not the first characters on the line. This problem already existed with the [ code ] tags before the new script.
I am also considering not displaying line numbers if there are less than a predefined number of lines. Same with the source code stats. Give some suggestions on what you feel the cutoff number of lines should be (probably 3 or 4).
Finally, the CODE blocks are now C / C++ specific. If you use them to post other languages, the coloring will not properly match.
Here's a sample showing the above issues:
- Code:
#define SOMETHING //works properly
# define SOMETHING_ELSE //# and define should be blue
#include "stdio.h" //works
#include <stdio.h> //doesn't work
/*The following 3 numbers should all be aligned*/
#define AN_ITEM 1
#define ANOTHER_ITEM 2
#define THIRD_ITEM 3
Dan East