rpl 0.10.3 → 0.11.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/rpl +15 -2
- data/lib/rpl/words/repl.rb +5 -0
- data/lib/rpl.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 351033e886b47bece3ef9d5c143932c512c484bf92fce4128eb72edbdbdb7da3
|
4
|
+
data.tar.gz: 92812d157842f269ea72158f3db150ee62489aed54bba6d754ee2b4d6f386989
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a5be657562ddfe9aa9329e3e5dcbf4cd9253428b11d8b2822ae09cd2d6a4a05e11d6864d474135b9275b4b0f338e87ee606fad898c118a274cb72633153a532b
|
7
|
+
data.tar.gz: ed16880b36a64da41863d07d281f46f0c9db1a3f2b8a2b75ba99ed3ebafb8439fd6c008ef84c39bf1382cd203c8885735d5655077b01da237d4c770d0d1c5514
|
data/bin/rpl
CHANGED
@@ -20,12 +20,25 @@ class RplRepl
|
|
20
20
|
end
|
21
21
|
Readline.completion_append_character = ' '
|
22
22
|
|
23
|
+
prefill = ''
|
23
24
|
loop do
|
25
|
+
Readline.pre_input_hook = lambda do
|
26
|
+
return if prefill.empty?
|
27
|
+
|
28
|
+
Readline.refresh_line
|
29
|
+
Readline.insert_text( prefill.to_s )
|
30
|
+
Readline.redisplay
|
31
|
+
end
|
32
|
+
|
24
33
|
input = Readline.readline( ' ', true )
|
25
34
|
|
26
35
|
break if input.nil? || input.strip == 'quit'
|
27
36
|
|
28
|
-
|
37
|
+
prefill = ''
|
38
|
+
|
39
|
+
if input.strip == 'edit'
|
40
|
+
prefill = @interpreter.stack.pop.to_s
|
41
|
+
elsif input.strip == 'history'
|
29
42
|
Readline::HISTORY.each do |line|
|
30
43
|
pp line
|
31
44
|
end
|
@@ -62,7 +75,7 @@ options = { run_REPL: ARGV.empty?,
|
|
62
75
|
Version = Rpl::VERSION
|
63
76
|
|
64
77
|
OptionParser.new do |opts|
|
65
|
-
opts.on('-s',
|
78
|
+
opts.on('-s', '--state filename', "persist state in filename (default: #{options[:persistence_filename]}) (will be created if needed)") do |filename|
|
66
79
|
options[:persistence_filename] = File.expand_path( filename )
|
67
80
|
end
|
68
81
|
|
data/lib/rpl/words/repl.rb
CHANGED
@@ -31,6 +31,11 @@ module RplLang
|
|
31
31
|
proc {} )
|
32
32
|
|
33
33
|
@dictionary.add_word( ['edit'],
|
34
|
+
category,
|
35
|
+
'( x -- y ) put first stack object in prompt for modification',
|
36
|
+
proc {} )
|
37
|
+
|
38
|
+
@dictionary.add_word( ['extedit'],
|
34
39
|
category,
|
35
40
|
'( x -- y ) open object in $EDITOR',
|
36
41
|
proc do
|
data/lib/rpl.rb
CHANGED