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 +4 -4
- data/Gemfile.lock +1 -1
- data/TODO.md +2 -1
- data/lib/kaiser_ruby.rb +0 -1
- data/lib/kaiser_ruby/rockstar_parser.rb +3 -4
- data/lib/kaiser_ruby/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2a1985d728a64d673e6aa925260f338fff1bafb725e69573e9ef1927acfbbba3
|
4
|
+
data.tar.gz: 2afb896bbb347197390f5291c340e56b3d314b164fe9ab4f003a2989a186e546
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4487182e399e47821e3edbba6e1ad5cb505836c4f029296c4915896827ee013303e889a878fd5aeaa91e0b7c38072419b367f0c90c0c5ccba274c0a35032fa2e
|
7
|
+
data.tar.gz: 494b8aed64be73611e43fbe7fa7326005407212c86ceea02d3ba818c5dfadbd983379a5bd31ad89143327c7a5c13ccac742161ed9653e012e8bd56b6ab1c43ad
|
data/Gemfile.lock
CHANGED
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
|
-
- [
|
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
@@ -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['
|
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['
|
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['
|
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) }
|
data/lib/kaiser_ruby/version.rb
CHANGED