xrpn 2.3 → 2.4
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 +4 -4
- data/README.md +1 -1
- data/bin/xrpn +1 -1
- data/xcmd/getweb +2 -2
- data/xcmd/pprg +2 -2
- data/xlib/check +1 -1
- data/xlib/read_xcmd +10 -7
- data/xlib/rxcmd +20 -0
- data/xrpn.gemspec +2 -2
- metadata +5 -8
- data/xcmd/pprg1 +0 -28
- data/xcmd/reload +0 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 84914aee77f72d7498f7550ebd2baab36750512ef40df1821a5eecd3e990bc42
|
4
|
+
data.tar.gz: 05f5f0827b724fc60f627ecf7a830396ae037c6e2cfaf5f0fe3240fb519a4e58
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 644a84de681db279ebc4d710559c05b7d5411733474ea40b8f7ee54644176d3c371c8dbc86cffac9d89a05ea5549a77cae382289731f2ef441f16415d305d3c2
|
7
|
+
data.tar.gz: 7a573988b18edbed9c245eeb82c2b3fc3038375f72ba2832ebe1d2f5114c182723ef122d5ca99cb8193477a5f9b9b6fc46388a60cb51454214f812f94f74323d
|
data/README.md
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
# XRPN
|
2
|
-
  
|
2
|
+
 [](https://badge.fury.io/rb/xrpn)  
|
3
3
|
|
4
4
|
## Introduction
|
5
5
|
|
data/bin/xrpn
CHANGED
@@ -80,7 +80,7 @@ load(Dir.home+'/.xrpn/conf') if File.exist?(Dir.home+'/.xrpn/conf')
|
|
80
80
|
@p.x, @p.y, @p.z, @p.t, @p.a = @x, @y, @z, @t, @a
|
81
81
|
|
82
82
|
# INITIALIZE XRPN PROGRAM
|
83
|
-
@p.prg[@p.pg] = ["LBL \"XRPN\"", "END"]
|
83
|
+
@p.prg[@p.pg] = ["LBL \"XRPN\"", "END"] unless $rfile # Put dummy program in page 0 if no file/string to run
|
84
84
|
@p.prg[@p.pg] = hp_41($exe.split(",")) if $exe # Read in string as program is supplied by -e/--execute
|
85
85
|
@p.prg[@p.pg] = hp_41(@p.prg[@p.pg]) if $rfile # Substitute HP-41 commands with XRPN commands
|
86
86
|
if $lfile # Read file to load but not run if -l switch is used
|
data/xcmd/getweb
CHANGED
data/xcmd/pprg
CHANGED
@@ -7,7 +7,7 @@ class XRPN
|
|
7
7
|
pr = "\"#{@a}\""
|
8
8
|
page, pos, prgm = locate_prg (pr)
|
9
9
|
if pos == nil
|
10
|
-
puts "No such program to print
|
10
|
+
puts "No such program to print #{pr}"
|
11
11
|
return
|
12
12
|
end
|
13
13
|
end
|
@@ -25,4 +25,4 @@ class XRPN
|
|
25
25
|
end
|
26
26
|
end
|
27
27
|
|
28
|
-
# vim:ft=ruby:
|
28
|
+
# vim:ft=ruby:
|
data/xlib/check
CHANGED
data/xlib/read_xcmd
CHANGED
@@ -1,12 +1,14 @@
|
|
1
1
|
def read_xcmd
|
2
|
-
$cmd = []
|
3
2
|
if $gem
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
3
|
+
begin
|
4
|
+
Dir[$gem+"/xcmd/*"].each do |file|
|
5
|
+
load file
|
6
|
+
l = File.read(file)
|
7
|
+
c = l.sub(/.*\s*def /m, '')
|
8
|
+
c = c.sub(/\s.*/m, '')
|
9
|
+
$cmd.push(c)
|
10
|
+
end
|
11
|
+
rescue
|
10
12
|
end
|
11
13
|
end
|
12
14
|
Dir[Dir.home+"/.xrpn/xcmd/*"].each do |file|
|
@@ -17,6 +19,7 @@ def read_xcmd
|
|
17
19
|
$cmd.push(c)
|
18
20
|
end
|
19
21
|
$cmd.sort!
|
22
|
+
$cmd.uniq!
|
20
23
|
end
|
21
24
|
|
22
25
|
# vim:ft=ruby:
|
data/xlib/rxcmd
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
def rxcmd(xcmd)
|
2
|
+
return xcmd if $cmd.include?(xcmd)
|
3
|
+
$gem ? gfile = $gem+"/xcmd/#{xcmd}" : gfile = ""
|
4
|
+
xfile = Dir.home+"/.xrpn/xcmd/#{xcmd}"
|
5
|
+
[gfile, xfile].each do |file|
|
6
|
+
if File.exist?(file)
|
7
|
+
load file
|
8
|
+
l = File.read(file)
|
9
|
+
c = l.sub(/.*\s*def /m, '')
|
10
|
+
c = c.sub(/\s.*/m, '')
|
11
|
+
$cmd.push(c)
|
12
|
+
$cmd.sort!
|
13
|
+
$cmd.uniq!
|
14
|
+
return xcmd
|
15
|
+
end
|
16
|
+
end
|
17
|
+
return nil
|
18
|
+
end
|
19
|
+
|
20
|
+
# 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 = '2.
|
3
|
+
s.version = '2.4'
|
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 2.
|
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 2.4: Fixed loading of files via the -f switch."
|
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: '2.
|
4
|
+
version: '2.4'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Geir Isene
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2025-01-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: tty-prompt
|
@@ -28,10 +28,8 @@ 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 2.
|
32
|
-
|
33
|
-
access underlying Ruby. 2.2: Added error exception (flag 25) with commands ''error''=CF
|
34
|
-
25 and ''unerror''=SF 25. 2.3: Better Flag 25 handling.'
|
31
|
+
programs and opens the possibilities to many, many more. New in 2.4: Fixed loading
|
32
|
+
of files via the -f switch.'
|
35
33
|
email: g@isene.com
|
36
34
|
executables:
|
37
35
|
- xrpn
|
@@ -205,7 +203,6 @@ files:
|
|
205
203
|
- xcmd/posfl
|
206
204
|
- xcmd/pow
|
207
205
|
- xcmd/pprg
|
208
|
-
- xcmd/pprg1
|
209
206
|
- xcmd/pprgtofile
|
210
207
|
- xcmd/pprgx
|
211
208
|
- xcmd/pra
|
@@ -233,7 +230,6 @@ files:
|
|
233
230
|
- xcmd/recip
|
234
231
|
- xcmd/regmove
|
235
232
|
- xcmd/regswap
|
236
|
-
- xcmd/reload
|
237
233
|
- xcmd/reszfl
|
238
234
|
- xcmd/rnd
|
239
235
|
- xcmd/root
|
@@ -334,6 +330,7 @@ files:
|
|
334
330
|
- xlib/numformat
|
335
331
|
- xlib/read_state
|
336
332
|
- xlib/read_xcmd
|
333
|
+
- xlib/rxcmd
|
337
334
|
- xlib/save_state
|
338
335
|
- xlib/save_xm
|
339
336
|
- xlib/setpt
|
data/xcmd/pprg1
DELETED
@@ -1,28 +0,0 @@
|
|
1
|
-
class XRPN
|
2
|
-
# Print program
|
3
|
-
def pprg
|
4
|
-
page = @pg
|
5
|
-
pos = 0
|
6
|
-
if @a != ""
|
7
|
-
pr = "\"#{@a}\""
|
8
|
-
page, pos, prgm = locate_prg (pr)
|
9
|
-
if pos == nil
|
10
|
-
puts "No such program to print #{pr}"
|
11
|
-
return
|
12
|
-
end
|
13
|
-
end
|
14
|
-
@prg[page].each_index do |i|
|
15
|
-
next if i < pos
|
16
|
-
print "#{format('%02d', i + 1)}"
|
17
|
-
if @prg[page][i].downcase.match(/lbl/)
|
18
|
-
print "◆"
|
19
|
-
else
|
20
|
-
print " "
|
21
|
-
end
|
22
|
-
puts "#{@prg[page][i]}"
|
23
|
-
break if @prg[page][i] == "END"
|
24
|
-
end
|
25
|
-
end
|
26
|
-
end
|
27
|
-
|
28
|
-
# vim:ft=ruby:
|