{"action":"opened","issue":{"url":"https://api.github.com/repos/cesanta/mjs/issues/4","repository_url":"https://api.github.com/repos/cesanta/mjs","labels_url":"https://api.github.com/repos/cesanta/mjs/issues/4/labels{/name}","comments_url":"https://api.github.com/repos/cesanta/mjs/issues/4/comments","events_url":"https://api.github.com/repos/cesanta/mjs/issues/4/events","html_url":"https://github.com/cesanta/mjs/issues/4","id":207117988,"number":4,"title":"Issue in ffi parser?","user":{"login":"creationix","id":89353,"avatar_url":"https://avatars.githubusercontent.com/u/89353?v=3","gravatar_id":"","url":"https://api.github.com/users/creationix","html_url":"https://github.com/creationix","followers_url":"https://api.github.com/users/creationix/followers","following_url":"https://api.github.com/users/creationix/following{/other_user}","gists_url":"https://api.github.com/users/creationix/gists{/gist_id}","starred_url":"https://api.github.com/users/creationix/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/creationix/subscriptions","organizations_url":"https://api.github.com/users/creationix/orgs","repos_url":"https://api.github.com/users/creationix/repos","events_url":"https://api.github.com/users/creationix/events{/privacy}","received_events_url":"https://api.github.com/users/creationix/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-02-13T04:09:39Z","updated_at":"2017-02-13T04:09:39Z","closed_at":null,"body":"I've made a small toy environment for controlling strips of neopixels.\r\n\r\nI think I hit a bug in the FFI parser.\r\n\r\nWith the following JS:\r\n```js\r\nlet fade = ffi(\"void fade(int keep)\");\r\nlet update = ffi(\"void update()\");\r\nlet rgb = ffi(\"void rgb(int p, int r, int g, int b)\");\r\nlet rgbl = ffi(\"void rgbl(int p, int r, int g, int b, int keep)\");\r\nlet hue = ffi(\"void hue(int p, int h)\");\r\nlet msleep = ffi(\"void msleep(int ms)\");\r\n\r\nlet i = 0;\r\nlet j = 0;\r\nwhile (true) {\r\n  hue(i, j);\r\n  update();\r\n  i = (i + 1) % 10;\r\n  j = (j + 13) & 768;\r\n  msleep(33);\r\n}\r\n```\r\n\r\nIt crashes with the error:\r\n\r\n```\r\nfailed to call FFI signature \"void hue(int p, int h)\": wrong arg type: failed to parse val type \"int p\"\r\n```\r\n\r\nI don't see any error with this line.  I'm using the same syntax and conventions of the other ffi lines that appear to work.\r\n"}}
{"actor":{"display_login":"creationix"}}