rasel 1.1.5 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 42152f4939a9c6049c9b43db92c9abc20e11f460
4
- data.tar.gz: b9ff3be4c7364658661f7234ade9cea37f6601aa
3
+ metadata.gz: e92dd9f5a432fbb27899756bf1909f832164feb1
4
+ data.tar.gz: f990523da0477ec508bfd9bf6d3df742beebab27
5
5
  SHA512:
6
- metadata.gz: 0f0424e1913bfa31ab711c29cfc6f04b45bc2885675e3f881408fd8bc75f057244c12bb3572eb7106ac141c67288ee6933454b0a4627e3ac76c2a96d27a76fae
7
- data.tar.gz: 5c4aa2ed4ca6c805c2952167be34a42f57c1845a55d1c9576225d3aef7711652df0b33507dff1e47ba6f9881b91a4ba5784e0fb9ef9faae95bd7fff2693a242f
6
+ metadata.gz: f452fb7e3fafed5b26e25537c84613d20d4d0ee8973b58235c8eb6ed9374a7005921fdfdb751084fa43024724554f05cbf3edd7510daebc4cd823ad1c1d94435
7
+ data.tar.gz: a053ad0ae04e1c706e80dff4258aef378702df871ec1226dc175ab3774f7e0872215e01bf502d4b41599f87ab0b347f982bd7e59bced5b6e13c8881944bd949e
data/bin/rasel-annotated CHANGED
@@ -2,5 +2,5 @@
2
2
  Signal.trap(:INT){ abort "\n(interrupted by SIGINT)" }
3
3
 
4
4
  require_relative "../lib/rasel"
5
- require "json"
5
+ require "json/pure"
6
6
  exit RASEL::run_annotated(JSON.load(ARGF.read), STDOUT).exitcode
data/bin/rasel-convert CHANGED
@@ -11,7 +11,7 @@ end
11
11
  abort_usage.call unless ARGV[0] and File.file? ARGV[0]
12
12
  abort_usage.call unless ARGV[0] and ARGV[1] and (!File.exist?(ARGV[1]) || puts("overwriting")) || File.file?(ARGV[1])
13
13
 
14
- require "json"
14
+ require "json/pure"
15
15
  case ARGV.map &File.method(:extname)
16
16
  when %w{ .rasel .rasela }
17
17
  require_relative "../lib/rasel"
data/bin/rasel-ide CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  abort "usage:\trasel-ide <file.rasela>" unless 1 == ARGV.size
4
4
  abort "invalid directory" unless File.directory? File.dirname File.expand_path ARGV.first
5
- require "json"
5
+ require "json/pure"
6
6
  require_relative "../lib/rasel"
7
7
  RASEL.write_pretty_json ARGV.first, [[0,0,"@"]] unless File.exist? ARGV.first
8
8
  abort "the argument should be a file" unless File.file? ARGV.first if File.exist? ARGV.first
@@ -269,7 +269,7 @@ post "/run" do
269
269
  RASEL::run_annotated \
270
270
  JSON.load(File.read ARGV.first),
271
271
  StringIO.new,
272
- StringIO.new.tap{ |_| JSON.load(params.fetch "stdin").bytes.reverse_each &_.method(:ungetbyte) }
272
+ StringIO.new.tap{ |_| JSON.parse(params.fetch("stdin"), quirks_mode: true).bytes.reverse_each &_.method(:ungetbyte) }
273
273
  end
274
274
  JSON.dump({status: :success, data: [result.stdout.string.split("\n"), result.exitcode]})
275
275
  rescue Timeout::Error
data/lib/rasel.rb CHANGED
@@ -56,7 +56,6 @@ module RASEL
56
56
  when ?A..?Z ; stack.push byte - 55
57
57
  when ?" ; stringmode ^= true
58
58
  when ?# ; move[]
59
- when ?$ ; pop[]
60
59
  when ?: ; stack.concat [pop[]] * 2
61
60
  when ?- ; stack.push -(pop[] - pop[])
62
61
  when ?/ ; b, a = pop[], pop[]; stack.push b.zero? ? 0 : Rational(a) / b
@@ -116,7 +115,7 @@ module RASEL
116
115
  define_singleton_method :puts do |str, reason|
117
116
  next if prev == dump = JSON.dump([reason, str])
118
117
  old_puts.call prev = dump
119
- if 500_000 < stdout.pos - pos
118
+ if ENV.fetch("IDE_LIMIT_PRINTED", "500000").to_i < stdout.pos - pos
120
119
  old_puts.call JSON.dump [:abort, "printed size"]
121
120
  error.call
122
121
  end
@@ -160,7 +159,6 @@ module RASEL
160
159
  when ?A..?Z ; stack.push StackItem.new byte - 55, annotation
161
160
  when ?" ; stringmode ^= true
162
161
  when ?# ; move[]
163
- when ?$ ; pop[]
164
162
  when ?: ; popped = pop[]; stack.push popped; stack.push StackItem.new popped, annotation
165
163
  when ?- ; stack.push StackItem.new -(pop[] - pop[]), annotation
166
164
  when ?/ ; b, a = pop[], pop[]; stack.push StackItem.new b.zero? ? 0 : Rational(a) / b, annotation
data/rasel.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = "rasel"
3
- spec.version = "1.1.5"
3
+ spec.version = "1.2.0"
4
4
  spec.summary = "Random Access Stack Esoteric Language"
5
5
 
6
6
  spec.author = "Victor Maslov aka Nakilon"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rasel
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.5
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Victor Maslov aka Nakilon
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-09-02 00:00:00.000000000 Z
11
+ date: 2021-09-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json_pure