xrpn 1.5 → 1.6

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 -4
  3. data/xlib/_xrpn_version +1 -1
  4. data/xrpn.gemspec +2 -2
  5. metadata +5 -6
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 257af776c59f5959ad0f647a818754cb9662a72b66bd9f57fbfd5de5ccd55bb0
4
- data.tar.gz: 4b2e366317250288ef9adc01a82c45a18547193bc4c07c224166f03a5291e07f
3
+ metadata.gz: 6eaeb18f29172b8e96f6f06ef04d3be02c30296f13b3f7f67a30fae7791ba464
4
+ data.tar.gz: d5807637849f72490dd5ec06357d3b7f8de1024850dd87954fdf2d69e1cdb6b8
5
5
  SHA512:
6
- metadata.gz: 35a01b19ccfd4fdf469345356966205c656b72fff3a82c26c2809fb6938dd9cab7908e2c04976ffd3eb7b608451587d46128707c130b05875beba0caab468444
7
- data.tar.gz: f1dd342b8f13f72e5540766ed43b7fc2cf48b0b099d3bec56fccff8e9aa745f884bad06dfe3765401d671c472968c4e0c003da4c1bf3b22fec65164270de2bc9
6
+ metadata.gz: d150e537776c8ffb9a0e1324a132b9fece173abbea78b23b329b082774d07da3e80d028a0098edf59655a10b983cc65df063ff5c57e8795c28e75a86756bb530
7
+ data.tar.gz: ac92b3b15c37ddb86b921a4fbfa30ff3ac38237325747a1cd4b5ebcfce85bbd23634b284af332c76ebc7366457baa02ad86e9868fb5a879d726a1cc8d786a248
data/bin/xrpn CHANGED
@@ -63,6 +63,7 @@ optparse = OptionParser.new do |opts|
63
63
  end
64
64
  optparse.parse!
65
65
 
66
+ # HANDLE INPUT FROM STDIN (PIPE) OR STRING VIA -e
66
67
  input = (STDIN.tty?) ? '' : $stdin.read
67
68
  $exe = input unless input == ''
68
69
 
@@ -85,6 +86,8 @@ if $lfile # Read file to load but
85
86
  @p.prg[i] = hp_41(@p.prg[i])
86
87
  end
87
88
  end
89
+ @p.prg[@p.pg].push("END") unless @p.prg[@p.pg].last.upcase == "END"
90
+
88
91
  read_state($sfile) if $sfile # Read state file in ~.xrpn/ if -s switch is used
89
92
  $debug = true if $lfile or $sfile # Do not run loaded program or program in state file
90
93
 
@@ -107,13 +110,13 @@ until @p.pc == @p.prg[@p.pg].length do
107
110
  @p.x = @line.to_f
108
111
  @p.flg["22"] = true # Number has been entered
109
112
  @p.flg["23"] = false
110
- elsif @line.match(/^>?".*"/) # If an Alpha string is supplied
111
- if @line.match(/^"\|/)
113
+ elsif @line.match(/^>?["'].*["']/) # If an Alpha string is supplied
114
+ if @line.match(/^["']\|/)
112
115
  @p.a += @line.sub(/\|-?/, '').gsub(/\"/, '') # Append to Alpha if "|abc", "|-abc"
113
- elsif @line.match(/^>"/)
116
+ elsif @line.match(/^>["']/)
114
117
  @p.a += @line.sub(/>/, '').gsub(/\"/, '') # Append to Alpha if >"abc"
115
118
  else
116
- @p.a = @line.gsub(/\"/, '') # ...or set Alpha to the supplied string
119
+ @p.a = @line.gsub(/["']/, '') # ...or set Alpha to the supplied string
117
120
  end
118
121
  @p.flg["22"] = false
119
122
  @p.flg["23"] = true # String has been entered
@@ -125,6 +128,7 @@ until @p.pc == @p.prg[@p.pg].length do
125
128
  l1 = "" if l1 == nil
126
129
  if not $cmd.include?(l1.downcase) # Catch unknown command
127
130
  puts "No such command: #{l1}"
131
+ exit if $exe
128
132
  @p.stop
129
133
  elsif XRPN.method_defined?(l1.downcase) # Or execute the command with either 1 or 2 parts
130
134
  begin
data/xlib/_xrpn_version CHANGED
@@ -1,5 +1,5 @@
1
1
  def xrpn_version
2
- puts "XRPN version: 1.5"
2
+ puts "XRPN version: 1.6"
3
3
  end
4
4
 
5
5
  # 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.5'
3
+ s.version = '1.6'
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.5: You can now pipe commands into xrpn or run xrpn with the -e option to supply a program from the command line. Such string must have commands separated by a comma like this: '1, 2, +, sin, 1/x, prx'"
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."
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.5'
4
+ version: '1.6'
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-29 00:00:00.000000000 Z
11
+ date: 2023-05-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: tty-prompt
@@ -28,10 +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.5: You can now
32
- pipe commands into xrpn or run xrpn with the -e option to supply a program from
33
- the command line. Such string must have commands separated by a comma like this:
34
- ''1, 2, +, sin, 1/x, prx'''
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.'
35
34
  email: g@isene.com
36
35
  executables:
37
36
  - xrpn