Error: Function no-args expects 0 arguments, was called with 3
no-args => {
print('no-args');
};
no-args('too', 'many', 'arguments');
// Error: Function no-args expects 0 arguments, was called with 3
fn.builtin
set to true
use(jsLibrary)
Error: Function VARIABLE_IDENTIFIER,fs expects 0 arguments, was called with 1
a = > arr();
a.0 -> 'foo';
loop(imAnObjectWith4Values, {});
potato => (foo, [bar]) {};
unevaluated
to keywords
unevaluated => 'no hax for you';
(a space) from the special chars list
let me just try this => 'foobar';
print(let me just try this);
_ "=>" _
into __ "=>" __
"let me just try this"
vs "let me just try this "
:P
_
is maybe whitespace,__
is required whitespace
let me just try this => 'foobar';
print(let me just try this);
arguments
to add varname spaces to theme
nearleyc grammar.ne -o ../dist/grammar.js
when editing the grammar, right?
tulun rebuild
npm link
tulun
just opens tulun.js in Notepad++ for me
tulun rebuild
git clone ...
npm link
tulun rebuild
npm link
do?
npm help link
npm install -g
tlnccuwagnf
folder
./tulun rebuild
'.' is not recognized as an internal or external command,
operable program or batch file.
node tulun.js rebuild
?
events.js:154
throw er; // Unhandled 'error' event
^
Error: spawn gulp ENOENT
at exports._errnoException (util.js:890:11)
at Process.ChildProcess._handle.onexit (internal/child_process.js:182:32)
at onErrorNT (internal/child_process.js:348:16)
at _combinedTickCallback (internal/process/next_tick.js:74:11)
at process._tickCallback (internal/process/next_tick.js:98:9)
at Function.Module.runMain (module.js:449:11)
at startup (node.js:146:18)
at node.js:404:3
npm install -g gulp
.\tulun rebuild
also just opened tulun.js in notepad++
npm install -g gulp
then node tulun.js rebuild
still breaks?
```C:\Users\admin\tlnccuwagnf>node -v
v5.10.1
C:\Users\admin\tlnccuwagnf>npm -v
3.8.3```
gulp build
tulun rebuild
?
help
tulun help
m8
tulun
1 # Tulun Read Eval Print Loop #
2 repl => use('./repl.js');
npm link
C:\Users\admin\AppData\Roaming\npm\tulun -> C:\Users\admin\AppData\Roaming\npm\node_modules\tlnccuwagnf\tulun.js
C:\Users\admin\AppData\Roaming\npm\node_modules\tlnccuwagnf -> C:\Users\admin\tlnccuwagnf
where tulun
C:\Users\admin\tlnccuwagnf\tulun.js
C:\Users\admin\AppData\Roaming\npm\tulun
C:\Users\admin\AppData\Roaming\npm\tulun.cmd
C:\Users\admin\tlnccuwagnf\tulun.js
git pull
?
C:/Users/admin/tlnccuwagnf/tulun.js
does the same thing as tulun
, node C:/Users/admin/tlnccuwagnf/tulun.js
does the same thing as node tulun
tulun test.tul
nodepad++ (or whatever) test.tul
tulun test.tul
tulun
it
welp, it generates 2 asts but who cares
I do :P
Will this still work?
my variable => 42; # good #
my variable=>42; # does this work? #
spaces before variable name - are those included => 'idk';
what about after => 'baz';
bloody windows...
^^^^^ This.
but I need help ;_;
What do you need help with?
my variable=>42
would still work
Identifier -> GenericCharacter:+ {% function(data, location, reject) {
// this needs work
if (/* insert regex here */) return reject;
else return data.join('');
} %}
{% function(data, location, reject) {
var identifier = data[0].join('')
if(C.KEYWORDS.indexOf(identifier) == -1 && !(/[0-9\s]/.test(identifier.charAt(0))) && identifier.charAt(identifier.length - 1) !== ' ') {
return identifier
}
return reject
} %}
?
gulp build && node tulun.js test.tul
function(name, args, ...scripts) {
...
nvm
:P
nvm
for windoge
# alex at jupiter in ~/tlnccuwagnf on git:arguments ● [19:47:54]
→ nvm install 6
Downloading https://nodejs.org/dist/v6.0.0/node-v6.0.0-linux-x64.tar.xz...
# # # ## ### ### #### #### ##### ###### ####### ######## ######### ########## ############ ############# ############### ################ ################## ################### ##################### ####################### ########################## ############################# ################################ ################################### ###################################### ######################################### ############################################## ################################################## ##################################################### ########################################################## ############################################################## ######################################################################################################################################### 100.0%
Now using node v6.0.0 (npm v3.8.6)
node -v
are you running?
node <file> --harmony
if you want rest params
nvm install <nodeversion>
nvm use <installed-nodeversion>
nvm install 7
nvm install 6
. turns out you have to do nvm install 6.0.0
String.prototype.trim()
works right?
.trim()
Try the thing I wanted liam to try pls
npm i
installs the wrong dependencies
will this work => 'yes!';
print( will this work );
yes!
( will this work )
Identifier -> GenericValidIdentifierCharacter:+ {% function(data, location, reject) {
var identifier = data[0].join('')
if(C.KEYWORDS.indexOf(identifier) == -1 && !(/[0-9\s]/.test(identifier.charAt(0))) && identifier.charAt(identifier.length - 1) !== ' ') {
return identifier
}
return reject
} %}
{% function(data, location, reject) {
var identifier = data[0].join('')
if(C.KEYWORDS.indexOf(identifier) == -1 && !(/[0-9]/.test(identifier.charAt(0))) && identifier.trim() === identifier) {
return identifier
}
return reject
} %}
whitespace test => true;
whitespace test();
[[["VARIABLE_ASSIGN","whitespace test",["BOOLEAN_PRIM",true]]],[["FUNCTION_CALL",["VARIABLE_IDENTIFIER","whitespace test"],[]]]]
----------------------------
[[["VARIABLE_IDENTIFIER","whitespace test => true"]],[["FUNCTION_CALL",["VARIABLE_IDENTIFIER","whitespace test"],[]]]]
allExports.KEYWORDS = ['true', 'false', '=>', '->', 'async', 'unevaluated']
=>
allExports.NOT_ALLOWED_IN_IDENTIFIERS = ['=>', '->']
allExports.NO = ['=>', '->']
const Scratch = require('./sb2')
Scratch.init()
Scratch.addList("I am a List!", ["Item", 2, 6])
Scratch.addScript(
Scratch.HatScript("whenGreenFlag", null, Scratch.Script("stopScripts", "all"))
)
console.log(Scratch.asJSON())
'use strict'
var Scratch = {}
Scratch.JSON = {}
Scratch.init = function() {
Scratch.JSON.objName = "Stage",
Scratch.JSON.variables = [],
Scratch.JSON.lists = [],
Scratch.JSON.scripts = [],
Scratch.JSON.sounds = [],
Scratch.JSON.costumes = [],
Scratch.JSON.currentCostume = 0,
Scratch.JSON.penLayerMD5 = "5c81a336fab8be57adc039a8a2b33ca9.png",
Scratch.JSON.penLayerID = 0,
Scratch.JSON.tempoBPM = 60,
Scratch.JSON.videoAlpha = 0.5,
Scratch.JSON.children = []
Scratch.JSON.info = {
"projectID": "-1",
"videoOn": false,
"spriteCount": 0,
"swfVersion": "v446",
"hasCloudData": false,
"scriptCount": 0
}
Scratch.addCostume("backdrop1")
}
Scratch.asJSON = function() {
return JSON.stringify(Scratch.JSON)
}
Scratch.addCostume = function(name, md5, x, y) {
if(!name) throw "ERRROR: name must be specified, was " + name + "!"
Scratch.JSON.costumes.push({
"costumeName": name,
"baseLayerID": 1,
"baseLayerMD5": md5 || "739b5e2a2435f6e1ec2993791b423146.png",
"bitmapResolution": 1,
"rotationCenterX": x || 240,
"rotationCenterY": y || 180
})
}
Scratch.addScript = function(script) {
Scratch.JSON.scripts.push(script)
}
Scratch.addList = function(name, contents, x, y, w, h, visible) {
if(!name) throw "ERRROR: name must be specified, was " + name + "!"
Scratch.JSON.lists.push({
"listName": name,
"contents": contents || [],
"isPersistent": false,
"x": x || 0,
"y": y || 0,
"width": w || 100,
"height": h || 200,
"visible": visible || false
})
}
Scratch.addVar = function(name, value, x, y, visible) {
if(!name) throw "ERRROR: name must be specified, was " + name + "!"
Scratch.JSON.variables.push({
"name": name,
"value": value || "",
"isPersistent": false,
"x": x || 0,
"y": y || 0,
"visible": visible || false
})
}
Scratch.HatScript = function(name, args, ...scripts) {
if(!scripts) scripts = [null]
return [0, 0, [args ? Scratch.Script(name, ...args) : Scratch.Script(name), ...scripts]]
}
Scratch.Script = function(name, ...args) {
return args ? [name, ...args] : [name]
}
module.exports = Scratch
7
throw "ERRROR:
new Scratch.comment('lolol')
.sb12
A total of 105 ASTs were generated.
Please report this on the official issue tracker:
https://github.com/liam4/tlnccuwagnf/issues
Using first AST.
whitespace test => true;
whitespace test();
||
instead of &&
Y'all better have been working in a separate branch!
you know that String.prototype.trim() works right?
Oh yeah. I guess you'd do this?
var id = data[0].join('')
if (id !== id.trim()) {
return reject
}
return id
I think node v6 is broken
Check Travis CI to see if node 6 is broken. If it isn't there and it is on your computer try re-installing node 6 :P
how about required whitespace before
=>
no
liam doesn't want that
^^^
Also I need to make it fail on 2+ ASTs so that travis fails