56 lines
2.1 KiB
Python
56 lines
2.1 KiB
Python
'''
|
|
Implements the interactive help() command.
|
|
'''
|
|
from kuroko import version
|
|
|
|
let __introText = ('''\
|
|
Kuroko {version}
|
|
|
|
Kuroko is a bytecode-compiled, duck-typed language with familiar indentation-
|
|
driven block syntax. This documentation is incomplete. For more information,
|
|
please consult the README or website (https://github.com/klange/kuroko).
|
|
|
|
To leave the REPL, type `exit()` or press Ctrl-D on a blank line.
|
|
|
|
The REPL will automatically indent blocks when a line ends with a `:`. To turn
|
|
this functionality off, type `paste()`. Tab completion of global variable names
|
|
and attribute field names is available.
|
|
'''.format(version=version))
|
|
|
|
def interactive():
|
|
'''Runs the detailed help tool. Currently that means just printing a longer help string.'''
|
|
print(__introText)
|
|
|
|
def simple(obj):
|
|
try:
|
|
print(obj.__doc__)
|
|
except:
|
|
try:
|
|
print(obj.__class__.__doc__)
|
|
except:
|
|
print('No docstring avaialble for', obj)
|
|
|
|
let __licenseText = '''
|
|
Copyright (c) 2020-2021 K. Lange <klange@toaruos.org>
|
|
Copyright (c) 2015 Robert Nystrom
|
|
|
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
of this software and associated documentation files (the "Software"), to
|
|
deal in the Software without restriction, including without limitation the
|
|
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
|
sell copies of the Software, and to permit persons to whom the Software is
|
|
furnished to do so, subject to the following conditions:
|
|
|
|
The above copyright notice and this permission notice shall be included in
|
|
all copies or substantial portions of the Software.
|
|
|
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
|
IN THE SOFTWARE.
|
|
'''
|
|
|