0

I am learning GameClosure (a HTML5 game engine) and want to develop in JavaScript in Eclipse. I've downloaded WTP 3.4.2 plugin, but Eclipse don't recognize the syntax of import ... as ... like here:

enter image description here

Is there any way to fix that and have GameClosure support? There is needed a special compiler or something? (GameClosure uses basil)

I also have an warning with no semicolon after last entry in parameter-array: enter image description here

I assume this semicolon isn't needed, but how can I make this warning go away?

Paulo Fidalgo
  • 21,709
  • 7
  • 99
  • 115
Szorstki
  • 1,374
  • 1
  • 10
  • 17
  • 1
    That looks a bit like Java and a bit like JavaScript (you didn't spell 'JavaScript' correctly in your question once!). – Joe Jun 01 '13 at 20:16
  • I corrected that misspell. I know that syntax isn't usual and I can't manage with that. I tried to add some js files/folders in Eclipse to Libraries, but failed... – Szorstki Jun 01 '13 at 20:31
  • 1
    This code is *at best* for an extended ECMAScript implementation (as expected for Google Closure). It looks like Python with extra semicolons from lines 6 to 11, and it looks like ECMAScript from lines 1 to 5, and 12 to 36. You *cannot* make vanilla *JS*DT to parse that as syntactically correct code. As for the semicolon, you could go to Project Properties → JavaScript → Validator → Errors/Warnings, and disable “Semantic Validation”. I am not getting this warning with all options on, though. Find an Eclipse editor plugin for (Game)Closure instead. And please also post copyable code next time. – PointedEars Jun 01 '13 at 21:21
  • This code is available in standard GameClosure installation (git clone), and I wanted the errors to be visible, so I took screenshots. – Szorstki Jun 01 '13 at 22:22

2 Answers2

0

Looks like it's using the old Harmony modules proposal, in which case Eclipse will not parse it properly, it chokes on "let" never mind modules.

Hopefully once the standard is released later on this year Eclipse will receive an upgraded parser.

Brian Di Palma
  • 7,043
  • 3
  • 19
  • 15
0

you can use jsio as an importer:

jsio("import device");
//etc.
hexacyanide
  • 88,222
  • 31
  • 159
  • 162