nilac 0.0.4.3.9.7 → 0.0.4.3.9.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/examples/repl.js +10 -8
- data/examples/repl.nila +13 -6
- data/lib/nilac/version.rb +1 -1
- data/lib/nilac.rb +1 -3
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4307491b9692c18501a10dada6e03bae8b1df980
|
4
|
+
data.tar.gz: 2547b27d45b4867a350527ca9622b7851698e485
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a8411c3d2a2ac183ccea27dced29bad909282c06f34d8551935990acde3314e1ec5a08a04c1a60bfbd20923db8f980ff096f265175cebe19d1b40516a95f0424
|
7
|
+
data.tar.gz: 552e7cb29c913f6e95bcc20dc0b918d414e3b3111c8620a9990d91b67ee4499ffb1073040d22a763d251edac34d906d8350cff30894f8feabf2fd0b4925a026c
|
data/examples/repl.js
CHANGED
@@ -1,11 +1,20 @@
|
|
1
1
|
//Written using Nila. Visit http://adhithyan15.github.io/nila
|
2
2
|
(function() {
|
3
|
-
var read, readline, rl;
|
3
|
+
var read, readline, rl, stream;
|
4
4
|
|
5
5
|
// This is a small REPL for Nila to test out nila code and do bug fixes
|
6
6
|
|
7
7
|
readline = require('readline');
|
8
8
|
|
9
|
+
require('fs');
|
10
|
+
|
11
|
+
stream = fs.createWriteStream("my_file.nila");
|
12
|
+
|
13
|
+
stream.once('open',function(fd) {
|
14
|
+
stream.write("Testing!\n");
|
15
|
+
stream.;
|
16
|
+
});
|
17
|
+
|
9
18
|
rl = readline.createInterface(process.stdin, process.stdout);
|
10
19
|
|
11
20
|
rl.setPrompt('nila> ');
|
@@ -13,13 +22,6 @@
|
|
13
22
|
rl.prompt();
|
14
23
|
|
15
24
|
read = rl.on('line',function(line) {
|
16
|
-
switch(line.trim()) {
|
17
|
-
case 'hello':
|
18
|
-
console.log("world!");
|
19
|
-
break;
|
20
|
-
default:
|
21
|
-
console.log("Say what? I might have heard " + (line.trim()));
|
22
|
-
}
|
23
25
|
rl.prompt();
|
24
26
|
});
|
25
27
|
|
data/examples/repl.nila
CHANGED
@@ -2,6 +2,18 @@
|
|
2
2
|
|
3
3
|
require 'readline'
|
4
4
|
|
5
|
+
require 'fs'
|
6
|
+
|
7
|
+
stream = fs.createWriteStream("my_file.nila")
|
8
|
+
|
9
|
+
stream.once 'open', do |fd|
|
10
|
+
|
11
|
+
stream.write("Testing!\n")
|
12
|
+
|
13
|
+
stream.end()
|
14
|
+
|
15
|
+
end
|
16
|
+
|
5
17
|
rl = readline.createInterface(process.stdin, process.stdout)
|
6
18
|
|
7
19
|
rl.setPrompt('nila> ')
|
@@ -9,12 +21,7 @@ rl.setPrompt('nila> ')
|
|
9
21
|
rl.prompt()
|
10
22
|
|
11
23
|
read = rl.on 'line', do |line|
|
12
|
-
|
13
|
-
when 'hello'
|
14
|
-
puts "world!"
|
15
|
-
else
|
16
|
-
puts "Say what? I might have heard #{line.trim()}"
|
17
|
-
end
|
24
|
+
|
18
25
|
rl.prompt()
|
19
26
|
end
|
20
27
|
|
data/lib/nilac/version.rb
CHANGED
data/lib/nilac.rb
CHANGED
@@ -22,7 +22,6 @@ module Nilac
|
|
22
22
|
require 'nilac/replace_named_functions'
|
23
23
|
require 'nilac/compile_parallel_assignment'
|
24
24
|
require 'nilac/compile_default_values'
|
25
|
-
require 'nilac/compile_chained_comparison'
|
26
25
|
require 'nilac/get_variables'
|
27
26
|
require 'nilac/remove_question_marks'
|
28
27
|
require 'nilac/compile_arrays'
|
@@ -48,8 +47,7 @@ module Nilac
|
|
48
47
|
require 'nilac/parse_arguments'
|
49
48
|
require 'nilac/friendly_errors'
|
50
49
|
require 'nilac/compile_monkey_patching'
|
51
|
-
|
52
|
-
|
50
|
+
|
53
51
|
class NilaCompiler
|
54
52
|
|
55
53
|
include FriendlyErrors
|