kaiser-ruby 0.4.1 → 0.4.2

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: abfe1762b8d9f6f61d099f9faf0c8be9beec79ccf473c64c67a7a836065cd5ad
4
- data.tar.gz: 16006089cdfaaa670c317459dc4b1f9254727f08895259e31a0d0b293a8d55c7
3
+ metadata.gz: b00ca7f4d8ab7606f8a9933971ccdaec79b33c49bdbeb1eca54a812d1ca001d3
4
+ data.tar.gz: a30cea8a7445ec593eef4eac9ef33e0598b7b762d17081c692e7ea7c9da69066
5
5
  SHA512:
6
- metadata.gz: 100abb3f47da3345fccbbec209126ea8903b71de50596a6e9dd373a0189414b9a372eb03acadee72127ee6599ededdaf51173197cbb850496ec929cd96d5a4ef
7
- data.tar.gz: fb8d143e31f3e53de2085542f2ffb9d1ac6888034c52302aabb692d7c9985e85ca6f1a35a8e48400ca447b5cbe3f2af99e878c79af2517623b124127e6e7191b
6
+ metadata.gz: 433f27ff2a343efd7ffd467a3d618f2c8d9c203d457da59da80b2ad56d87a353d1d1047ab96825607754dec23fe14d2aff882e7742f7fbed7a1455b27d3fa9ea
7
+ data.tar.gz: 9bc1c414c8607297b046ec89d9f47a8617e6a0a526fb4e6990ed1797c16528bc242e8d0d00e9513485a60efc8c4fa924300ce8f7d01bbc730d3bd93504322c5a
data/CHANGELOG.md CHANGED
@@ -40,6 +40,8 @@ Language Implementation:
40
40
  - [x] Handle input from STDIN
41
41
  - [x] Handle contractions - "Janie's got a gun" should be expanded to "Janie is got a gun" and so it should transpile to "janie = 313"
42
42
  - [x] Handle pronouns - he, she, it, and others should refer to the last used variable
43
+ - [x] Better handle input of integers from STDIN
44
+ - [x] Print can print returned values from functions
43
45
 
44
46
  Other stuff:
45
47
 
@@ -47,3 +49,4 @@ Other stuff:
47
49
  - [x] Catch exceptions in the REPL
48
50
  - [x] Suppressed warning about eval from Thor
49
51
  - [x] Move nesting indentation from main module to transformer
52
+ - [x] Celsius to Fahrenheit example
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- kaiser-ruby (0.4.1)
4
+ kaiser-ruby (0.4.2)
5
5
  parslet (~> 1.8)
6
6
  thor (~> 0.20)
7
7
 
data/bin/console CHANGED
@@ -2,13 +2,5 @@
2
2
 
3
3
  require "bundler/setup"
4
4
  require "kaiser_ruby"
5
-
6
- # You can add fixtures and/or initialization code here to make experimenting
7
- # with your gem easier. You can also use a different console, if you like.
8
-
9
- # (If you use this, don't forget to add pry to your Gemfile!)
10
- # require "pry"
11
- # Pry.start
12
-
13
- require "irb"
14
- IRB.start(__FILE__)
5
+ require "pry"
6
+ Pry.start
@@ -162,7 +162,7 @@ module KaiserRuby
162
162
 
163
163
  rule(:print_function) do
164
164
  (
165
- say_keywords >> space >> value_or_variable.as(:output)
165
+ say_keywords >> space >> (function_call | value_or_variable).as(:output)
166
166
  ).as(:print)
167
167
  end
168
168
 
@@ -51,7 +51,7 @@ module KaiserRuby
51
51
  rule(print: { output: simple(:output) }) { "puts #{output}" }
52
52
  rule(continue: simple(:_)) { "next" }
53
53
  rule(break: simple(:_)) { "break" }
54
- rule(input_variable: simple(:var)) { "print '> '\n#{var} = STDIN.gets.chomp" }
54
+ rule(input_variable: simple(:var)) { "print '> '\n__input = STDIN.gets.chomp\n#{var} = Integer(__input) rescue input" }
55
55
 
56
56
  rule(equals: { left: simple(:left), right: simple(:right) }) { "#{left} == #{right}" }
57
57
  rule(not_equals: { left: simple(:left), right: simple(:right) }) { "#{left} != #{right}" }
@@ -1,3 +1,3 @@
1
1
  module KaiserRuby
2
- VERSION = "0.4.1"
2
+ VERSION = "0.4.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kaiser-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marcin Ruszkiewicz
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-08-10 00:00:00.000000000 Z
11
+ date: 2018-08-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler