xrpn 1.6 → 1.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. checksums.yaml +4 -4
  2. data/bin/xrpn +8 -1
  3. data/xcmd/stdout +8 -0
  4. data/xrpn.gemspec +2 -2
  5. metadata +6 -5
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6eaeb18f29172b8e96f6f06ef04d3be02c30296f13b3f7f67a30fae7791ba464
4
- data.tar.gz: d5807637849f72490dd5ec06357d3b7f8de1024850dd87954fdf2d69e1cdb6b8
3
+ metadata.gz: aa44e96ed478c71d7cbb9f6f3aa9a835970f77882080d2be9bdf8b8502ed382a
4
+ data.tar.gz: 6ab7e692701f1c9730a2e7588f46b5d729b53d1ee2a2e6358043de41ca5eee93
5
5
  SHA512:
6
- metadata.gz: d150e537776c8ffb9a0e1324a132b9fece173abbea78b23b329b082774d07da3e80d028a0098edf59655a10b983cc65df063ff5c57e8795c28e75a86756bb530
7
- data.tar.gz: ac92b3b15c37ddb86b921a4fbfa30ff3ac38237325747a1cd4b5ebcfce85bbd23634b284af332c76ebc7366457baa02ad86e9868fb5a879d726a1cc8d786a248
6
+ metadata.gz: 67561ad8ac3a3f353fbca88c7aec8c23dccf72cdc95112873f8b28082e1f34af4c27f9942c1ee330d4ac8ca4a62ddc51ef6774fb33b6e80bd947c8d1756fdd8f
7
+ data.tar.gz: 693f1a898d936f8679f324a3d1ea930c8f8a5b32dbecf9e8c0c98cbcc9648018dff78b5525e982699f03d15e3d36c82809383f59cad4204ae6488d8b2c240888
data/bin/xrpn CHANGED
@@ -135,15 +135,22 @@ until @p.pc == @p.prg[@p.pg].length do
135
135
  l2 ? ret = @p.send(l1.downcase, l2) : ret = @p.send(l1.downcase)
136
136
  rescue ArgumentError
137
137
  puts "Command needs an argument."
138
- @p.stop
138
+ exit if $exe
139
139
  rescue TypeError
140
140
  error("ERROR: Wrong type.")
141
+ exit if $exe
141
142
  rescue ZeroDivisionError
142
143
  error("ERROR: Division by zero.")
144
+ exit if $exe
143
145
  rescue FloatDomainError
144
146
  error("ERROR: Number out of range.")
147
+ exit if $exe
145
148
  rescue Math::DomainError
146
149
  error("ERROR: Number out of domain.")
150
+ exit if $exe
151
+ rescue Exception => err
152
+ puts "\n#{err}"
153
+ exit if $exe
147
154
  end
148
155
  puts ret if $debug and ret.instance_of? String
149
156
  puts ret if not $debug and ret.to_s.match(/Error:/)
data/xcmd/stdout ADDED
@@ -0,0 +1,8 @@
1
+ class XRPN
2
+ # Send content of X to STDOUT
3
+ def stdout
4
+ $stdout.write @x
5
+ end
6
+ end
7
+
8
+ # vim:ft=ruby:
data/xrpn.gemspec CHANGED
@@ -1,9 +1,9 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'xrpn'
3
- s.version = '1.6'
3
+ s.version = '1.8'
4
4
  s.licenses = ['Unlicense']
5
5
  s.summary = "XRPN - The eXtended RPN (Reverse Polish Notation) programming language"
6
- s.description = "A full programming language and environment extending the features of the venerable HP calculator programmable calculators. With XRPN you can accomplish a wide range of modern programming tasks as well as running existing HP-41 FOCAL programs directly. XRPN gives modern life to tens of thousands of old HP calculator programs and opens the possibilities to many, many more. New in 1.6: Added the option to use single-quotes for Alpha entry. Added the safety-catch of adding an END to programs that does not have and END as the last line."
6
+ s.description = "A full programming language and environment extending the features of the venerable HP calculator programmable calculators. With XRPN you can accomplish a wide range of modern programming tasks as well as running existing HP-41 FOCAL programs directly. XRPN gives modern life to tens of thousands of old HP calculator programs and opens the possibilities to many, many more. New in 1.7: Added function 'stdout' that writes content of X to STDOUT. New in 1.8: Better error handling - especially for the rsh integration (https://github.com/isene/rsh)."
7
7
 
8
8
  s.authors = ["Geir Isene"]
9
9
  s.email = 'g@isene.com'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: xrpn
3
3
  version: !ruby/object:Gem::Version
4
- version: '1.6'
4
+ version: '1.8'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Geir Isene
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-05-30 00:00:00.000000000 Z
11
+ date: 2023-06-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: tty-prompt
@@ -28,9 +28,9 @@ description: 'A full programming language and environment extending the features
28
28
  the venerable HP calculator programmable calculators. With XRPN you can accomplish
29
29
  a wide range of modern programming tasks as well as running existing HP-41 FOCAL
30
30
  programs directly. XRPN gives modern life to tens of thousands of old HP calculator
31
- programs and opens the possibilities to many, many more. New in 1.6: Added the option
32
- to use single-quotes for Alpha entry. Added the safety-catch of adding an END to
33
- programs that does not have and END as the last line.'
31
+ programs and opens the possibilities to many, many more. New in 1.7: Added function
32
+ ''stdout'' that writes content of X to STDOUT. New in 1.8: Better error handling
33
+ - especially for the rsh integration (https://github.com/isene/rsh).'
34
34
  email: g@isene.com
35
35
  executables:
36
36
  - xrpn
@@ -261,6 +261,7 @@ files:
261
261
  - xcmd/sreg
262
262
  - xcmd/sregq
263
263
  - xcmd/stdivide
264
+ - xcmd/stdout
264
265
  - xcmd/stmultiply
265
266
  - xcmd/sto
266
267
  - xcmd/stoflag