story-gen 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/NEWS +3 -0
  2. data/lib/story/compile.rb +17 -14
  3. metadata +1 -1
data/NEWS CHANGED
@@ -1,3 +1,6 @@
1
+ 0.1.3:
2
+ Bug fixes
3
+
1
4
  0.1.2:
2
5
  Bug fixes
3
6
  Comparison expression may now be the top expression (e. g., ^X = ^Y)
@@ -63,7 +63,7 @@ class Story
63
63
  relation_ids_code << "\n"<<
64
64
  "end\n"<<
65
65
  "protected\n"<<
66
- "def write0(io = STDOUT)\n"<<
66
+ "def write0()\n"<<
67
67
  init_var_arg_valuesss_vars << "\n"<<
68
68
  c << "\n"<<
69
69
  "end\n"<<
@@ -171,7 +171,7 @@ class Story
171
171
  def to_code
172
172
  code << "(begin\n" <<
173
173
  parts.map do |part|
174
- code << "print(" <<
174
+ code << "tell(" <<
175
175
  case part
176
176
  when String then part.to_rb
177
177
  when Var then at(part.pos) { part.name }
@@ -775,20 +775,23 @@ class Story
775
775
  args = []
776
776
  negated = false
777
777
  #
778
- one_or_more {
779
- _{ s = (_{dash} or _{other_char} or _{comma}) and act { relation_id << s } } or
780
- _{ a = asterisk and act { args << a; relation_id << :* } } or
781
- _{ _not_ and act { negated = !negated } } or
782
- _{ v = (_{value} or _{var} or _{above_var}) and act { args << v; relation_id << :* } } or
783
- _{
784
- w = (
785
- _{ word } or
786
- _{ _for_ and not_follows {all} } or
787
- _{ all }
788
- ) and
789
- act { relation_id << w.ru_downcase }
778
+ _{
779
+ many {
780
+ _{ s = (_{dash} or _{other_char} or _{comma}) and act { relation_id << s } } or
781
+ _{ a = asterisk and act { args << a; relation_id << :* } } or
782
+ _{ _not_ and act { negated = !negated } } or
783
+ _{ v = (_{value} or _{var} or _{above_var}) and act { args << v; relation_id << :* } } or
784
+ _{
785
+ w = (
786
+ _{ word } or
787
+ _{ _for_ and not_follows {all} } or
788
+ _{ all }
789
+ ) and
790
+ act { relation_id << w.ru_downcase }
791
+ }
790
792
  }
791
793
  } and
794
+ not relation_id.empty? and
792
795
  act { relation_id.chomp!(",") } and
793
796
  if not negated and relation_id.all? { |p| p == :* } then
794
797
  _(Statement::Tell[args])
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: story-gen
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: