Could we get alt syntax to make it more PHP IDE friendly?

Features wanted...
Post Reply
mydarkpassenger
Posts: 31
Joined: 19 Apr 2014 19:39

Could we get alt syntax to make it more PHP IDE friendly?

Post by mydarkpassenger »

The language syntax is very PHP like in nature. I decided to try and see if I can make it work in an IDE like PHPstorm so I can have refactoring support, syntax highlighting (although I'm aware of things like akipad and notepad++), auto-completion for functions with their proper signature, being able to see the function outline and quickly jump to declarations, and have it warn about things like missing semi-colons and such. So far it seems to work although I'm still playing with it. I went through the documentation and converted the signatures you listed in the docs to PHP functions with no bodies. This allows PHPstorm to give you auto-complete support for these commands and give you a better chance of seeing if they're valid, however some commands conflict with PHP or have unique syntax which screws with PHP like perm declarations so I created a wrapper file with PHP friendly functions which call the real commands. For example,

Code: Select all

xy_setperm($name, $value) 
calls

Code: Select all

perm $name = $value 
it stops PHPStorm from thinking it's an error and works.

A few things have issues though. One big one is the foreach syntax. PHP uses foreach($values as $value) and you use foreach($value, $values). Another issue is labels which I can't make work. However, just being able to wrap them in a function like setlabel($label) will help. I was wondering if you could add alternative syntax for a lot of the XY script commands and functions so that they play nicer with PHP IDEs?

Post Reply