mirror of
https://github.com/espruino/Espruino.git
synced 2025-12-08 19:06:15 +00:00
Fix errors creating type files
This commit is contained in:
parent
285a367a85
commit
1f2a3b4521
@ -453,7 +453,8 @@ a full update of the screen.
|
||||
/*JSON{
|
||||
"type" : "property",
|
||||
"class" : "Graphics",
|
||||
"name" : "buffer"
|
||||
"name" : "buffer",
|
||||
"return" : ["JsVar","An ArrayBuffer (or not defined on Graphics instances not created with `Graphics.createArrayBuffer`)"]
|
||||
}
|
||||
On Graphics instances with an offscreen buffer, this
|
||||
is an `ArrayBuffer` that provides access to the underlying
|
||||
|
||||
@ -14,6 +14,28 @@
|
||||
#include "jswrap_unistroke.h"
|
||||
#include "unistroke.h"
|
||||
|
||||
/*JSON{
|
||||
"type" : "class",
|
||||
"class" : "Unistroke",
|
||||
"ifdef" : "BANGLEJS2"
|
||||
}
|
||||
This class provides functionality to recognise gestures drawn
|
||||
on a touchscreen. It is only built into Bangle.js 2.
|
||||
|
||||
Usage:
|
||||
|
||||
```
|
||||
var strokes = {
|
||||
stroke1 : Unistroke.new(new Uint8Array([x1, y1, x2, y2, x3, y3, ...])),
|
||||
stroke2 : Unistroke.new(new Uint8Array([x1, y1, x2, y2, x3, y3, ...])),
|
||||
stroke3 : Unistroke.new(new Uint8Array([x1, y1, x2, y2, x3, y3, ...]))
|
||||
};
|
||||
var r = Unistroke.recognise(strokes,new Uint8Array([x1, y1, x2, y2, x3, y3, ...]))
|
||||
print(r); // stroke1/stroke2/stroke3
|
||||
```
|
||||
|
||||
*/
|
||||
|
||||
/*JSON{
|
||||
"type" : "staticmethod",
|
||||
"class" : "Unistroke",
|
||||
|
||||
@ -5,21 +5,28 @@
|
||||
// This build a JSON description file for Tern.js as
|
||||
// specified here: http://ternjs.net/doc/manual.html#typedef
|
||||
|
||||
var marked = require('marked');
|
||||
// Set default options except highlight which has no default
|
||||
marked.setOptions({
|
||||
gfm: true, // github markdown
|
||||
highlight: function (code) {
|
||||
return require('highlight.js').highlightAuto(code).value;
|
||||
},
|
||||
tables: true,
|
||||
breaks: false,
|
||||
pedantic: false,
|
||||
sanitize: false,
|
||||
smartLists: true,
|
||||
smartypants: false,
|
||||
langPrefix: 'lang-'
|
||||
});
|
||||
var marked = v => v;
|
||||
try {
|
||||
marked = require('marked');
|
||||
// Set default options except highlight which has no default
|
||||
marked.setOptions({
|
||||
gfm: true, // github markdown
|
||||
highlight: function (code) {
|
||||
return require('highlight.js').highlightAuto(code).value;
|
||||
},
|
||||
tables: true,
|
||||
breaks: false,
|
||||
pedantic: false,
|
||||
sanitize: false,
|
||||
smartLists: true,
|
||||
smartypants: false,
|
||||
langPrefix: 'lang-'
|
||||
});
|
||||
} catch (e) {
|
||||
console.error("WARNING: marked is not installed");
|
||||
}
|
||||
|
||||
var hadErrors = false;
|
||||
|
||||
require("./common.js").readAllWrapperFiles(function(json) {
|
||||
var tern = { "!name": "Espruino" };
|
||||
@ -50,6 +57,7 @@ require("./common.js").readAllWrapperFiles(function(json) {
|
||||
}
|
||||
} catch (e) {
|
||||
console.error("Exception "+e, j);
|
||||
hadErrors = true;
|
||||
}
|
||||
});
|
||||
|
||||
@ -94,6 +102,7 @@ require("./common.js").readAllWrapperFiles(function(json) {
|
||||
console.warn("Unknown type "+j.type+" for ",j);
|
||||
} catch (e) {
|
||||
console.error("Exception "+e, e.stack, j);
|
||||
hadErrors = true;
|
||||
}
|
||||
});
|
||||
|
||||
@ -101,6 +110,10 @@ require("./common.js").readAllWrapperFiles(function(json) {
|
||||
delete tern["Telnet"]["!type"];
|
||||
|
||||
|
||||
if (hadErrors) {
|
||||
console.log("ERRORS PROCESING FILES");
|
||||
process.exit(1);
|
||||
}
|
||||
console.log(JSON.stringify(tern,null,2));
|
||||
|
||||
});
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user