Raised This Month: $62 Target: $400
 15% 

Regarding certain statements and such.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
IQuitTF2AndYouShouldToo
( ͡ ͜ʖ ͡)
Join Date: Dec 2011
Old 11-18-2016 , 21:02   Regarding certain statements and such.
Reply With Quote #1

So I'm currently working on a Notepad++ syntax highlighting project to create a new syntax highlighting setup for SourcePawn. I'm basing most of it off of Notepad++'s stock C++ highlighting. Here's how I've organized things like statements thus far.

Keywords1: new for if else do while switch case default return break continue sizeof true false typedef delete

Keywords2: Plugin Action void int float char bool Float String any Handle decl stock forward funcenum functag native function methodmap property typeset view_as cast_as var let public const enum static union struct

And for operators, I've got the following:
Code:
<Keywords name="Operators1">! @ % ^ &amp; * ( ) - | || = + ~ [ ] . , : ; / &lt; &gt; &lt;= =&lt; &gt;= =&gt; ?</Keywords>
<Keywords name="Operators2"></Keywords> // Empty
Is there anything I'm missing from these? Also, is there anything that SourcePawn as a language doesn't use that I should remove? I want to make sure I'm not missing anything before I start adding in .inc file class/type highlighting.

Here's what I've got style-wise so far. I plan to release this once I finish it. Also, I'm open to suggestions about the highlighting color/bold/etc of specific things.
- My highlighting (font is Inconsolata, before you even ask )
- Notepad++'s stock C++ highlighting, for comparison

Last edited by IQuitTF2AndYouShouldToo; 11-18-2016 at 21:02.
IQuitTF2AndYouShouldToo is offline
blaacky
Senior Member
Join Date: Oct 2012
Old 11-20-2016 , 00:07   Re: Regarding certain statements and such.
Reply With Quote #2

Maybe << and >>?
blaacky is offline
shavit
AlliedModders Donor
Join Date: Dec 2011
Location: Israel
Old 11-20-2016 , 00:49   Re: Regarding certain statements and such.
Reply With Quote #3

Quote:
Originally Posted by abrandnewday View Post
I'll add those in under...er...operators, I assume? I do want to release this highlighting thing when I finish it so I want it to be as complete as possible.

I'm also looking into utilizing some regex expressions in Notepad++'s functionList.xml file to allow for highlighting of certain things similar to how Notepad++ does highlighting for languages such as CPP. It's been really quite interesting learning regex because I always saw it as a confusing clusterfuck of symbols.
I believe << and >> are used to shift.
< and > are operators.
__________________
retired
shavit is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 11-20-2016 , 01:12   Re: Regarding certain statements and such.
Reply With Quote #4

Quote:
Originally Posted by shavit View Post
I believe << and >> are used to shift.
< and > are operators.
...bit-shift operators are still operators.

Edit: For that matter, ++ and -- are also operators
__________________
Not currently working on SourceMod plugin development.

Last edited by Powerlord; 11-20-2016 at 01:15.
Powerlord is offline
Maxximou5
AlliedModders Donor
Join Date: Feb 2013
Old 11-20-2016 , 02:45   Re: Regarding certain statements and such.
Reply With Quote #5

You might as well add in such things as += and -= as well.
__________________
Maxximou5 is online now
luki1412
Veteran Member
Join Date: Oct 2008
Location: OnPluginStart()
Old 11-20-2016 , 17:53   Re: Regarding certain statements and such.
Reply With Quote #6

Quote:
Originally Posted by abrandnewday View Post
I was trying to remember what those two were.
https://en.wikipedia.org/wiki/Operat..._C_and_C%2B%2B
__________________
luki1412 is offline
blaacky
Senior Member
Join Date: Oct 2012
Old 11-20-2016 , 19:42   Re: Regarding certain statements and such.
Reply With Quote #7

And /=, *= ^=, &=, |=, <<=, >>=, %=

Last edited by blaacky; 11-20-2016 at 19:45.
blaacky is offline
klippy
AlliedModders Donor
Previously known as:
KliPPy
Join Date: May 2013
Location: Serbia
Old 11-21-2016 , 04:21   Re: Regarding certain statements and such.
Reply With Quote #8

SourcePawn should have (AMXX Pawn does) >>> and >>>= operators too. Can't test right now, I'm on phone.

EDIT:
Just tested it, works.

Last edited by klippy; 11-21-2016 at 06:14.
klippy is offline
klippy
AlliedModders Donor
Previously known as:
KliPPy
Join Date: May 2013
Location: Serbia
Old 11-21-2016 , 16:31   Re: Regarding certain statements and such.
Reply With Quote #9

There is no left arithmetic shift.
klippy is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 11-21-2016 , 16:49   Re: Regarding certain statements and such.
Reply With Quote #10

Quote:
Originally Posted by KliPPy View Post
There is no left arithmetic shift.
Which makes sense if you know what right arithmetic shift does.

i.e. it makes the number keep the same sign in a Two's Complement number system, which is what Pawn, C, C++, Java, etc... use.

However, that doesn't work in the other direction.
__________________
Not currently working on SourceMod plugin development.

Last edited by Powerlord; 11-21-2016 at 17:01.
Powerlord is offline
Reply


Thread Tools
Display Modes

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 22:20.


Powered by vBulletin®
Copyright ©2000 - 2021, vBulletin Solutions, Inc.
Theme made by Freecode