winstliu / language-sourcepawn

Sourcepawn support in Atom
https://atom.io/packages/language-sourcepawn
MIT License
11 stars 6 forks source link

Add support for .sma (amxx) files #2

Closed xPaw closed 9 years ago

xPaw commented 9 years ago

This guy forked your repository to add amxx support, but there's no real reason for it to be a separate package: https://forums.alliedmods.net/showthread.php?t=262349

Should be as simple as adding an alias for .sma -> .sp

winstliu commented 9 years ago

Agreed, a pretty simple change: https://github.com/50Wliu/language-sourcepawn/blob/master/grammars/sourcepawn.cson#L3-L6

Just curious though, what's the main differences between AMXX and SM? If there's more than a few I could add a separate .cson file for it and change the scope name, etc (like language-c does).

xPaw commented 9 years ago

It should work fine without any changes.

WildCard65 commented 9 years ago

@50Wliu I believe(not 100% sure) Sourcepawn evolved from AMXX's Pawn(my reasoning is from SourcePawn has commit messages/stuff that are AMXX based).
Edit: Ya, sourcepawn's compiler has a file named: amx.h

xPaw commented 9 years ago

That is true

WildCard65 commented 9 years ago

@xPaw Is AMXX's string escape character different, I can't remember 100% for sure but I believe I read somewhere it's '^' instead of '\'?

xPaw commented 9 years ago

By default yes, but it's changeable via #pragma, iirc.

On Mon, 4 May 2015 02:45 WildCard65 notifications@github.com wrote:

@xPaw https://github.com/xPaw Is AMXX's string escape character different, I can't remember 100% for sure but I believe I read somewhere it's '^' instead of '\'?

— Reply to this email directly or view it on GitHub https://github.com/50Wliu/language-sourcepawn/issues/2#issuecomment-98557589 .

WildCard65 commented 9 years ago

@xPaw @50Wliu The only thing that may be confusing for AMXX coders if this repo does adapt to support AMXX is the SM 1.7 syntax keywords(int, void, etc)

WildCard65 commented 9 years ago

Is it alright if I drag @SmileYzn to this?

winstliu commented 9 years ago

Just dropping in here to say that I haven't forgotten about this; I've just been really busy lately with a different project.

winstliu commented 9 years ago

Ok. If I do add support for .sma, one of two things will happen. Scenario 1: I simply add .sma under the supported filetypes list, which will properly highlight .sma files, but their tokens will all still be *.sp (eg constant.numeric.sp). Scenario 2: I add a different .cson file named amxxpawn.cson or something and copy/paste everything from sourcepawn.cson into it but find+replace .sp-->.sma, which isn't that much better than what @SmileYzn is doing right now.

Thoughts?

WildCard65 commented 9 years ago

@50Wliu, if atom supports templates, y not make one for the common stuff between amxx pawn and sourcepawn? If not, try to get that into atom then work from there for SP and SMA

On Mon, Jun 1, 2015 at 8:27 PM, Wliu notifications@github.com wrote:

Ok. If I do add support for .sma, one of two things will happen. Scenario 1: I simply add .sma under the supported filetypes list, which will properly highlight .sma files, but their tokens will all still be *.sp (eg constant.numeric.sp). Scenario 2: I add a different .cson file named amxxpawn.cson or something and copy/paste everything from sourcepawn.cson into it but find+replace .sp-->.sma, which isn't that much better than what @SmileYzn https://github.com/SmileYzn is doing right now.

Thoughts?

— Reply to this email directly or view it on GitHub https://github.com/50Wliu/language-sourcepawn/issues/2#issuecomment-107752543 .

xPaw commented 9 years ago

I don't think .sp is such a big deal to be worried about.

winstliu commented 9 years ago

AMXX users will have to deal with \ escape characters and new-style syntax tokenization for now.