about summary refs log tree commit diff stats
path: root/tests/test_keyhandlers.h
Commit message (Expand)AuthorAgeFilesLines
* Added gnu readlineJames Booth2015-01-271-14/+21
* Added key insert tests, extracted key_ctrl_left handlerJames Booth2015-01-201-6/+30
* Added key insert handler testsJames Booth2015-01-201-1/+6
* Extracted keyhandler for printable charactersJames Booth2015-01-201-0/+11
60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78
# Copyright (C) 2009, 2010  Roman Zimbelmann <romanz@lavabit.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.

"""Ranger - file browser for the unix terminal"""

from os import path, environ
from os.path import join as _join
from ranger.ext.openstruct import OpenStruct
from sys import argv

# Information
__license__ = 'GPL3'
__version__ = '1.3.0'
__author__ = __maintainer__ = 'Roman Zimbelmann'
__email__ = 'romanz@lavabit.com'

# Constants
USAGE = '%prog [options] [path/filename]'
RANGERDIR = path.dirname(__file__)
LOGFILE = '/tmp/errorlog'
if 'XDG_CONFIG_HOME' in environ and environ['XDG_CONFIG_HOME']:
	DEFAULT_CONFDIR = environ['XDG_CONFIG_HOME'] + '/ranger'
else:
	DEFAULT_CONFDIR = '~/.config/ranger'
DEBUG = ('-d' in argv or '--debug' in argv) and ('--' not in argv or
	(('-d' in argv and argv.index('-d') < argv.index('--')) or
	('--debug' in argv and argv.index('--debug') < argv.index('--'))))

# Get some valid arguments before actually parsing them in main()
arg = OpenStruct(debug=DEBUG, clean=False, confdir=DEFAULT_CONFDIR,
		mode=0, flags='', targets=[])

# Debugging features.  These will be activated when run with --debug.
# Example usage in the code:
# import ranger; ranger.log("hello world")
def log(*objects, **keywords):
	"""
	Writes objects to a logfile (for the purpose of debugging only.)
	Has the same arguments as print() in python3.
	"""
	if LOGFILE is None or not arg.debug or arg.clean: return
	start = 'start' in keywords and keywords['start'] pre { line-height: 125%; }
td.linenos .normal { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
span.linenos { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
td.linenos .special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
span.linenos.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
.highlight .hll { background-color: #ffffcc }
.highlight .c { color: #888888 } /* Comment */
.highlight .err { color: #a61717; background-color: #e3d2d2 } /* Error */
.highlight .k { color: #008800; font-weight: bold } /* Keyword */
.highlight .ch { color: #888888 } /* Comment.Hashbang */
.highlight .cm { color: #888888 } /* Comment.Multiline */
.highlight .cp { color: #cc0000; font-weight: bold } /* Comment.Preproc */
.highlight .cpf { color: #888888 } /* Comment.PreprocFile */
.highlight .c1 { color: #888888 } /* Comment.Single */
.highlight .cs { color: #cc0000; font-weight: bold; background-color: #fff0f0 } /* Comment.Special */
.highlight .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */
.highlight .ge { font-style: italic } /* Generic.Emph */
.highlight .ges { font-weight: bold; font-style: italic } /* Generic.EmphStrong */
.highlight .gr { color: #aa0000 } /* Generic.Error */
.highlight .gh { color: #333333 } /* Generic.Heading */
.highlight .gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */
.highlight .go { color: #888888 } /* Generic.Output */
.highlight .gp { color: #555555 } /* Generic.Prompt */
.highlight .gs { font-weight: bold } /* Generic.Strong */
.highlight .gu { color: #666666 } /* Generic.Subheading */
.highlight .gt { color: #aa0000 } /* Generic.Traceback */
.highlight .kc { color: #008800; font-weight: bold } /* Keyword.Constant */
.highlight .kd { color: #008800; font-weight: bold } /* Keyword.Declaration */
.highlight .kn { color: #008800; font-weight: bold } /* Keyword.Namespace */
.highlight .kp { color: #008800 } /* Keyword.Pseudo */
.highlight .kr { color: #008800; font-weight: bold } /* Keyword.Reserved */
.highlight .kt { color: #888888; font-weight: bold } /* Keyword.Type */
.highlight .m { color: #0000DD; font-weight: bold } /* Literal.Number */
.highlight .s { color: #dd2200; background-color: #fff0f0 } /* Literal.String */
.highlight .na { color: #336699 } /* Name.Attribute */
.highlight .nb { color: #003388 } /* Name.Builtin */
.highlight .nc { color: #bb0066; font-weight: bold } /* Name.Class */
.highlight .no { color: #003366; font-weight: bold } /* Name.Constant */
.highlight .nd { color: #555555 } /* Name.Decorator */
.highlight .ne { color: #bb0066; font-weight: bold } /* Name.Exception */
.highlight .nf { color: #0066bb; font-weight: bold } /* Name.Function */
.highlight .nl { color: #336699; font-style: italic } /* Name.Label */
.highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */
.highlight .py { color: #336699; font-weight: bold } /* Name.Property */
.highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */
.highlight .nv { color: #336699 } /* Name.Variable */
.highlight .ow { color: #008800 } /* Operator.Word */
.highlight .w { color: #bbbbbb } /* Text.Whitespace */
.highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */
.highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */
.highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */
.highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */
.highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */
.highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */
.highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */
.highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */
.highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */
.highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */
.highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */
.highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */
.highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */
.highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */
.highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */
.highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */
.highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */
.highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */
.highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */
.highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */
.highlight .vc { color: #336699 } /* Name.Variable.Class */
.highlight .vg { color: #dd7700 } /* Name.Variable.Global */
.highlight .vi { color: #3333bb } /* Name.Variable.Instance */
.highlight .vm { color: #336699 } /* Name.Variable.Magic */
.highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
c{0: 0 (((1 string-address)) <- ((new)) abc) -- nil
c{0: 1 (((2 string-address)) <- ((new)) bd) -- nil
c{0: 2 (((3 integer)) <- ((find-substring)) ((1 string-address)) ((2 string-address)) ((0 literal))) -- nil
c{1: 0 ✓ (((1 string-address)) <- ((new)) abc)
c{1: 1 ✓ (((2 string-address)) <- ((new)) bd)
c{1: 2 ✓ (((3 integer)) <- ((find-substring)) ((1 string-address)) ((2 string-address)) ((0 literal)))
cn0: convert-names in main
cn0: (((1 string-address)) <- ((new)) abc) nil nil
cn0: checking arg abc
cn0: checking oarg ((1 string-address))
maybe-add: ((1 string-address))
cn0: (((2 string-address)) <- ((new)) bd) nil nil
cn0: checking arg bd
cn0: checking oarg ((2 string-address))
maybe-add: ((2 string-address))
cn0: (((3 integer)) <- ((find-substring)) ((1 string-address)) ((2 string-address)) ((0 literal))) nil nil
cn0: checking arg ((1 string-address))
maybe-add: ((1 string-address))
cn0: checking arg ((2 string-address))
maybe-add: ((2 string-address))
cn0: checking arg ((0 literal))
cn0: checking oarg ((3 integer))
maybe-add: ((3 integer))
cn1: (((1 string-address)) <- ((new)) abc)
cn1: (((2 string-address)) <- ((new)) bd)
cn1: (((3 integer)) <- ((find-substring)) ((1 string-address)) ((2 string-address)) ((0 literal)))
schedule: main
run: main 0: (((1 string-address)) <- ((new)) abc)
run: main 0: 1000 => ((1 string-address))
mem: ((1 string-address)): 1 <= 1000
run: main 1: (((2 string-address)) <- ((new)) bd)
run: main 1: 1004 => ((2 string-address))
mem: ((2 string-address)): 2 <= 1004
run: main 2: (((3 integer)) <- ((find-substring)) ((1 string-address)) ((2 string-address)) ((0 literal)))
mem: ((1 string-address)) => 1000
mem: ((2 string-address)) => 1004
run: find-substring/main 0: (((default-space space-address)) <- ((new)) ((space literal)) ((30 literal)))
run: find-substring/main 0: 1007 => ((default-space space-address))
run: find-substring/main 1: (((1 string-address)) <- ((next-input)))
arg: nil 0 (1000 1004 0)
run: find-substring/main 1: 1000 => ((1 string-address))
mem: ((1 string-address)): 1009 <= 1000
run: find-substring/main 2: (((2 string-address)) <- ((next-input)))
arg: nil 1 (1000 1004 0)
run: find-substring/main 2: 1004 => ((2 string-address))
mem: ((2 string-address)): 1010 <= 1004
run: find-substring/main 3: (((3 integer)) <- ((next-input)))
arg: nil 2 (1000 1004 0)
run: find-substring/main 3: 0 => ((3 integer))
mem: ((3 integer)): 1011 <= 0
run: find-substring/main 4: (((4 character)) <- ((index)) ((2 string-address) (deref)) ((0 literal)))
array-len: ((1004 string) (raw))
mem: ((1004 integer) (raw)) => 2
mem: ((1005 byte) (raw)) => b
run: find-substring/main 4: #\b => ((4 character))
mem: ((4 character)): 1012 <= #\b
run: find-substring/main 5: (((5 integer)) <- ((length)) ((1 string-address) (deref)))
array-len: ((1 string-address) (deref))
mem: ((1000 integer) (raw)) => 3
run: find-substring/main 5: 3 => ((5 integer))
mem: ((5 integer)): 1013 <= 3
run: find-substring/main 6: (((6 boolean)) <- ((greater-or-equal)) ((3 integer)) ((5 integer)))
mem: ((3 integer)) => 0
mem: ((5 integer)) => 3
run: find-substring/main 6: nil => ((6 boolean))
mem: ((6 boolean)): 1014 <= nil
run: find-substring/main 7: (((jump-if)) ((6 boolean)) ((5 offset)))
mem: ((6 boolean)) => nil
run: find-substring/main 8: (((7 boolean)) <- ((match-at)) ((1 string-address)) ((2 string-address)) ((3 integer)))
mem: ((1 string-address)) => 1000
mem: ((2 string-address)) => 1004
mem: ((3 integer)) => 0
run: match-at/find-substring/main 0: (((default-space space-address)) <- ((new)) ((space literal)) ((30 literal)))
run: match-at/find-substring/main 0: 1038 => ((default-space space-address))
run: match-at/find-substring/main 1: (((1 string-address)) <- ((next-input)))
arg: nil 0 (1000 1004 0)
run: match-at/find-substring/main 1: 1000 => ((1 string-address))
mem: ((1 string-address)): 1040 <= 1000
run: match-at/find-substring/main 2: (((2 string-address)) <- ((next-input)))
arg: nil 1 (1000 1004 0)
run: match-at/find-substring/main 2: 1004 => ((2 string-address))
mem: ((2 string-address)): 1041 <= 1004
run: match-at/find-substring/main 3: (((3 integer)) <- ((next-input)))
arg: nil 2 (1000 1004 0)
run: match-at/find-substring/main 3: 0 => ((3 integer))
mem: ((3 integer)): 1042 <= 0
run: match-at/find-substring/main 4: (((4 integer)) <- ((length)) ((2 string-address) (deref)))
array-len: ((2 string-address) (deref))
mem: ((1004 integer) (raw)) => 2
run: match-at/find-substring/main 4: 2 => ((4 integer))
mem: ((4 integer)): 1043 <= 2
run: match-at/find-substring/main 5: (((5 integer)) <- ((length)) ((1 string-address) (deref)))
array-len: ((1 string-address) (deref))
mem: ((1000 integer) (raw)) => 3
run: match-at/find-substring/main 5: 3 => ((5 integer))
mem: ((5 integer)): 1044 <= 3
run: match-at/find-substring/main 6: (((5 integer)) <- ((subtract)) ((5 integer)) ((4 integer)))
mem: ((5 integer)) => 3
mem: ((4 integer)) => 2
run: match-at/find-substring/main 6: 1 => ((5 integer))
mem: ((5 integer)): 1044 <= 1
run: match-at/find-substring/main 7: (((6 boolean)) <- ((lesser-or-equal)) ((3 integer)) ((5 integer)))
mem: ((3 integer)) => 0
mem: ((5 integer)) => 1
run: match-at/find-substring/main 7: t => ((6 boolean))
mem: ((6 boolean)): 1045 <= t
run: match-at/find-substring/main 8: (((jump-if)) ((6 boolean)) ((1 offset)))
mem: ((6 boolean)) => t
run: match-at/find-substring/main 10: (((7 integer)) <- ((copy)) ((0 literal)))
run: match-at/find-substring/main 10: 0 => ((7 integer))
mem: ((7 integer)): 1046 <= 0
run: match-at/find-substring/main 11: (((8 boolean)) <- ((greater-or-equal)) ((7 integer)) ((4 integer)))
mem: ((7 integer)) => 0
mem: ((4 integer)) => 2
run: match-at/find-substring/main 11: nil => ((8 boolean))
mem: ((8 boolean)): 1047 <= nil
run: match-at/find-substring/main 12: (((jump-if)) ((8 boolean)) ((8 offset)))
mem: ((8 boolean)) => nil
run: match-at/find-substring/main 13: (((9 character)) <- ((index)) ((1 string-address) (deref)) ((3 integer)))
mem: ((3 integer)) => 0
array-len: ((1000 string) (raw))
mem: ((1000 integer) (raw)) => 3
mem: ((1001 byte) (raw)) => a
run: match-at/find-substring/main 13: #\a => ((9 character))
mem: ((9 character)): 1048 <= #\a
run: match-at/find-substring/main 14: (((10 character)) <- ((index)) ((2 string-address) (deref)) ((7 integer)))
mem: ((7 integer)) => 0
array-len: ((1004 string) (raw))
mem: ((1004 integer) (raw)) => 2
mem: ((1005 byte) (raw)) => b
run: match-at/find-substring/main 14: #\b => ((10 character))
mem: ((10 character)): 1049 <= #\b
run: match-at/find-substring/main 15: (((11 boolean)) <- ((equal)) ((9 character)) ((10 character)))
mem: ((9 character)) => a
mem: ((10 character)) => b
run: match-at/find-substring/main 15: nil => ((11 boolean))
mem: ((11 boolean)): 1050 <= nil
run: match-at/find-substring/main 16: (((jump-if)) ((11 boolean)) ((1 offset)))
mem: ((11 boolean)) => nil
run: match-at/find-substring/main 17: (((reply)) ((nil literal)))
run: find-substring/main 8: nil => ((7 boolean))
mem: ((7 boolean)): 1015 <= nil
run: find-substring/main 9: (((jump-if)) ((7 boolean)) ((3 offset)))
mem: ((7 boolean)) => nil
run: find-substring/main 10: (((3 integer)) <- ((add)) ((3 integer)) ((1 literal)))
mem: ((3 integer)) => 0
run: find-substring/main 10: 1 => ((3 integer))
mem: ((3 integer)): 1011 <= 1
run: find-substring/main 11: (((3 integer)) <- ((find-next)) ((1 string-address)) ((4 character)) ((3 integer)))
mem: ((1 string-address)) => 1000
mem: ((4 character)) => b
mem: ((3 integer)) => 1
run: find-next/find-substring/main 0: (((default-space space-address)) <- ((new)) ((space literal)) ((30 literal)))
run: find-next/find-substring/main 0: 1069 => ((default-space space-address))
run: find-next/find-substring/main 1: (((1 string-address)) <- ((next-input)))
arg: nil 0 (1000 #\b 1)
run: find-next/find-substring/main 1: 1000 => ((1 string-address))
mem: ((1 string-address)): 1071 <= 1000
run: find-next/find-substring/main 2: (((2 character)) <- ((next-input)))
arg: nil 1 (1000 #\b 1)
run: find-next/find-substring/main 2: #\b => ((2 character))
mem: ((2 character)): 1072 <= #\b
run: find-next/find-substring/main 3: (((3 integer)) <- ((next-input)))
arg: nil 2 (1000 #\b 1)
run: find-next/find-substring/main 3: 1 => ((3 integer))
mem: ((3 integer)): 1073 <= 1
run: find-next/find-substring/main 4: (((4 integer)) <- ((length)) ((1 string-address) (deref)))
array-len: ((1 string-address) (deref))
mem: ((1000 integer) (raw)) => 3
run: find-next/find-substring/main 4: 3 => ((4 integer))
mem: ((4 integer)): 1074 <= 3
run: find-next/find-substring/main 5: (((5 boolean)) <- ((greater-or-equal)) ((3 integer)) ((4 integer)))
mem: ((3 integer)) => 1
mem: ((4 integer)) => 3
run: find-next/find-substring/main 5: nil => ((5 boolean))
mem: ((5 boolean)): 1075 <= nil
run: find-next/find-substring/main 6: (((jump-if)) ((5 boolean)) ((5 offset)))
mem: ((5 boolean)) => nil
run: find-next/find-substring/main 7: (((6 byte)) <- ((index)) ((1 string-address) (deref)) ((3 integer)))
mem: ((3 integer)) => 1
array-len: ((1000 string) (raw))
mem: ((1000 integer) (raw)) => 3
mem: ((1002 byte) (raw)) => b
run: find-next/find-substring/main 7: #\b => ((6 byte))
mem: ((6 byte)): 1076 <= #\b
run: find-next/find-substring/main 8: (((7 boolean)) <- ((equal)) ((6 byte)) ((2 character)))
mem: ((6 byte)) => b
mem: ((2 character)) => b
run: find-next/find-substring/main 8: t => ((7 boolean))
mem: ((7 boolean)): 1077 <= t
run: find-next/find-substring/main 9: (((jump-if)) ((7 boolean)) ((2 offset)))
mem: ((7 boolean)) => t
run: find-next/find-substring/main 12: (((reply)) ((3 integer)))
mem: ((3 integer)) => 1
run: find-substring/main 11: 1 => ((3 integer))
mem: ((3 integer)): 1011 <= 1
run: find-substring/main 12: (((jump)) ((-7 offset)))
run: find-substring/main 6: (((6 boolean)) <- ((greater-or-equal)) ((3 integer)) ((5 integer)))
mem: ((3 integer)) => 1
mem: ((5 integer)) => 3
run: find-substring/main 6: nil => ((6 boolean))
mem: ((6 boolean)): 1014 <= nil
run: find-substring/main 7: (((jump-if)) ((6 boolean)) ((5 offset)))
mem: ((6 boolean)) => nil
run: find-substring/main 8: (((7 boolean)) <- ((match-at)) ((1 string-address)) ((2 string-address)) ((3 integer)))
mem: ((1 string-address)) => 1000
mem: ((2 string-address)) => 1004
mem: ((3 integer)) => 1
run: match-at/find-substring/main 0: (((default-space space-address)) <- ((new)) ((space literal)) ((30 literal)))
run: match-at/find-substring/main 0: 1100 => ((default-space space-address))
run: match-at/find-substring/main 1: (((1 string-address)) <- ((next-input)))
arg: nil 0 (1000 1004 1)
run: match-at/find-substring/main 1: 1000 => ((1 string-address))
mem: ((1 string-address)): 1102 <= 1000
run: match-at/find-substring/main 2: (((2 string-address)) <- ((next-input)))
arg: nil 1 (1000 1004 1)
run: match-at/find-substring/main 2: 1004 => ((2 string-address))
mem: ((2 string-address)): 1103 <= 1004
run: match-at/find-substring/main 3: (((3 integer)) <- ((next-input)))
arg: nil 2 (1000 1004 1)
run: match-at/find-substring/main 3: 1 => ((3 integer))
mem: ((3 integer)): 1104 <= 1
run: match-at/find-substring/main 4: (((4 integer)) <- ((length)) ((2 string-address) (deref)))
array-len: ((2 string-address) (deref))
mem: ((1004 integer) (raw)) => 2
run: match-at/find-substring/main 4: 2 => ((4 integer))
mem: ((4 integer)): 1105 <= 2
run: match-at/find-substring/main 5: (((5 integer)) <- ((length)) ((1 string-address) (deref)))
array-len: ((1 string-address) (deref))
mem: ((1000 integer) (raw)) => 3
run: match-at/find-substring/main 5: 3 => ((5 integer))
mem: ((5 integer)): 1106 <= 3
run: match-at/find-substring/main 6: (((5 integer)) <- ((subtract)) ((5 integer)) ((4 integer)))
mem: ((5 integer)) => 3
mem: ((4 integer)) => 2
run: match-at/find-substring/main 6: 1 => ((5 integer))
mem: ((5 integer)): 1106 <= 1
run: match-at/find-substring/main 7: (((6 boolean)) <- ((lesser-or-equal)) ((3 integer)) ((5 integer)))
mem: ((3 integer)) => 1
mem: ((5 integer)) => 1
run: match-at/find-substring/main 7: t => ((6 boolean))
mem: ((6 boolean)): 1107 <= t
run: match-at/find-substring/main 8: (((jump-if)) ((6 boolean)) ((1 offset)))
mem: ((6 boolean)) => t
run: match-at/find-substring/main 10: (((7 integer)) <- ((copy)) ((0 literal)))
run: match-at/find-substring/main 10: 0 => ((7 integer))
mem: ((7 integer)): 1108 <= 0
run: match-at/find-substring/main 11: (((8 boolean)) <- ((greater-or-equal)) ((7 integer)) ((4 integer)))
mem: ((7 integer)) => 0
mem: ((4 integer)) => 2
run: match-at/find-substring/main 11: nil => ((8 boolean))
mem: ((8 boolean)): 1109 <= nil
run: match-at/find-substring/main 12: (((jump-if)) ((8 boolean)) ((8 offset)))
mem: ((8 boolean)) => nil
run: match-at/find-substring/main 13: (((9 character)) <- ((index)) ((1 string-address) (deref)) ((3 integer)))
mem: ((3 integer)) => 1
array-len: ((1000 string) (raw))
mem: ((1000 integer) (raw)) => 3
mem: ((1002 byte) (raw)) => b
run: match-at/find-substring/main 13: #\b => ((9 character))
mem: ((9 character)): 1110 <= #\b
run: match-at/find-substring/main 14: (((10 character)) <- ((index)) ((2 string-address) (deref)) ((7 integer)))
mem: ((7 integer)) => 0
array-len: ((1004 string) (raw))
mem: ((1004 integer) (raw)) => 2
mem: ((1005 byte) (raw)) => b
run: match-at/find-substring/main 14: #\b => ((10 character))
mem: ((10 character)): 1111 <= #\b
run: match-at/find-substring/main 15: (((11 boolean)) <- ((equal)) ((9 character)) ((10 character)))
mem: ((9 character)) => b
mem: ((10 character)) => b
run: match-at/find-substring/main 15: t => ((11 boolean))
mem: ((11 boolean)): 1112 <= t
run: match-at/find-substring/main 16: (((jump-if)) ((11 boolean)) ((1 offset)))
mem: ((11 boolean)) => t
run: match-at/find-substring/main 18: (((3 integer)) <- ((add)) ((3 integer)) ((1 literal)))
mem: ((3 integer)) => 1
run: match-at/find-substring/main 18: 2 => ((3 integer))
mem: ((3 integer)): 1104 <= 2
run: match-at/find-substring/main 19: (((7 integer)) <- ((add)) ((7 integer)) ((1 literal)))
mem: ((7 integer)) => 0
run: match-at/find-substring/main 19: 1 => ((7 integer))
mem: ((7 integer)): 1108 <= 1
run: match-at/find-substring/main 20: (((jump)) ((-10 offset)))
run: match-at/find-substring/main 11: (((8 boolean)) <- ((greater-or-equal)) ((7 integer)) ((4 integer)))
mem: ((7 integer)) => 1
mem: ((4 integer)) => 2
run: match-at/find-substring/main 11: nil => ((8 boolean))
mem: ((8 boolean)): 1109 <= nil
run: match-at/find-substring/main 12: (((jump-if)) ((8 boolean)) ((8 offset)))
mem: ((8 boolean)) => nil
run: match-at/find-substring/main 13: (((9 character)) <- ((index)) ((1 string-address) (deref)) ((3 integer)))
mem: ((3 integer)) => 2
array-len: ((1000 string) (raw))
mem: ((1000 integer) (raw)) => 3
mem: ((1003 byte) (raw)) => c
run: match-at/find-substring/main 13: #\c => ((9 character))
mem: ((9 character)): 1110 <= #\c
run: match-at/find-substring/main 14: (((10 character)) <- ((index)) ((2 string-address) (deref)) ((7 integer)))
mem: ((7 integer)) => 1
array-len: ((1004 string) (raw))
mem: ((1004 integer) (raw)) => 2
mem: ((1006 byte) (raw)) => d
run: match-at/find-substring/main 14: #\d => ((10 character))
mem: ((10 character)): 1111 <= #\d
run: match-at/find-substring/main 15: (((11 boolean)) <- ((equal)) ((9 character)) ((10 character)))
mem: ((9 character)) => c
mem: ((10 character)) => d
run: match-at/find-substring/main 15: nil => ((11 boolean))
mem: ((11 boolean)): 1112 <= nil
run: match-at/find-substring/main 16: (((jump-if)) ((11 boolean)) ((1 offset)))
mem: ((11 boolean)) => nil
run: match-at/find-substring/main 17: (((reply)) ((nil literal)))
run: find-substring/main 8: nil => ((7 boolean))
mem: ((7 boolean)): 1015 <= nil
run: find-substring/main 9: (((jump-if)) ((7 boolean)) ((3 offset)))
mem: ((7 boolean)) => nil
run: find-substring/main 10: (((3 integer)) <- ((add)) ((3 integer)) ((1 literal)))
mem: ((3 integer)) => 1
run: find-substring/main 10: 2 => ((3 integer))
mem: ((3 integer)): 1011 <= 2
run: find-substring/main 11: (((3 integer)) <- ((find-next)) ((1 string-address)) ((4 character)) ((3 integer)))
mem: ((1 string-address)) => 1000
mem: ((4 character)) => b
mem: ((3 integer)) => 2
run: find-next/find-substring/main 0: (((default-space space-address)) <- ((new)) ((space literal)) ((30 literal)))
run: find-next/find-substring/main 0: 1131 => ((default-space space-address))
run: find-next/find-substring/main 1: (((1 string-address)) <- ((next-input)))
arg: nil 0 (1000 #\b 2)
run: find-next/find-substring/main 1: 1000 => ((1 string-address))
mem: ((1 string-address)): 1133 <= 1000
run: find-next/find-substring/main 2: (((2 character)) <- ((next-input)))
arg: nil 1 (1000 #\b 2)
run: find-next/find-substring/main 2: #\b => ((2 character))
mem: ((2 character)): 1134 <= #\b
run: find-next/find-substring/main 3: (((3 integer)) <- ((next-input)))
arg: nil 2 (1000 #\b 2)
run: find-next/find-substring/main 3: 2 => ((3 integer))
mem: ((3 integer)): 1135 <= 2
run: find-next/find-substring/main 4: (((4 integer)) <- ((length)) ((1 string-address) (deref)))
array-len: ((1 string-address) (deref))
mem: ((1000 integer) (raw)) => 3
run: find-next/find-substring/main 4: 3 => ((4 integer))
mem: ((4 integer)): 1136 <= 3
run: find-next/find-substring/main 5: (((5 boolean)) <- ((greater-or-equal)) ((3 integer)) ((4 integer)))
mem: ((3 integer)) => 2
mem: ((4 integer)) => 3
run: find-next/find-substring/main 5: nil => ((5 boolean))
mem: ((5 boolean)): 1137 <= nil
run: find-next/find-substring/main 6: (((jump-if)) ((5 boolean)) ((5 offset)))
mem: ((5 boolean)) => nil
run: find-next/find-substring/main 7: (((6 byte)) <- ((index)) ((1 string-address) (deref)) ((3 integer)))
mem: ((3 integer)) => 2
array-len: ((1000 string) (raw))
mem: ((1000 integer) (raw)) => 3
mem: ((1003 byte) (raw)) => c
run: find-next/find-substring/main 7: #\c => ((6 byte))
mem: ((6 byte)): 1138 <= #\c
run: find-next/find-substring/main 8: (((7 boolean)) <- ((equal)) ((6 byte)) ((2 character)))
mem: ((6 byte)) => c
mem: ((2 character)) => b
run: find-next/find-substring/main 8: nil => ((7 boolean))
mem: ((7 boolean)): 1139 <= nil
run: find-next/find-substring/main 9: (((jump-if)) ((7 boolean)) ((2 offset)))
mem: ((7 boolean)) => nil
run: find-next/find-substring/main 10: (((3 integer)) <- ((add)) ((3 integer)) ((1 literal)))
mem: ((3 integer)) => 2
run: find-next/find-substring/main 10: 3 => ((3 integer))
mem: ((3 integer)): 1135 <= 3
run: find-next/find-substring/main 11: (((jump)) ((-7 offset)))
run: find-next/find-substring/main 5: (((5 boolean)) <- ((greater-or-equal)) ((3 integer)) ((4 integer)))
mem: ((3 integer)) => 3
mem: ((4 integer)) => 3
run: find-next/find-substring/main 5: t => ((5 boolean))
mem: ((5 boolean)): 1137 <= t
run: find-next/find-substring/main 6: (((jump-if)) ((5 boolean)) ((5 offset)))
mem: ((5 boolean)) => t
run: find-next/find-substring/main 12: (((reply)) ((3 integer)))
mem: ((3 integer)) => 3
run: find-substring/main 11: 3 => ((3 integer))
mem: ((3 integer)): 1011 <= 3
run: find-substring/main 12: (((jump)) ((-7 offset)))
run: find-substring/main 6: (((6 boolean)) <- ((greater-or-equal)) ((3 integer)) ((5 integer)))
mem: ((3 integer)) => 3
mem: ((5 integer)) => 3
run: find-substring/main 6: t => ((6 boolean))
mem: ((6 boolean)): 1014 <= t
run: find-substring/main 7: (((jump-if)) ((6 boolean)) ((5 offset)))
mem: ((6 boolean)) => t
run: find-substring/main 13: (((reply)) ((3 integer)))
mem: ((3 integer)) => 3
run: main 2: 3 => ((3 integer))
mem: ((3 integer)): 3 <= 3
schedule: done with routine nil