These are chat archives for liam4/tlnccuwagnf

2nd
May 2016
alex
@heyitsmeuralex
May 02 2016 09:45
I haz a bank holiday today :D
Yay for no school :shipit:
alex
@heyitsmeuralex
May 02 2016 10:20
Right then; onto optional and required arguments!
alex
@heyitsmeuralex
May 02 2016 10:31
@liam4 Destroy Hound, it's too annoying :P
alex
@heyitsmeuralex
May 02 2016 10:50

Release 0.3.2

  • String escapes
Florrie
@towerofnix
May 02 2016 11:05
@nanalan Yay for destroying hound :tada:
alex
@heyitsmeuralex
May 02 2016 11:05
:P
Trying to get argument lists to work in tmLanguage
alex
@heyitsmeuralex
May 02 2016 11:13
did it :tada:
@liam4 why did you spell "parameter" wrong in the source code
that's really annoying
alex
@heyitsmeuralex
May 02 2016 11:48
Error: Function no-args expects 0 arguments, was called with 3
:D
it works
no-args => {
  print('no-args');
};

no-args('too', 'many', 'arguments');
// Error: Function no-args expects 0 arguments, was called with 3
:tada:
Arthur
@kvackkvack
May 02 2016 12:04
good job! :P
alex
@heyitsmeuralex
May 02 2016 12:04
xD
I also fixed the async functions eating errors @liam4
also all builtin functions have fn.builtin set to true
:P
Arthur
@kvackkvack
May 02 2016 12:06
What's that useful for?
alex
@heyitsmeuralex
May 02 2016 12:06
Builtins take any amount of parameters :P
Arthur
@kvackkvack
May 02 2016 12:07
Ew, why would it work like that?
alex
@heyitsmeuralex
May 02 2016 12:07
I can't be arsed to add that
@liam4 can do it
:tada:
I may have broken use(jsLibrary)
Arthur
@kvackkvack
May 02 2016 12:07
xD
gj
alex
@heyitsmeuralex
May 02 2016 12:07
Error: Function VARIABLE_IDENTIFIER,fs expects 0 arguments, was called with 1
hm
:P
tulun arrays be like:
a = > arr();
a.0 -> 'foo';
:P
Maybe tulun "arrays" could just be objects
Arthur
@kvackkvack
May 02 2016 12:09
That's ugly.
alex
@heyitsmeuralex
May 02 2016 12:09
xD
Arthur
@kvackkvack
May 02 2016 12:09
Like in lua?
alex
@heyitsmeuralex
May 02 2016 12:09
mm
and objects be iritatorible(???)
xD
e.g. loop(imAnObjectWith4Values, {});
lol, I have no idea
anyhoo, why does
potato => (foo, [bar]) {};
work
like, I havent even edited the grammar yet
Arthur
@kvackkvack
May 02 2016 12:11
xD
[] is not in special_chars?
alex
@heyitsmeuralex
May 02 2016 12:12
Ah
it isn't
:P
WELL THATS SOMETHING TO ADD
Arthur
@kvackkvack
May 02 2016 12:12
xD
alex
@heyitsmeuralex
May 02 2016 12:12
also I'll add unevaluated to keywords
:P
Arthur
@kvackkvack
May 02 2016 12:12
yey
alex
@heyitsmeuralex
May 02 2016 12:12
unevaluated => 'no hax for you';

wow

if I remove (a space) from the special chars list
I can do this
let me just try this => 'foobar';

print(let me just try this);
and it works
Arthur
@kvackkvack
May 02 2016 12:14
:OOOO
alex
@heyitsmeuralex
May 02 2016 12:14
welp, it generates 2 asts but who cares
:tada:
Arthur
@kvackkvack
May 02 2016 12:14
lol
alex
@heyitsmeuralex
May 02 2016 12:14
heh
it sees the space before =>
and thinks "is that the variable name or is that just whitespace"
Arthur
@kvackkvack
May 02 2016 12:15
turn _ "=>" _ into __ "=>" __
alex
@heyitsmeuralex
May 02 2016 12:15
"let me just try this" vs "let me just try this " :P
what?
lol
ah
what would that do?
:P
Arthur
@kvackkvack
May 02 2016 12:15
_ is maybe whitespace,__ is required whitespace
alex
@heyitsmeuralex
May 02 2016 12:15
ah

omg it works

THIS IS AMAZING
@liam4 pls can I add this
let me just try this => 'foobar';
print(let me just try this);
Arthur
@kvackkvack
May 02 2016 12:16
add credit to me pls
alex
@heyitsmeuralex
May 02 2016 12:16
lol
gtg
Arthur
@kvackkvack
May 02 2016 12:17
:P
bye
alex
@heyitsmeuralex
May 02 2016 12:17
Bai
pushed :tada:
alex
@heyitsmeuralex
May 02 2016 15:49
Back.
@kvackkvack thoughts on spaces in varnames?
:P
Is it something worth pursuing or not...?
Arthur
@kvackkvack
May 02 2016 16:27
Ehh... Maybe.
Is there something that breaks currently when using them?
alex
@heyitsmeuralex
May 02 2016 16:29
Yep.
Arthur
@kvackkvack
May 02 2016 16:29
Like what?
alex
@heyitsmeuralex
May 02 2016 16:29
Lots of ambigous syntax
e.g. if()
Arthur
@kvackkvack
May 02 2016 16:29
Wait, why does it make if ambigious!?
alex
@heyitsmeuralex
May 02 2016 16:29
basically any whitespace
Arthur
@kvackkvack
May 02 2016 16:29
ohh
Hang on, I think I might have a fix - I'll edit some of the grammar and see if it works.
alex
@heyitsmeuralex
May 02 2016 16:30
I, uh, reverted the commits
:P
Arthur
@kvackkvack
May 02 2016 16:30
I know. :P
alex
@heyitsmeuralex
May 02 2016 16:31
:cake:
Arthur
@kvackkvack
May 02 2016 16:31
It's not very hard to get back though, right?
alex
@heyitsmeuralex
May 02 2016 16:31
sure
I dunno.
:P
It should be easy, yeah.
Just revert arguments to add varname spaces to theme
@liam4 better tests activate
Arthur
@kvackkvack
May 02 2016 16:32
I just need to nearleyc grammar.ne -o ../dist/grammar.js when editing the grammar, right?
alex
@heyitsmeuralex
May 02 2016 16:32
No.
tulun rebuild
Arthur
@kvackkvack
May 02 2016 16:32
??
oh
k
alex
@heyitsmeuralex
May 02 2016 16:32
also when you clone
make sure you npm link
Arthur
@kvackkvack
May 02 2016 16:32
huh?
btw calling tulun just opens tulun.js in Notepad++ for me
alex
@heyitsmeuralex
May 02 2016 16:33
...
Arthur
@kvackkvack
May 02 2016 16:33
same for tulun rebuild
alex
@heyitsmeuralex
May 02 2016 16:33
git clone ...
npm link
tulun rebuild
try dat ^
Arthur
@kvackkvack
May 02 2016 16:35
what does npm link do?
alex
@heyitsmeuralex
May 02 2016 16:35
npm help link
:P
Basically it adds tulun.js to yer PATH
equivalent of npm install -g
except for local packages
Arthur
@kvackkvack
May 02 2016 16:36
Ah.
It's taking a while... :P
alex
@heyitsmeuralex
May 02 2016 16:36
:P
it will
Arthur
@kvackkvack
May 02 2016 16:36
yey, done
alex
@heyitsmeuralex
May 02 2016 16:36
You'll only have to to do it once
:tada:
Arthur
@kvackkvack
May 02 2016 16:37
It still only opens tulun.js in Notepad++... Windows problems?
alex
@heyitsmeuralex
May 02 2016 16:37
...
are you in the tlnccuwagnf folder
Arthur
@kvackkvack
May 02 2016 16:38
yes
alex
@heyitsmeuralex
May 02 2016 16:38
hum
try ./tulun rebuild
Arthur
@kvackkvack
May 02 2016 16:38
'.' is not recognized as an internal or external command, operable program or batch file.
alex
@heyitsmeuralex
May 02 2016 16:38
node tulun.js rebuild?
Arthur
@kvackkvack
May 02 2016 16:39
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
alex
@heyitsmeuralex
May 02 2016 16:39
;-;
npm install -g gulp
Arthur
@kvackkvack
May 02 2016 16:39
.\tulun rebuild also just opened tulun.js in notepad++
alex
@heyitsmeuralex
May 02 2016 16:39
:P
Arthur
@kvackkvack
May 02 2016 16:40
getting the same error still
alex
@heyitsmeuralex
May 02 2016 16:40
npm install -g gulp then node tulun.js rebuild still breaks?
Arthur
@kvackkvack
May 02 2016 16:40

```C:\Users\admin\tlnccuwagnf>node -v
v5.10.1

C:\Users\admin\tlnccuwagnf>npm -v
3.8.3```

yes
alex
@heyitsmeuralex
May 02 2016 16:40
try gulp build
:P
bloody windows...
Arthur
@kvackkvack
May 02 2016 16:41
works
alex
@heyitsmeuralex
May 02 2016 16:41
:D
Arthur
@kvackkvack
May 02 2016 16:41
So, is that my equivalent of tulun rebuild?
alex
@heyitsmeuralex
May 02 2016 16:41
yep
Arthur
@kvackkvack
May 02 2016 16:41
k
alex
@heyitsmeuralex
May 02 2016 16:41
I'll add that to help
Arthur
@kvackkvack
May 02 2016 16:42
soon, windows 10 will get bash
:P
alex
@heyitsmeuralex
May 02 2016 16:42
:shipit:
Just merged arguments & master
for the sake of the new tests
Arthur
@kvackkvack
May 02 2016 16:47
how to run the REPL?
alex
@heyitsmeuralex
May 02 2016 16:47
tulun help m8
use tulun
Arthur
@kvackkvack
May 02 2016 16:47
that doesn't work tho
alex
@heyitsmeuralex
May 02 2016 16:47
...oh.
node tulun.js
what happen
Arthur
@kvackkvack
May 02 2016 16:48
i thought we'd already talked about that :P
alex
@heyitsmeuralex
May 02 2016 16:48
Welp, that should work
Arthur
@kvackkvack
May 02 2016 16:48
dis happen: 1 # Tulun Read Eval Print Loop # 2 repl => use('./repl.js');
alex
@heyitsmeuralex
May 02 2016 16:48
...
Arthur
@kvackkvack
May 02 2016 16:48
then it won't let me input anything
alex
@heyitsmeuralex
May 02 2016 16:48
er
npm link
^
what does this error?
Arthur
@kvackkvack
May 02 2016 16:48
i already did that
alex
@heyitsmeuralex
May 02 2016 16:49
What does it do?
Arthur
@kvackkvack
May 02 2016 16:49
i'll do it again though
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
alex
@heyitsmeuralex
May 02 2016 16:50
righty
hm
where tulun
Arthur
@kvackkvack
May 02 2016 16:51
C:\Users\admin\tlnccuwagnf\tulun.js
C:\Users\admin\AppData\Roaming\npm\tulun
C:\Users\admin\AppData\Roaming\npm\tulun.cmd
alex
@heyitsmeuralex
May 02 2016 16:51
well there you go
that should work
Arthur
@kvackkvack
May 02 2016 16:51
huh?
alex
@heyitsmeuralex
May 02 2016 16:51
C:\Users\admin\tlnccuwagnf\tulun.js
also why are you logged in as admin
Arthur
@kvackkvack
May 02 2016 16:52
well, i'm not actually, but it's my last name and like privacy ya know
:P
alex
@heyitsmeuralex
May 02 2016 16:52
lol
wait
admin is your last name?
:tada:
Arthur
@kvackkvack
May 02 2016 16:52
lol
alex
@heyitsmeuralex
May 02 2016 16:52
git pull?
yey new tests
ugh, repl is broken
whatever
um
Arthur
@kvackkvack
May 02 2016 16:53
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
so it's not just me? lol
alex
@heyitsmeuralex
May 02 2016 16:54
Yep.
lol
Modify test.tul
Arthur
@kvackkvack
May 02 2016 16:54
I'll try fixing it then...
alex
@heyitsmeuralex
May 02 2016 16:54
then tulun test.tul
No.
Arthur
@kvackkvack
May 02 2016 16:54
:(
k
alex
@heyitsmeuralex
May 02 2016 16:54
I need to fix things
:P
nodepad++ (or whatever) test.tul
tulun test.tul
theres yer dev env
edit test.tul and then tulun it
:shipit:
gtg
See ya!
poof
Arthur
@kvackkvack
May 02 2016 16:55
but I need help ;_;
Florrie
@towerofnix
May 02 2016 17:20

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?

Arthur
@kvackkvack
May 02 2016 17:20
You could make it so spaces are neither allowed at the beginning or end of identifiers
Kind of like numbers are right now
Florrie
@towerofnix
May 02 2016 17:21
Ah.
Sounds good!
Arthur
@kvackkvack
May 02 2016 17:21
That'd fix all problems, I think, and my variable=>42 would still work
Florrie
@towerofnix
May 02 2016 17:21
You'd need to modify the post-processor
Arthur
@kvackkvack
May 02 2016 17:21
Yeah
Trying to write a .sb2 writer for my language at the moment. :P
Florrie
@towerofnix
May 02 2016 17:22
Identifier -> GenericCharacter:+ {% function(data, location, reject) {
  // this needs work
  if (/* insert regex here */) return reject;
  else return data.join('');
} %}
Arthur
@kvackkvack
May 02 2016 17:24
{% 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
} %}
?
Florrie
@towerofnix
May 02 2016 17:24
This message was deleted
Maybe?
Test it? :P
Arthur
@kvackkvack
May 02 2016 17:24
I can't.
Florrie
@towerofnix
May 02 2016 17:24
Why not?
gulp build && node tulun.js test.tul
Arthur
@kvackkvack
May 02 2016 17:25
I can't tulun files
Yeah, that doesn't work
Florrie
@towerofnix
May 02 2016 17:25
Get the bash for windows or whatever thing.
Arthur
@kvackkvack
May 02 2016 17:25
lol
Why don't you test it? :P
Florrie
@towerofnix
May 02 2016 17:25
cygwin
Arthur
@kvackkvack
May 02 2016 17:25
I'm working on my own thing anyways
Florrie
@towerofnix
May 02 2016 17:25
Because it almost definitely won't work because it's straight from your head without being tested at all?
Arthur
@kvackkvack
May 02 2016 17:25
?
xD
Florrie
@towerofnix
May 02 2016 17:25
(hit enter accidentally)
First tries never work :P
Arthur
@kvackkvack
May 02 2016 17:26
No, every part except the added \s in the RegExp and the testing of last character being ' ' is tested already
(in my own nearley file)
Arthur
@kvackkvack
May 02 2016 18:02
Why is this not valid node!? function(name, args, ...scripts) {
It's giving me an error on the ...
alex
@heyitsmeuralex
May 02 2016 18:42
je suis bak
Arthur
@kvackkvack
May 02 2016 18:42
hi
help with node pls
alex
@heyitsmeuralex
May 02 2016 18:43
idek
I don't have a Windows machine anymore :(
@liam4 does travis have windows vms too? :shipit:
OOO
aw no wundoge
:P
Arthur
@kvackkvack
May 02 2016 18:44
does node not support function(...args) !??!!????+
alex
@heyitsmeuralex
May 02 2016 18:44
...yeah.
Arthur
@kvackkvack
May 02 2016 18:45
y
alex
@heyitsmeuralex
May 02 2016 18:45
'use strict'; m8
:P
You need the --harmony flag
Arthur
@kvackkvack
May 02 2016 18:47
Node's annoying :P
alex
@heyitsmeuralex
May 02 2016 18:47
m8
node 5 is ~old now
use nvm :P
Arthur
@kvackkvack
May 02 2016 18:48
is it?
alex
@heyitsmeuralex
May 02 2016 18:48
relatively
get nvm for windoge
Arthur
@kvackkvack
May 02 2016 18:48
what's the current one?
alex
@heyitsmeuralex
May 02 2016 18:48
# 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)
:P
Arthur
@kvackkvack
May 02 2016 18:48
do rest parameters work in it?
alex
@heyitsmeuralex
May 02 2016 18:49
Yes.
What node -v are you running?
Arthur
@kvackkvack
May 02 2016 18:49
5.10.1
alex
@heyitsmeuralex
May 02 2016 18:49
use node <file> --harmony if you want rest params
Or upgrade yer node
Arthur
@kvackkvack
May 02 2016 18:50
installing nvm right now :P
alex
@heyitsmeuralex
May 02 2016 18:50
lol
Current stable is ~5
Current for the swagsters is ~6
:P
Nightly for people who like to live on the edge is Node v7 :O
anyhoo
Arthur
@kvackkvack
May 02 2016 18:51
how do i update
:P
alex
@heyitsmeuralex
May 02 2016 18:51
nvm install <nodeversion>
nvm use <installed-nodeversion>
e.g. nvm install 7
Arthur
@kvackkvack
May 02 2016 18:51
I tried nvm install 6. turns out you have to do nvm install 6.0.0
alex
@heyitsmeuralex
May 02 2016 18:52
works for nvm on linux :shipit:
Arthur
@kvackkvack
May 02 2016 18:52
:(
alex
@heyitsmeuralex
May 02 2016 18:52
go get cygwin btw
Arthur
@kvackkvack
May 02 2016 18:52
wai
alex
@heyitsmeuralex
May 02 2016 18:52
bash, for windoge
Arthur
@kvackkvack
May 02 2016 18:52
ik
ooo
Arthur
@kvackkvack
May 02 2016 18:52
Is that better?
Oh, it's the same thing
alex
@heyitsmeuralex
May 02 2016 18:53
It's cygwin + sweg
Arthur
@kvackkvack
May 02 2016 18:53
But better
:P
alex
@heyitsmeuralex
May 02 2016 18:55

anyways

Arthur
@kvackkvack
May 02 2016 18:56
Try the thing I wanted liam to try pls
alex
@heyitsmeuralex
May 02 2016 18:56
@liam4 @kvackkvack you know that String.prototype.trim() works right?
:P
you dummies
Arthur
@kvackkvack
May 02 2016 18:56
Huh?
alex
@heyitsmeuralex
May 02 2016 18:56
trim whitespace from edges of strings in js
Arthur
@kvackkvack
May 02 2016 18:56
ik
alex
@heyitsmeuralex
May 02 2016 18:56
.trim()
:P
Arthur
@kvackkvack
May 02 2016 18:56
but why would you think we don't know about it?
alex
@heyitsmeuralex
May 02 2016 18:56
You did fancy stuff
rite?
:P
Arthur
@kvackkvack
May 02 2016 18:56
wat?
alex
@heyitsmeuralex
May 02 2016 18:56
ignore me
nvm
Arthur
@kvackkvack
May 02 2016 18:57
install
alex
@heyitsmeuralex
May 02 2016 18:57
7.0.0
:P
Arthur
@kvackkvack
May 02 2016 18:57
we did it!
alex
@heyitsmeuralex
May 02 2016 18:57
Huh?
:package:
Arthur
@kvackkvack
May 02 2016 18:57
completed the chain
alex
@heyitsmeuralex
May 02 2016 18:57
lol
yep
Arthur
@kvackkvack
May 02 2016 18:57
:P
alex
@heyitsmeuralex
May 02 2016 18:59
Testing...
Arthur
@kvackkvack
May 02 2016 18:59
?
alex
@heyitsmeuralex
May 02 2016 19:00
Try the thing I wanted liam to try pls
Arthur
@kvackkvack
May 02 2016 19:00
Oh
alex
@heyitsmeuralex
May 02 2016 19:00
:shipit:
Arthur
@kvackkvack
May 02 2016 19:00
:P
alex
@heyitsmeuralex
May 02 2016 19:02
hmmmmmmmmm
I think node v6 is broken
le revert
Arthur
@kvackkvack
May 02 2016 19:03
wat?
alex
@heyitsmeuralex
May 02 2016 19:03
npm i installs the wrong dependencies
Arthur
@kvackkvack
May 02 2016 19:03
xD
alex
@heyitsmeuralex
May 02 2016 19:03
WELLL
Error: spawn gulp ENOENT
at exports._errnoException (util.js:896: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:577:11)
at startup (node.js:159:18)
at node.js:444:3
weren't you getting this?
Arthur
@kvackkvack
May 02 2016 19:04
hey, that's the error I was getting
alex
@heyitsmeuralex
May 02 2016 19:04
;-;
Well then.
Crap.
errrr
:/
Arthur
@kvackkvack
May 02 2016 19:04
:(
alex
@heyitsmeuralex
May 02 2016 19:05
:O
it works
yer identifier thingy works
Arthur
@kvackkvack
May 02 2016 19:05
:D
take that, @liam4 !
alex
@heyitsmeuralex
May 02 2016 19:05
will this work   => 'yes!';

print(    will this work );
yes!
Arthur
@kvackkvack
May 02 2016 19:05
yey
wait, why does that work
that should be ambigious
alex
@heyitsmeuralex
May 02 2016 19:06
nope
Arthur
@kvackkvack
May 02 2016 19:06
hm
lol
alex
@heyitsmeuralex
May 02 2016 19:06
lol
it reads it and trims the leading/trailing whitespace
so ( will this work )
Arthur
@kvackkvack
May 02 2016 19:07
You added trimming?
alex
@heyitsmeuralex
May 02 2016 19:07
I added your thingy silly
Arthur
@kvackkvack
May 02 2016 19:07
ik
alex
@heyitsmeuralex
May 02 2016 19:07
But, yeah, apparently so
Arthur
@kvackkvack
May 02 2016 19:07
but it shouldn't reject it for all leading/trailing whitespace
alex
@heyitsmeuralex
May 02 2016 19:07
No, it just trims it?
Arthur
@kvackkvack
May 02 2016 19:07
only the first or last characters
alex
@heyitsmeuralex
May 02 2016 19:07
oh
lemme test
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
} %}
this is the Identifier code
Arthur
@kvackkvack
May 02 2016 19:08
change it to this:
{% 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
} %}
alex
@heyitsmeuralex
May 02 2016 19:09
still works
Arthur
@kvackkvack
May 02 2016 19:09
go with the latter then
idk why the first even works
:P
alex
@heyitsmeuralex
May 02 2016 19:09
      whitespace test => true;
  whitespace test();
ambiguous
Arthur
@kvackkvack
May 02 2016 19:10
did it work before?
alex
@heyitsmeuralex
May 02 2016 19:10
um
maybe?
Arthur
@kvackkvack
May 02 2016 19:10
lol
alex
@heyitsmeuralex
May 02 2016 19:10
[[["VARIABLE_ASSIGN","whitespace test",["BOOLEAN_PRIM",true]]],[["FUNCTION_CALL",["VARIABLE_IDENTIFIER","whitespace test"],[]]]]

----------------------------

[[["VARIABLE_IDENTIFIER","whitespace test => true"]],[["FUNCTION_CALL",["VARIABLE_IDENTIFIER","whitespace test"],[]]]]
O_o
Arthur
@kvackkvack
May 02 2016 19:10
hm
alex
@heyitsmeuralex
May 02 2016 19:10
apparently it sees the entire first line as a varname
:P
Arthur
@kvackkvack
May 02 2016 19:10
yeah
alex
@heyitsmeuralex
May 02 2016 19:10
what did you break
:P
Arthur
@kvackkvack
May 02 2016 19:10
why does it allow for an identifier to have => !?
owait, those were removed from special_chars
alex
@heyitsmeuralex
May 02 2016 19:11
¯_(ツ)_/¯
Arthur
@kvackkvack
May 02 2016 19:11
here, you dropped this: \
alex
@heyitsmeuralex
May 02 2016 19:11
allExports.KEYWORDS = ['true', 'false', '=>', '->', 'async', 'unevaluated']
Nah, gitter just displays it wrong
Arthur
@kvackkvack
May 02 2016 19:11
yeah, that checks for the whole identifier though
hm
alex
@heyitsmeuralex
May 02 2016 19:12
ah
so we can't allow "=>" anywhere?
Arthur
@kvackkvack
May 02 2016 19:12
that'd solve it, yeah
alex
@heyitsmeuralex
May 02 2016 19:12
how about required whitespace before =>
:P
Arthur
@kvackkvack
May 02 2016 19:12
no
liam doesn't want that
alex
@heyitsmeuralex
May 02 2016 19:12
kek
Arthur
@kvackkvack
May 02 2016 19:13
edit the ValididentifierChar's or whatever it's calledpost processor
alex
@heyitsmeuralex
May 02 2016 19:13
mm
I am
Arthur
@kvackkvack
May 02 2016 19:13
yey
alex
@heyitsmeuralex
May 02 2016 19:13
allExports.NOT_ALLOWED_IN_IDENTIFIERS = ['=>', '->']
hows dis
:shipit:
Arthur
@kvackkvack
May 02 2016 19:13
lol
yeah
or just SPECIAL_STRINGS
alex
@heyitsmeuralex
May 02 2016 19:13
:P
how about NO
allExports.NO = ['=>', '->']
Arthur
@kvackkvack
May 02 2016 19:14
OMG
alex
@heyitsmeuralex
May 02 2016 19:14
:P
Arthur
@kvackkvack
May 02 2016 19:14
this works
alex
@heyitsmeuralex
May 02 2016 19:14
hm?
wait
what?
Arthur
@kvackkvack
May 02 2016 19:14
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())
in my thing
alex
@heyitsmeuralex
May 02 2016 19:14
OOOOOO
WHAT
das awesome
Arthur
@kvackkvack
May 02 2016 19:14
yey
it was super easy too :P
alex
@heyitsmeuralex
May 02 2016 19:14
put it on the githubz
Arthur
@kvackkvack
May 02 2016 19:14
make a repo for it?
alex
@heyitsmeuralex
May 02 2016 19:15
yas
Arthur
@kvackkvack
May 02 2016 19:15
it's barely complicated at all
here'
s the code
alex
@heyitsmeuralex
May 02 2016 19:15
call it "toshy"
:P
Arthur
@kvackkvack
May 02 2016 19:15
'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
alex
@heyitsmeuralex
May 02 2016 19:15
7
Arthur
@kvackkvack
May 02 2016 19:15
xD
it's incredibly modified to fit simply with the project I'm using it in
alex
@heyitsmeuralex
May 02 2016 19:15
throw "ERRROR:
Arthur
@kvackkvack
May 02 2016 19:15
lol
alex
@heyitsmeuralex
May 02 2016 19:15
nice spelling
Arthur
@kvackkvack
May 02 2016 19:16
missed that
it has terrible costumes, only the stage, and no sounds
and probably other things I can't think of
alex
@heyitsmeuralex
May 02 2016 19:16
lol
new Scratch.comment('lolol')
:P
Arthur
@kvackkvack
May 02 2016 19:17
But it works for what I'm using it for! :P
alex
@heyitsmeuralex
May 02 2016 19:17
.....which is?
:shipit:
Arthur
@kvackkvack
May 02 2016 19:17
The language that compiles to .sb2
.sb12
alex
@heyitsmeuralex
May 02 2016 19:17
o.
:P
alex
@heyitsmeuralex
May 02 2016 19:23
um
A total of 105 ASTs were generated.
Please report this on the official issue tracker:
https://github.com/liam4/tlnccuwagnf/issues
Using first AST.
well
Arthur
@kvackkvack
May 02 2016 19:23
...
lol
alex
@heyitsmeuralex
May 02 2016 19:25
erm
all the asts are the same
wut
Arthur
@kvackkvack
May 02 2016 19:25
probably whitespace getting ignored
what was the input code?
alex
@heyitsmeuralex
May 02 2016 19:25
      whitespace test => true;
  whitespace test();
Arthur
@kvackkvack
May 02 2016 19:25
lol
try to fix it yourself
alex
@heyitsmeuralex
May 02 2016 19:26
:P
"no"
[[["VARIABLE_ASSIGN","whitespace test",["VARIABLE_IDENTIFIER","true"]]],[["FUNCTION_CALL",["VARIABLE_IDENTIFIER","whitespace test"],[]]]]
ugh
Arthur
@kvackkvack
May 02 2016 19:26
So, that's actually correct at least
It's just the ambiguity that's a problem
alex
@heyitsmeuralex
May 02 2016 19:26
mm
ah
I did || instead of &&
Arthur
@kvackkvack
May 02 2016 19:28
lol
gg
alex
@heyitsmeuralex
May 02 2016 19:28
derp x10
welp, still 105 asts
:P
Arthur
@kvackkvack
May 02 2016 19:28
xD
Florrie
@towerofnix
May 02 2016 20:04

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

Arthur
@kvackkvack
May 02 2016 20:05
see, that was what I changed it to liam :P
Florrie
@towerofnix
May 02 2016 20:05
Whoa. Why do the tests look so good? :P https://travis-ci.org/liam4/tlnccuwagnf/jobs/127271661#L568