Constant value unexpected here

62 views
Skip to first unread message

[mck]

unread,
Sep 25, 2015, 5:21:07 AM9/25/15
to Haxe
Hi

I am currently in the process of learning node.js in combination with Haxe.
My process is documented for future reference here: http://matthijskamstra.github.io/haxenode/

I use js-kit from clemos:  https://github.com/clemos/haxe-js-kit/

The last couple of weeks I have been working with it, and it works like a charm.
Sadly something has change....

I was working on a example that showed automation
  • nodemon to restart the node server
  • grunt-watch to recompile Haxe
  • and I gave IntelliJ another try

And maybe it's unrelated, but I have run out of options

I need help:


I was running nodemon and grunt-watch in the terminal from IntelliJ, and I closed IntelliJ without closing the terminals properly.


After that I got this error, in one form or another... "Constant value unexpected here"


haxe javascript.hxml
/usr/lib/haxe/lib/js-kit/git/js/node/events/EventEmitter.hx:5: lines 5-21 : Constant value unexpected here


Even in the most simple example


package ;
import js.Node;
class Main
{
   
function new()
   
{  
   
}

   
static public function main()
   
{
       
var main = new Main();
   
}
}

if you follow the error mentioned:

you see there is nothing funny going on...


remember it used to work for 2 weeks





Another example:

a simple hello world:
https://github.com/MatthijsKamstra/haxenode/tree/master/00helloworld/code

I get this:
haxe javascript.hxml
/usr/lib/haxe/lib/js-kit/git/js/node/Http.hx:74: lines 74-84 : Constant value unexpected here

lets follow that error:

https://github.com/clemos/haxe-js-kit/blob/master/js/node/Http.hx#L74

again that looks okay, and just scroll up, the same "extern class" are ignored

So perhaps "implements npm.Package.Require" is the one who gives me these errors?
There is been no update in git from that class...
(and older version seem to create the error also, and that use the work)

So perhaps nodemon and grunt are still running.. (yep getting desperate )
Restart should have fixed that.

Haxe broken? Nope, reinstalled it twice
Openfl project still work, flash projects still work, javascript works...
only these externs don't (anymore)

Macros work fine: tried http://yal.cc/haxe-some-cleaner-c-style-for-loops/ to test and it works fine.

reinstalled node.js  (yep desperate ) ... nothing changed

Used my google-fu : http://haxe.googlecode.com/svn/tags/v3.0.0-rc2/typeload.ml
and ended up on the old google code
but
 if isconst <> (name = "Const") && t != t_dynamic then error (if isconst then "Constant value unexpected here" else "Constant value excepted as type parameter") p;

doesn't help me .....
I hope it's something I overlooked
and please let this be a dumb question!


So anyone that can help me? Point me in the right direction !


clemos

unread,
Sep 25, 2015, 5:41:15 AM9/25/15
to haxe...@googlegroups.com
Should work now ;)

--
To post to this group haxe...@googlegroups.com
http://groups.google.com/group/haxelang?hl=en
---
You received this message because you are subscribed to the Google Groups "Haxe" group.
For more options, visit https://groups.google.com/d/optout.

[mck]

unread,
Sep 25, 2015, 5:47:31 AM9/25/15
to Haxe
GREAT!!!!

clemos

unread,
Sep 25, 2015, 6:02:41 AM9/25/15
to haxe...@googlegroups.com
For the record: 

it seems this haxe compiler feature https://github.com/HaxeFoundation/haxe/issues/4293
which I fixed a little too quick and dirty :D

In order to support multiple constant type parameters, here's what I had to do:

I hope it will help others when 3.3 is released :p

Best,
Clément
Reply all
Reply to author
Forward
0 new messages