Comments (8)
Yeah, fair enough! I just pushed out v1.10.2 that includes the then
keyword, so that should be resolved once it's available in VSCode.
from stitch.
Ah, yeah, that makes more sense. I tried a few experiments to see if I could get IIFE support working, but it would require some changes to the most recursive part of the parser and I couldn't make it work with a cursory try. Or, anyway, I couldn't make it work without causing other problems!
The parser logic is all here if you decide to try to figure it out yourself: https://github.com/bscotch/stitch/blob/develop/packages/parser/src/parser.ts
Definitely include test cases if you do!
from stitch.
I haven't seen then
as a GML keyword and can't find it in the docs. Does your sample code mean the same thing as:
if(live_enabled){
(function(){ // 1
mt_gml_std_Date=new gml_std_haxe_class(-1,"gml_std_Date");
// some more function definition
);
}
?
In any event, that's a syntax we've never used and the Stitch Parser doesn't support. Do you have any doc references for this if() then
syntax you're using?
from stitch.
Here's the documentation: Beta Manual
This is not a syntax we are actively using either. The only instance I found a then
not in the comments or strings is this exact code sample.
About if your code is equivalent to the library code I provide, I think 99% that's the case. I am not entirely sure only because it seems like that function is only defined but not executed, and I have no idea why it would be there in the first place if it does nothing.
from stitch.
Yeah I was also wondering why it was defined but not executed. I might as well add the then
as an optional keyword since it's in the spec, but in any case it's probably worth removing or rewriting that specific code sample if that doesn't break anything!
from stitch.
Haha, if that's our project code I'd be more confident to rewrite it, but GMLive builds a whole GML interpreter just to hot reload code, and I don't have the gut to touch it (at least not yet). Thank you for helping!
from stitch.
Welp, the then
error is gone, but the error of a function inside a pair of parentheses is still there...
Also, I misread the library code -- the anonymous function will get executed at the end. There were too many parentheses, sorry about that! This is a new issue, Stitch doesn't understand "self-executing anonymous function" syntax, i.e. (function() { /* do something */ })()
. It will report 2 errors, first on function
(same as the second one in the issue, function
unexpected), and second on the last closing parenthesis (Redundant input, expecting EOF but found: )
).
from stitch.
Great, can't make any promise if I can make it work but I'll try this weekend!
from stitch.
Related Issues (20)
- Add Audio imports to Stitch for VSCode HOT 1
- Investigate importing SVG images as sprites HOT 2
- `guideColour` in Sprite `.yy` files is not properly formatted HOT 1
- Add external drag-drop of sound assets HOT 1
- looks like a global but is not declared anywhere HOT 3
- Uninformative error: `StitchParserError: Cannot replace existing member with new member`
- The new yyp format has all of the resources sorted alphabetically. Stitch should also format things that way. HOT 1
- Add a "runner" panel in Stitch VSCode HOT 1
- Runner Panel: Add customizable color-coding HOT 1
- Renaming a script resource causes the project to be unable to run.
- Cannot convert 1E-10 to a Bigint HOT 1
- Hiding variables marked with @access JSDOC. HOT 3
- Add "New Project" command HOT 1
- Symbol searcher: can we go directly to sounds?
- Create Room assets from VSCode
- Add object instances to a room via VSCode HOT 1
- Audio assets cannot be added to new folders HOT 2
- "Set Sprite" dropdown menu in the Object Inspector tab doesn't set the sprite.
- Renaming an object doesn't rename it in the rooms that object is placed in. HOT 1
- Can't create collision events on objects from VS Code, adding them from Game Maker makes name of event invisible in VS Code HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from stitch.