C++ Syntax highlighting?

Status
Not open for further replies.

Tru_Power22

You can change this now in User CP.
Reaction score
144
Well, I'm just thinking, we have it for Jass and PHP. But PHP tag isn't used a whole lot (I find). One that would be used much more is C++. I mean look at the programming forum. Ever second post is about C++ (or C#, but I mean they have nearly the same syntax, so I don't think it would matter).

[cpp]
#include <iostream>
int main()
{
std::cout << "I'm sad that this isn't real" << endl;
return 0;
}
[/cpp]

So is it possible to see some nice CPP tags in the future?
 

Vestras

Retired
Reaction score
249
Samuraid said:
If we wanted to support other language syntaxes, we'd need to mod the forums and use a syntax hilighter like GeSHi

I believe phyrex modded GeSHi to be faster (yeah, phyrex can do everything, lol) for the Jass highlighting, so why not modify it to also support other languages?

Tru_Power22 said:
they have nearly the same syntax

Syntax = no; keywords = yes :)

EDIT: Actually, since I also made a syntax highlighter, I have a list of C++ keywords, I guess I could contribute:
C++
Code:
          __cdecl
          __clrcall
          __declspec
          __fastcall
          __int32
          __int64
          __restrict
          __sptr
          __stdcall
          __thiscall
          __unaligned
          __uptr
          __w64
          and
          and_eq
          asm
          auto
          bitand
          bitor
          bool
          break
          case
          cast
          catch
          char
          class
          compl
          const
          const_cast
          continue
          default
          delete
          do
          double
          dynamic_cast
          else
          enum
          explicit
          export
          extern
          false
          float
          for
          friend
          goto
          if
          inline
          int
          long
          mutable
          namespace
          new
          not
          not_eq
          operator
          or
          or_eq
          private
          protected
          public
          register
          reinterpret_cast
          return
          short
          signed
          sizeof
          static
          static_cast
          struct
          switch
          template
          this
          throw
          true
          try
          typedef
          typeid
          typename
          union
          unsigned
          using
          virtual
          void
          volatile
          wchar_t
          while
          xor
          xor_eq

Oh, awesome, I have more :eek:

C#
Code:
          abstract
          event
          new
          struct
          as
          explicit
          null
          switch
          base
          extern
          object
          this
          bool
          false
          operator
          throw
          break
          finally
          out
          true
          byte
          fixed
          override
          try
          case
          float
          params
          typeof
          catch
          for
          private
          uint
          char
          foreach
          protected
          ulong
          checked
          goto
          public
          unchecked
          class
          if
          readonly
          unsafe
          const
          implicit
          ref
          ushort
          continue
          in
          return
          using
          decimal
          int
          sbyte
          virtual
          default
          interface
          sealed
          volatile
          delegate
          internal
          short
          void
          do
          is
          sizeof
          while
          double
          lock
          stackalloc
          else
          long
          static
          enum
          namespace
          string

VB.NET
Code:
Sub
Function
Property
Declare
Public
Private
Protected
Overrides
Shared
Event
Shadows
Friend
Dim
Global
Option
Explicit
Not
And
Xor
Or
String
Long
Integer
Boolean
Currency
Date
Byte
Single
Double
Static
As
Const
Inherits
Implements
kuko
Imports

VbCrLf
VbCr
VbLf

AddHandler 
AddressOf 
Alias 
And 
AndAlso 
Ansi 
As 
Assembly 
Auto 
Boolean 
ByRef 
Byte 
ByVal 
Call 
Case 
Catch 
CBool 
CByte 
CChar 
CDate 
CDec 
CDbl 
Char 
CInt 
Class 
CLng 
CObj 
Const 
CShort 
CSng 
CStr 
CType 
Date 
Decimal 
Declare 
Default 
Delegate 
Dim 
DirectCast 
Do 
Double 
Each 
Else 
ElseIf 
End 
Enum 
Erase 
Error 
Event 
Exit 
False 
Finally 
For 
Friend 
Function 
Get 
GetType 
GoTo 
Handles 
If 
Imports 
In 
Inherits 
Integer 
Interface 
Is 
Let 
Lib 
Like 
Long 
Loop 
Me 
Mod 
Module 
MustInherit 
MustOverride 
MyBase 
MyClass 
Namespace 
New 
Next 
Not 
Nothing 
NotInheritable 
NotOverridable 
Object 
On 
Option 
Optional 
Or 
OrElse 
Overloads 
Overridable 
Overrides 
ParamArray 
Preserve 
Private 
Property 
Protected 
Public 
RaiseEvent 
ReadOnly 
ReDim 
RemoveHandler 
Resume 
Return 
Select 
Set 
Shadows 
Shared 
Short 
Single 
Static 
Step 
Stop 
String 
Structure 
Sub 
SyncLock 
Then 
Throw 
To 
True 
Try 
TypeOf 
Unicode 
Until 
Variant 
When 
While 
With 
WithEvents 
WriteOnly 
Xor

I also have for Python, Perl, Delphi, CSS, and JavaScript (also some more, too lazy to list them all)
Just tell me if you want them :)
 

Xorifelse

I'd love to elaborate about discussions...........
Reaction score
87
Correct, PHP syntax hilighting comes with PHP in the form of the highlight_string()

If we wanted to support other language syntaxes, we'd need to mod the forums and use a syntax hilighter like GeSHi

My experience with GeSHi is that it's slow, and that it consumes a lot of power from the server. Try client side syntax highlighters, where if a syntax is relevant to the user, he could click a button in the header of the code and that it converts the text to a syntax. This is the best way to do this, in my opinion.

Or upgrade vBulletin locally, where there are 2 contents of each post. The converted one (full HTML code), and the editable (bb tags) one.
 

phyrex1an

Staff Member and irregular helper
Reaction score
447
My experience with GeSHi is that it's slow, and that it consumes a lot of power from the server.
This is my experience too. We used to use GeSHi for the jass tags, but switched to a hand made solution for performance reasons.

>I believe phyrex modded GeSHi to be faster (yeah, phyrex can do everything, lol) for the Jass highlighting
I "only" managed to make it 3 times faster or so (for the jass tags, probably broke a lot of other languages in the process) and that wasn't enough.

GeSHi is still installed on the server so using it for other languages is possible. The likeliness of me adding is proportional to the activity of the programming forum *hint*. Or bribe Ghan, I hear he has very flexible payment alternatives. :p
 

Romek

Super Moderator
Reaction score
964
I think the problem is that we don't know if it's worth adding the C++ highlighter, rather than we don't know how to add it, or what to add.
 

Samuraid

Advisor
Reaction score
81
Or upgrade vBulletin locally, where there are 2 contents of each post. The converted one (full HTML code), and the editable (bb tags) one.
vBulletin already has a parsed post cache, although I am not aware if it is enabled currently or not. (If it isn't it should be)
 
Reaction score
341
Why not just add something generic that only highlights certain things;

{}, if, while, do, for, strings, floats, integers

That should give at least some highlighting for most languages and is easy to implement.

You could even just make a ripoff of your Jass tags to support that.

Because honestly, this is not a programming heavy forum (aside from Jass).
 

Tru_Power22

You can change this now in User CP.
Reaction score
144
Why not just add something generic that only highlights certain things;

{}, if, while, do, for, strings, floats, integers

That should give at least some highlighting for most languages and is easy to implement.

You could even just make a ripoff of your Jass tags to support that.

Because honestly, this is not a programming heavy forum (aside from Jass).

That's not really true. There are quite a few C++ threads in the programming forum.
 

UndeadDragon

Super Moderator
Reaction score
447
Nothing compared to the Jass threads.

This.

For the amount of work that it would take to add the new tags, it would not be worth it, because of the lack of C++ threads.
 

Vestras

Retired
Reaction score
249
This.

For the amount of work that it would take to add the new tags, it would not be worth it, because of the lack of C++ threads.

But not having C++ syntax highlighting could just aswell be one of the things blocking TH from being more for the programming guys.
 
Reaction score
341
I highly doubt it. TheHelper is always going to be the place for blizzard game support.

The programming forum only has like what? 300 posts?
 

Tru_Power22

You can change this now in User CP.
Reaction score
144
I highly doubt it. TheHelper is always going to be the place for blizzard game support.

The programming forum only has like what? 300 posts?

I'm working on a game and planning to paste the source code in the programming forum (It's pretty small). Syntax Highlighting would be nice.
 

tom_mai78101

The Helper Connoisseur / Ex-MineCraft Host
Staff member
Reaction score
1,712
Here's what we can predict for the C++ Syntax Highlighting feature.

When Starcraft 2 is out, we will be seeing many threads with the Galaxy language. Since Galaxy is based on C, it is possible (if not, certainly) C/C++ syntax highlighting will be added as a new feature corresponding to the release of the game itself.

For now, I can be sure that it won't be implemented until the end of this year.
 

Vestras

Retired
Reaction score
249
Here's what we can predict for the C++ Syntax Highlighting feature.

When Starcraft 2 is out, we will be seeing many threads with the Galaxy language. Since Galaxy is based on C, it is possible (if not, certainly) C/C++ syntax highlighting will be added as a new feature corresponding to the release of the game itself.

For now, I can be sure that it won't be implemented until the end of this year.

Jass was 'based' on C, too ;)
 
Status
Not open for further replies.
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though
  • Ghan Ghan:
    Heard Houston got hit pretty bad by storms last night. Hope all is well with TH.
  • The Helper The Helper:
    Power back on finally - all is good here no damage
    +2
  • V-SNES V-SNES:
    Happy Friday!
    +1
  • The Helper The Helper:
    New recipe is another summer dessert Berry and Peach Cheesecake - https://www.thehelper.net/threads/recipe-berry-and-peach-cheesecake.194169/

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top