kaiser-ruby 0.2.0 → 0.2.1

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: 9b5718545e9c7f76ee7424888738a48381168802086130192a15fee4d6c2f11a
4
- data.tar.gz: a01209b2869ccbef8a0aa9824bba5b2cee0383e4a5cdb8044db5a0447d1805cf
3
+ metadata.gz: 2a1985d728a64d673e6aa925260f338fff1bafb725e69573e9ef1927acfbbba3
4
+ data.tar.gz: 2afb896bbb347197390f5291c340e56b3d314b164fe9ab4f003a2989a186e546
5
5
  SHA512:
6
- metadata.gz: 535f03ccac46331c49ef62b7b22f529ad4a7248c35fefacb6d3c3ee77603eb4a85c6cbb50580aa20fe210f3a8dabd4fa8a1cb381a6fb2fb0d97dea728a474a07
7
- data.tar.gz: 328d6528bb967ca27e7eea4e69df429f08ad7659b28bd3058e357f28113153933a75de32d0efbdb817a7e7a6afb62d54b2b3379df50cf7d44df77f40da633af2
6
+ metadata.gz: 4487182e399e47821e3edbba6e1ad5cb505836c4f029296c4915896827ee013303e889a878fd5aeaa91e0b7c38072419b367f0c90c0c5ccba274c0a35032fa2e
7
+ data.tar.gz: 494b8aed64be73611e43fbe7fa7326005407212c86ceea02d3ba818c5dfadbd983379a5bd31ad89143327c7a5c13ccac742161ed9653e012e8bd56b6ab1c43ad
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- kaiser-ruby (0.2.0)
4
+ kaiser-ruby (0.2.1)
5
5
  parslet (~> 1.8)
6
6
  thor (~> 0.20)
7
7
 
data/TODO.md CHANGED
@@ -36,8 +36,9 @@
36
36
  - [ ] Should be able to run the [Cellular Rockomata](https://github.com/Rifhutch/cellular-rocktomata)
37
37
  - [ ] Fibonacci example https://github.com/dylanbeattie/rockstar/issues/94#issuecomment-408217504
38
38
  - [ ] Math module https://gist.github.com/wrenoud/6be6f7509c88a3d8f9867ae782fb768f
39
+ - [ ] Primality checker https://www.reddit.com/r/RockstarDevs/comments/92i6sm/primality_checker_in_rockstar/
39
40
 
40
41
  ## Other stuff
41
42
 
42
- - [ ] Test if it handles metal umlauts (Ruby shouldn't care much, but tests should be made)
43
+ - [x] Test if it handles metal umlauts (Ruby shouldn't care much, but tests should be made)
43
44
  - [ ] Ignore comments in parentheses
data/lib/kaiser_ruby.rb CHANGED
@@ -1,7 +1,6 @@
1
1
  require 'parslet'
2
2
  require 'kaiser_ruby/rockstar_parser'
3
3
  require 'kaiser_ruby/rockstar_transform'
4
- require 'pry'
5
4
 
6
5
  module KaiserRuby
7
6
  def self.parse(input)
@@ -17,8 +17,7 @@ module KaiserRuby
17
17
  rule(:say_keywords) { str('Say') | str('Shout') | str('Scream') | str('Whisper') }
18
18
  rule(:flow_keywords) { str('If') | str('Else') | str('While') | str('Until') }
19
19
 
20
- rule(:proper_word) { reserved.absent? >> match['A-Z'] >> match['A-Za-z'].repeat }
21
- rule(:common_word) { reserved.absent? >> match['A-Za-z'].repeat }
20
+ rule(:proper_word) { reserved.absent? >> match['[[:upper:]]'] >> match['[[:alpha:]]'].repeat }
22
21
  rule(:common_variable_name) do
23
22
  (
24
23
  str('A ') | str('a ') |
@@ -26,7 +25,7 @@ module KaiserRuby
26
25
  str('The ') | str('the ') |
27
26
  str('My ') | str('my ') |
28
27
  str('Your ') | str('your ')
29
- ) >> reserved.absent? >> match['a-z'].repeat
28
+ ) >> reserved.absent? >> match['[[:lower:]]'].repeat
30
29
  end
31
30
  rule(:proper_variable_name) do
32
31
  (proper_word >> (space >> proper_word).repeat).repeat(1)
@@ -39,7 +38,7 @@ module KaiserRuby
39
38
  rule(:nil_value) { nil_value_keywords.as(:nil_value) }
40
39
  rule(:true_value) { true_value_keywords.as(:true_value) }
41
40
  rule(:false_value) { false_value_keywords.as(:false_value) }
42
- rule(:string_value) { (str('"') >> match['A-Za-z '].repeat >> str('"')).as(:string_value) }
41
+ rule(:string_value) { (str('"') >> match['[[:alpha:]] '].repeat >> str('"')).as(:string_value) }
43
42
  rule(:numeric_value) { match['0-9\.'].repeat.as(:numeric_value) }
44
43
  rule(:unquoted_string) { match['^\n'].repeat.as(:unquoted_string) }
45
44
  rule(:string_as_number) { reserved.absent? >> match['^\n'].repeat.as(:string_as_number) }
@@ -1,3 +1,3 @@
1
1
  module KaiserRuby
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kaiser-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marcin Ruszkiewicz