Java-Gaming.org Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (796)
Games in Android Showcase (234)
games submitted by our members
Games in WIP (864)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Bug with Code Blocks  (Read 4764 times)
0 Members and 1 Guest are viewing this topic.
Offline ra4king

JGO Kernel


Medals: 508
Projects: 3
Exp: 5 years


I'm the King!


« Posted 2015-02-09 04:25:38 »

Hopefully this isn't my browser being strange again, but there is an issue with the syntax highlighter, as can be visible by this post: http://www.java-gaming.org/topics/rendering-text-in-lwjgl-without-slick/35535/view.html
Can others see the red highlighting?

Offline SHC
« Reply #1 - Posted 2015-02-09 04:27:59 »

Yes, I can see that too. The highlighter is not recognising escaped double quotes. \" is taken as the end of string.

Offline BurntPizza

« JGO Bitwise Duke »


Medals: 486
Exp: 7 years



« Reply #2 - Posted 2015-02-09 04:28:28 »

Looks like the open single-quote.

Testing 1 2 3
1  
2  
3  
Hello ' World This is
a
'
Test
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline ra4king

JGO Kernel


Medals: 508
Projects: 3
Exp: 5 years


I'm the King!


« Reply #3 - Posted 2015-02-09 04:31:42 »

Yup it's the single quote, not the double quote. The single quotes and contents proceeding should not be highlighted if there isn't a closing single quote at most 1 character away (2 for escaped characters).

Offline SHC
« Reply #4 - Posted 2015-02-09 04:42:51 »

Both are the problems. Here is another test case (modified from original)

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
   private final Map<Integer,String> CHARS = new HashMap<Integer,String>() {{
        put(0, "ABCDEFGHIJKLMNOPQRSTUVWXYZ");
        put(1, "abcdefghijklmnopqrstuvwxyz");
        put(2, "0123456789");
        put(3, "ÄÖÜäöüß");
        put(4, " $+-*/=%\"''#@&_(),.;:?!\\|<>[]§`^~");
    }};
   
   //Variables
    private java.awt.Font font;
    private FontMetrics fontMetrics;

You see? The string ended there.

Offline TheBoneJarmer

Junior Devvie


Medals: 6
Exp: 1-3 months


hi!


« Reply #5 - Posted 2015-02-09 10:41:39 »

I noticed the same thing. As far as I know, this is a bug in SMF. Same thing happened at the LWJGL forum. I wonder if the SMF developers are aware of it. Otherwise perhaps an idea to send a bug report?
Offline Riven
Administrator

« JGO Overlord »


Medals: 1369
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #6 - Posted 2015-02-09 10:57:44 »

I wrote the java syntax highlighter, so it's not a bug in SMF.

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social rankings!
Pages: [1]
  ignore  |  Print  
 
 

 
hadezbladez (3627 views)
2018-11-16 13:46:03

hadezbladez (1292 views)
2018-11-16 13:41:33

hadezbladez (3633 views)
2018-11-16 13:35:35

hadezbladez (695 views)
2018-11-16 13:32:03

EgonOlsen (3998 views)
2018-06-10 19:43:48

EgonOlsen (4525 views)
2018-06-10 19:43:44

EgonOlsen (2686 views)
2018-06-10 19:43:20

DesertCoockie (3546 views)
2018-05-13 18:23:11

nelsongames (3699 views)
2018-04-24 18:15:36

nelsongames (4722 views)
2018-04-24 18:14:32
Java Gaming Resources
by philfrei
2019-05-14 16:15:13

Deployment and Packaging
by philfrei
2019-05-08 15:15:36

Deployment and Packaging
by philfrei
2019-05-08 15:13:34

Deployment and Packaging
by philfrei
2019-02-17 20:25:53

Deployment and Packaging
by mudlee
2018-08-22 18:09:50

Java Gaming Resources
by gouessej
2018-08-22 08:19:41

Deployment and Packaging
by gouessej
2018-08-22 08:04:08

Deployment and Packaging
by gouessej
2018-08-22 08:03:45
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!