Jump to content

Photo

ZScript Code Editor


  • Please log in to reply
123 replies to this topic

#106 Gleeok

Gleeok

    It's dangerous to dough alone, bake this.

  • Members
  • Real Name:Pillsbury
  • Location:Magical Land of Dough

Posted 18 October 2014 - 08:24 PM

 

Future enhancements could include calling out to the "official" compiler (if it were runnable in batch) for "exact" errors that would match those from ZQuest exactly and ability to parse and support arbitrary headers (not just the standard ones) for code completion.  And any other features folks can dream up.  I had high hopes that the source would be released, and I could port the compiler to Java - this would allow for some slick stuff - but I'm not sure that will happen, at least, any time soon.
 
Right now the focus is on editor enhancements not specific to zscript (clipboard history ATM) and converting the project to use gradle for builds instead of Ant.

 


I'm a fan of this. Pre-2.5 I wanted to either add in a command-line arg "invoke compiler file" or similar, or, turn the compiler stuff into a stand alone library and add preprocessor support, etc.

It's still in the back of my mind, actually.

Thanks for all the great improvements here. Very nice.

#107 David

David

    Fallen leaves... adorn my night.

  • Administrators
  • Real Name:David
  • Pronouns:He / Him

Posted 19 October 2014 - 04:44 PM

Very strange.  Sure, I'll check it out, thanks for reporting it!

Alright, thanks! :)



#108 David

David

    Fallen leaves... adorn my night.

  • Administrators
  • Real Name:David
  • Pronouns:He / Him

Posted 20 October 2014 - 07:27 PM

Okay, so I actually just fixed the problem myself. It seems like the program needed some sort of Java extension for Java 8 to work or something like that. :)



#109 Timelord

Timelord

    The Timelord

  • Banned
  • Location:Prydon Academy

Posted 18 September 2015 - 03:11 AM

The original page with the binaries is gone, so here is a ZScript IDE Plugin (Mirror).

Thank you Alucard, for providing the Win binary for me to mirror.

Edited by ZoriaRPG, 18 September 2015 - 03:12 AM.


#110 bobby_light

bobby_light

    Experienced Forumer

  • Members

Posted 19 September 2015 - 11:35 PM

The source still lives as well, now on GitHub:

 

https://github.com/b...anguageSupport/

 

It hasn't been touched in a while, due to me working on other projects, but the site and binaries disappearing was an oversight.  I'll fix that up soon.



#111 bobby_light

bobby_light

    Experienced Forumer

  • Members

Posted 19 December 2015 - 01:31 AM

The binaries and site are back up, hosted on GitHub now:

 

http://bobbylight.gi...anguageSupport/

 

Feedback is still welcome.


  • ShadowTiger likes this

#112 Timelord

Timelord

    The Timelord

  • Banned
  • Location:Prydon Academy

Posted 19 December 2015 - 07:29 PM

Do you think you will consider converting this over to C, or C++, or anything other than Java, so that we can do true binaries? The system overhead, running a Java applet like this, is insane, compared to SciTE, but it would be nice to have some of the features here.



#113 bobby_light

bobby_light

    Experienced Forumer

  • Members

Posted 20 December 2015 - 02:06 AM

Probably not.  I'll probably wrap RText into a .exe, like I do the demo package, so the fact that it's a Java is invisible, but nothing more than that.

 

I haven't really looked at the memory usage recently; I have an instance of RText that's been up for a few days, editing multiple files (TypeScript, not ZScript, but this should not be much of a difference), with mild usage, and it's ~ 130 MB RAM.  Perhaps not great, but not horrible with the average desktop having ~ 8 GB RAM these days.  And definitely less than your average "real" IDE or heavyweight code editor with multiple plugins.


Edited by bobby_light, 20 December 2015 - 02:07 AM.


#114 Timelord

Timelord

    The Timelord

  • Banned
  • Location:Prydon Academy

Posted 20 December 2015 - 05:33 AM

Probably not.  I'll probably wrap RText into a .exe, like I do the demo package, so the fact that it's a Java is invisible, but nothing more than that.

 

I haven't really looked at the memory usage recently; I have an instance of RText that's been up for a few days, editing multiple files (TypeScript, not ZScript, but this should not be much of a difference), with mild usage, and it's ~ 130 MB RAM.  Perhaps not great, but not horrible with the average desktop having ~ 8 GB RAM these days.  And definitely less than your average "real" IDE or heavyweight code editor with multiple plugins.

 

Well, many people here don't use desktop systems with loads of power, and 8BG of RAM, and some of us have over 150 ZScript files open at a time. :/

 

At present, I have 92 instances of SciTE running, on my Dell laptop (core 2.4GHz M520 i5, 4GB of RAM, Win 7) many of which with multiple tabs open, and they are no using anywhere near that memory footprint, and they are still noticeably bogging down both available RAM, and clock time.

 

Java really does make a huge difference, and including it in a wrapper would actually worsen those performance hits; so perhaps I'll cross-port it one day, or another.

 

----

 

Did you include general syntax error finding, and other script error finding in the programme to date?

 

Things like finding infinite loops without wait, or break instructions, infinite for loops, scripts that would use too many variables in execution, and the like? Those are the types of things that would be quite valuable to many people doing complex ZScript tasks. Calculating variable usage and tracking it in a project is probably the single most valuable possible feature, and infinite loop checking is a close second.

 

Verification of import/exclude files, and cross-comparison for duplicate functions, constants, vars (at the same level of scope), and scripts, in a project, would also be beneficial.

 

If you want some basic docs on the actual lexer (e.g. parsing of tokens into ZASM), let me know.


Edited by ZoriaRPG, 20 December 2015 - 05:47 AM.


#115 bobby_light

bobby_light

    Experienced Forumer

  • Members

Posted 20 December 2015 - 01:54 PM

Yeah, I know Java isn't sexy, but the exe wrapper would add next to nothing to the overhead.  It's literally a stub win32 app that launches a JVM via JNI.  The stub itself has virtually no state.

 

92 instances of Scite?  That's impressive!  If you don't mind me asking, are you really working on 92 separate projects?  I assume they're separate projects since you stated each instance has multiple tabs open.  I'm pretty sure you're the edge case with that usage pattern though.

 

To answer your questions, yes - the GitHub project contains the parser used for squiggle-underlining of syntax errors.  In fact, that's arguably the largest part of the code.  As I do not have access to the ZQuest source, it's a completely homebrew parser, and so certainly does not catch everything.  I think it's a really good start though.  Check out the org.fife.rsta.zscript.ast package if you are interested.

 

The parser not only identifies syntax errors, but also produces an AST, which is then used for the tree view of the code in the editor, as well as the code completion.

 

It does not currently do the things you mention - infinite loop detection, etc., but that all could be added easily enough.

 

The code completion is also file-specific; if you have multiple ZScript files in a project (which I assume you can do), the editor is currently unaware of functions or variables defined in other files.  You won't get syntax errors for such things though, they'll just be ignored.  The editor is aware of the "standard" headers - std.zh, string.zh, etc. - and will provide code completion for them.  So I would imagine project support would be possible simply by keeping track of all user-written script files as well.

 

Duplicate variables are currently identified, though as a warning (I didn't know whether shadowing variables was an error or warning).  That's not done for functions but that would be trivial to add.

 

And thanks for your offer for doc on the lexer.  I've always wanted this thing to use the actual lexer used by ZQuest, so I didn't have to roll my own.  That would be hugely beneficial.  However, I'm sure it wasn't written to be consumed by external applications and it isn't necessarily simple to do so.  There's a difference between a standard compiler and a language parsing library.  But I figure ZScript is a relatively simple language and as such isn't hard to write a new parser for it.  And I really need to build an AST for code completion anyway.

 

Let me know if you want any help porting this guy, or have any suggestions for enhancing what's currently there.  I really like this project and think there's a lot of potential to create a nice development environment for ZQuest.  I've got my hands in a lot of pots at the moment but I'm willing to help out with this.



#116 Shadowblitz16

Shadowblitz16

    Illustrious

  • Members

Posted 31 December 2015 - 04:56 PM

how do I add/remove scripts to the demo version? 



#117 bobby_light

bobby_light

    Experienced Forumer

  • Members

Posted 04 January 2016 - 03:07 PM

Shadowblitz, could you clarify what you're asking?  Are you looking for a way to manage a project of scripts?  Importing, and allowing code completion of arbitrary imported files, etc.?



#118 Shadowblitz16

Shadowblitz16

    Illustrious

  • Members

Posted 04 January 2016 - 03:26 PM

like extending it library and importing scripts to edit



#119 bobby_light

bobby_light

    Experienced Forumer

  • Members

Posted 30 January 2016 - 01:40 PM

I'm still not sure what you mean, but in both the demo and RText you can open files via Ctrl/Cmd+O, and or just copy/paste them in.  Code completion for script libraries other than the built-in stuff is not available yet, as discussed before, but could be added to something like RText easily enough.

 

I've released a new version fixing a couple of issues brought up on GitHub by Alcurad.  I'm only updating the Windows build of the demo for now, and you can grab it on the site or, moving forward, from GitHub directly.



#120 Alucard648

Alucard648

    Magus

  • Members
  • Location:castle Dracula

Posted 31 January 2016 - 02:21 AM

Checked the current demo. The "this" pointer refers to Itemdata class in Item script scope, as intended. But within FFC script scope it`s still refers to Itemdata class, instead of FFC class as it should be. And in FFC script, autocompletion refers "this" as itemdata pointer, not FFC one. 




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users