nil 1.0.0 → 1.0.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.
data/README.md CHANGED
@@ -83,9 +83,21 @@ Or install it yourself as:
83
83
 
84
84
  ## Usage
85
85
 
86
+ ```ruby
87
+ require 'nil'
88
+
89
+ code = "+4."
90
+
91
+ mp = Nil::MacroParser.new
92
+ code = mp.parse code
93
+
94
+ interpreter = Nil::Interpreter.new
95
+ interpreter.compile code
96
+
97
+ interpreter.run
86
98
  ```
87
- $ nil file.nil
88
- ```
99
+
100
+ Executable coming soon!
89
101
 
90
102
  ## Contributing
91
103
 
data/bin/nil ADDED
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'nil'
4
+
5
+ code = ARGF.read
6
+
7
+ mp = Nil::MacroParser.new
8
+ code = mp.parse code
9
+
10
+ i = Nil::Interpreter.new
11
+
12
+ i.compile code
13
+
14
+ i.run
@@ -13,7 +13,7 @@ module Nil
13
13
  when ']'
14
14
  "end\n"
15
15
  when '.'
16
- "print stack[sp]\n"
16
+ "puts stack[sp]\n"
17
17
  when ','
18
18
  "stack[sp] = gets[0]\n"
19
19
  end
data/lib/nil/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Nil
2
- VERSION = "1.0.0"
2
+ VERSION = "1.0.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nil
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -14,7 +14,8 @@ dependencies: []
14
14
  description: A brain**** macro language and interpreter
15
15
  email:
16
16
  - wuffers.lightwolf@me.com
17
- executables: []
17
+ executables:
18
+ - nil
18
19
  extensions: []
19
20
  extra_rdoc_files: []
20
21
  files:
@@ -24,6 +25,7 @@ files:
24
25
  - LICENSE
25
26
  - README.md
26
27
  - Rakefile
28
+ - bin/nil
27
29
  - lib/nil.rb
28
30
  - lib/nil/interpreter.rb
29
31
  - lib/nil/macro.rb