ascode 0.6.1 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6c9a292efc67380cc922899d118d2e40399e7fc1dae2fdfbd2dc26057927b98d
4
- data.tar.gz: 1b748d5cc5797d564bb6256f599c7cc6b17ffe1aae6a90eafcd97ef1906e8422
3
+ metadata.gz: a14bfef61961e4ccc91ad40f9e695ec5c66e7ca58038075daeeef24ce1c9d131
4
+ data.tar.gz: d60742f61e14b47908f9a60b223840d392206f08f5c565fed9b95d9acc6b4592
5
5
  SHA512:
6
- metadata.gz: bebb09107ca8de1c76640f6821eabb14352256c876ffe4f01e6e28b91df37ca1b3c595a09243b43a9a74d8f5f58b09e1a1d484243eeafb0cb072056f7720ac3a
7
- data.tar.gz: 00cde58fce3ab5f62d8e91226289240ee425f58c627831f0ab745fbdd79654060fcc7c0db57c65f9ceb34f4c0f42d71e7b34e1ee98de9ee4fa73995729e8b7c1
6
+ metadata.gz: 9125118d12ab8f11b787b09d60876a7f53a8ae694e60e36a9eb21c290228ea6f092ccf201c55d59e3c9271b4bf6e735457b0d883b684b5c764341310ab1cf3b7
7
+ data.tar.gz: ea51aa9be5cd74ce33499b704d77fffdbc42d866ccd2ee56eae755e07acfc60904f246883b5530b892da5a90408e17019550f6d9614e7c211ff186cd9983c75f
data/README.md CHANGED
@@ -17,19 +17,16 @@ gem install ascode
17
17
 
18
18
  ###### Run
19
19
 
20
- Function reference is available in [`lib/ascode/parser/functions.md
20
+ > Function reference is available in [`lib/ascode/parser/functions.md
21
21
  `](https://github.com/sudoio/ascode/blob/master/lib/ascode/parser/functions.md).
22
22
 
23
- At this moment, the only way to play with `ascode` is `irb`.
24
-
25
23
  ```bash
26
- $ irb
27
- irb(main):001:0> require "ascode"
28
- => true
29
- irb(main):002:0> Ascode.run '"Number: "Oe["Even":"Odd"]O'
24
+ $ ascode '"Number: "Oe["Even":"Odd"]O'
30
25
  Number: 10
31
26
  Even
32
- irb(main):003:0> Ascode.run '"A: "OI"B: "OIS>["A > B":"A <= B"]O'
27
+ ```
28
+ ```bash
29
+ $ ascode '"A: "OI"B: "OIS>["A > B":"A <= B"]O'
33
30
  A: 10
34
31
  B: 5
35
32
  A > B
data/bin/ascode ADDED
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env ruby
2
+ require "ascode"
3
+
4
+ code = ARGV[0]
5
+
6
+ Ascode.run code
7
+ puts
@@ -30,6 +30,12 @@ module Ascode
30
30
  push a
31
31
  push b
32
32
  end
33
+
34
+ def copy
35
+ a = pop false
36
+ push a
37
+ push a
38
+ end
33
39
  end
34
40
  end
35
41
  end
@@ -4,7 +4,7 @@ module Ascode
4
4
  module Interpreter
5
5
  class IO
6
6
  def self.input(env)
7
- env.push Converter.convert gets
7
+ env.push Converter.convert STDIN.gets
8
8
  end
9
9
 
10
10
  def self.output(env)
@@ -12,6 +12,7 @@ Character|Type|Name|`pop`s|`push`es|Description
12
12
  ---|---|---|---|---|---
13
13
  `P`|`env`|`pop`|`a`||
14
14
  `S`|`env`|`swap`|`a`, `b`|`a`, `b`|Swaps first two elements in the stack
15
+ `C`|`env`|`copy`|`a`|`a`, `a`|Duplicates first element in the stack
15
16
 
16
17
  #### Condition
17
18
 
metadata CHANGED
@@ -1,24 +1,26 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ascode
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.1
4
+ version: 0.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Artem Varaksa
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-01-18 00:00:00.000000000 Z
11
+ date: 2018-01-20 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Esoteric golfing language. In active development, so behavior may be
14
14
  changed without prior notice.
15
15
  email:
16
- executables: []
16
+ executables:
17
+ - ascode
17
18
  extensions: []
18
19
  extra_rdoc_files: []
19
20
  files:
20
21
  - LICENSE.md
21
22
  - README.md
23
+ - bin/ascode
22
24
  - lib/ascode.rb
23
25
  - lib/ascode/converter.rb
24
26
  - lib/ascode/interpreter/condition.rb