--- /dev/null
+# Contributing to Nit
+
+Thank you for your interest in contributing to Nit!
+We accept all forms of contribution, ranging from small example programs to improvements and additions to the libraries and posting of issues.
+
+
+## Contribution process
+
+All the contributions to the Nit language, its tools and libraries, are done through Github Pull-Requests.
+
+All the information on our contribution policy is available on our [website](http://nitlanguage.org/internal/).
+We encourage you to take a look at the sections available here for a walthrough of what is required to submit a new PR.
+
+## Other suggestions
+
+We are always open for suggestions or any other kind of contribution.
+
+If you do not want to submit code for some reason, you are always welcome to ask questions about the language or related topics via the issue system.
+
+You may also proof-read and correct documentation if you are willing!
+All the documents on this repository are written in English, however most of our contributors are not native anglophones.
+Therefore we encourage people, especially those coming of an english-speaking culture to read the documentation available and submit patches to correct bad formulations, typos or related mistakes on our part through the usual system.
$ . misc/nit_env.sh install
+Contributing:
+
+To contribute to Nit, please see [CONTRIBUTING](CONTRIBUTING.md).
+
+The best way to ask the team for advice, submit bugs or request features, is through the use of Github issues, using the appropriate tag (`forum`, `feature-request`, `bug`).
Information, contacts and help:
-NITC=../../bin/nitc
-NITLS=../../bin/nitls
+NITC=nitc
+NITLS=nitls
all: bin/action_nitro
-bin/action_nitro: $(shell ${NITLS} -M src/action_nitro.nit linux) ${NITC} pre-build
+bin/action_nitro: $(shell ${NITLS} -M src/action_nitro.nit linux) pre-build
${NITC} src/action_nitro.nit -m linux -o $@
src/gen/texts.nit: art/texts.svg
-NITC=../../bin/nitc
-NITLS=../../bin/nitls
+NITC=nitc
+NITLS=nitls
all: bin/asteronits
-bin/asteronits: $(shell ${NITLS} -M src/asteronits.nit linux) ${NITC} pre-build
+bin/asteronits: $(shell ${NITLS} -M src/asteronits.nit linux) pre-build
${NITC} src/asteronits.nit -m linux -o $@
bin/texture_atlas_parser: ../../lib/gamnit/texture_atlas_parser.nit
# Android
android: bin/asteronits.apk
-bin/asteronits.apk: $(shell ${NITLS} -M src/asteronits.nit android) ${NITC} android/res/ pre-build
+bin/asteronits.apk: $(shell ${NITLS} -M src/asteronits.nit android) android/res/ pre-build
${NITC} src/android.nit -m android -o $@
-android-release: $(shell ${NITLS} -M src/asteronits.nit android) ${NITC} android/res/ pre-build
+android-release: $(shell ${NITLS} -M src/asteronits.nit android) android/res/ pre-build
${NITC} src/android.nit -m android -o bin/asteronits.apk --release
android/res/: art/icon.svg
all: server bin/report bin/benitlux
server: bin/benitlux_daily bin/benitlux_web
-bin/benitlux_daily: $(shell ../../bin/nitls -M src/server/benitlux_daily.nit)
+bin/benitlux_daily: $(shell nitls -M src/server/benitlux_daily.nit)
mkdir -p bin/
- ../../bin/nitc -o $@ src/server/benitlux_daily.nit
+ nitc -o $@ src/server/benitlux_daily.nit
-bin/benitlux_web: $(shell ../../bin/nitls -M src/server/server.nit) src/server/benitlux_restful.nit
+bin/benitlux_web: $(shell nitls -M src/server/server.nit) src/server/benitlux_restful.nit
mkdir -p bin/
- ../../bin/nitc -o $@ src/server/server.nit -D iface=$(SERVER)
+ nitc -o $@ src/server/server.nit -D iface=$(SERVER)
pre-build: src/server/benitlux_restful.nit
-src/server/benitlux_restful.nit: $(shell ../../bin/nitls -M src/server/benitlux_controller.nit)
- ../../bin/nitrestful -o $@ src/server/benitlux_controller.nit
+src/server/benitlux_restful.nit: $(shell nitls -M src/server/benitlux_controller.nit)
+ nitrestful -o $@ src/server/benitlux_controller.nit
# ---
# Report
-bin/report: $(shell ../../bin/nitls -M src/report.nit)
- ../../bin/nitc -o bin/report src/report.nit
+bin/report: $(shell nitls -M src/report.nit)
+ nitc -o bin/report src/report.nit
report: bin/report
bin/report
# ---
# GTK+ client
-bin/benitlux: $(shell ../../bin/nitls -M src/client/client.nit)
+bin/benitlux: $(shell nitls -M src/client/client.nit)
mkdir -p bin/
- ../../bin/nitc -o bin/benitlux src/client/client.nit -m linux -D benitlux_rest_server_uri=http://$(SERVER)/
+ nitc -o bin/benitlux src/client/client.nit -m linux -D benitlux_rest_server_uri=http://$(SERVER)/
# ---
# Android
# Dev / debug app
android: bin/benitlux.apk
-bin/benitlux.apk: $(shell ../../bin/nitls -M src/client/android.nit) android-res
+bin/benitlux.apk: $(shell nitls -M src/client/android.nit) android-res
mkdir -p bin/ res/
- ../../bin/nitc -o $@ src/client/android.nit -m src/client/features/debug.nit \
+ nitc -o $@ src/client/android.nit -m src/client/features/debug.nit \
-D benitlux_rest_server_uri=http://$(SERVER)/
# Pure portable prototype, for comparison
-bin/proto.apk: $(shell ../../bin/nitls -M src/client/android_proto.nit) android-res
+bin/proto.apk: $(shell nitls -M src/client/android_proto.nit) android-res
mkdir -p bin/ res/
- ../../bin/nitc -o $@ src/client/android_proto.nit \
+ nitc -o $@ src/client/android_proto.nit \
-D benitlux_rest_server_uri=http://$(SERVER)/
# Release version
-android-release: $(shell ../../bin/nitls -M src/client/android.nit) android-res
+android-release: $(shell nitls -M src/client/android.nit) android-res
mkdir -p bin/ res/
- ../../bin/nitc -o bin/benitlux.apk src/client/android.nit \
+ nitc -o bin/benitlux.apk src/client/android.nit \
-D benitlux_rest_server_uri=http://xymus.net/benitlux/ --release
# ---
# iOS
ios: bin/benitlux.app
-bin/benitlux.app: $(shell ../../bin/nitls -M src/client/ios.nit) ios/AppIcon.appiconset/Contents.json
+bin/benitlux.app: $(shell nitls -M src/client/ios.nit) ios/AppIcon.appiconset/Contents.json
mkdir -p bin/
rm -rf bin/benitlux.app/
- ../../bin/nitc -o bin/benitlux.app src/client/ios.nit -D benitlux_rest_server_uri=http://$(SERVER)/
+ nitc -o bin/benitlux.app src/client/ios.nit -D benitlux_rest_server_uri=http://$(SERVER)/
-bin/proto.app: $(shell ../../bin/nitls -M src/client/ios_proto.nit) ios/AppIcon.appiconset/Contents.json
+bin/proto.app: $(shell nitls -M src/client/ios_proto.nit) ios/AppIcon.appiconset/Contents.json
mkdir -p bin/ res/
- ../../bin/nitc -o $@ src/client/ios_proto.nit \
+ nitc -o $@ src/client/ios_proto.nit \
-D benitlux_rest_server_uri=http://$(SERVER)/
-ios-release: $(shell ../../bin/nitls -M src/client/ios.nit) ios/AppIcon.appiconset/Contents.json
+ios-release: $(shell nitls -M src/client/ios.nit) ios/AppIcon.appiconset/Contents.json
mkdir -p bin/
- ../../bin/nitc -o bin/benitlux.app src/client/ios.nit -D benitlux_rest_server_uri=http://$(SERVER)/
+ nitc -o bin/benitlux.app src/client/ios.nit -D benitlux_rest_server_uri=http://$(SERVER)/
ios/AppIcon.appiconset/Contents.json: art/icon.svg
mkdir -p ios
class BenitluxHttpRequest
super AsyncHttpRequest
- redef fun rest_server_uri do return benitlux_rest_server_uri
+ redef fun uri_root do return benitlux_rest_server_uri
- redef var rest_action
+ redef var uri_tail
redef fun on_fail(error)
do
# This could be a deserialization error,
# it may be related to an outdated client.
# Report to user.
- print_error "Request Error: {rest_server_uri / rest_action} with {error}"
+ print_error "Request Error: {uri} with {error}"
app.feedback "Request Error: {error}"
end
end
class WindowHttpRequest
super BenitluxHttpRequest
- autoinit window, rest_action
+ autoinit window, uri_tail
# Type of the related `window`
type W: Window
class MenuHttpRequest
super BenitluxHttpRequest
- redef fun on_load(data)
+ redef fun on_load(data, status)
do
if not data isa Array[BeerAndRatings] then
on_fail new Error("Server sent unexpected data {data or else "null"}")
t.start
end
- redef fun on_load(data)
+ redef fun on_load(data, status)
do
if app.user == null then return
class ReviewAction
super WindowHttpRequest
- redef fun on_load(res)
+ redef fun on_load(res, status)
do
if intercept_error(res) then return
end
redef type W: BeersWindow
- redef fun on_load(beers)
+ redef fun on_load(beers, status)
do
window.layout.remove window.list_beers
window.list_beers = new ListLayout(parent=window.layout)
redef type W: HomeWindow
- redef fun on_load(beers)
+ redef fun on_load(beers, status)
do
window.layout_beers.remove window.beer_list
window.beer_list = new VerticalLayout(parent=window.layout_beers)
redef type W: HomeWindow
- redef fun on_load(users)
+ redef fun on_load(users, status)
do
window.layout_social.remove window.social_list
window.social_list = new VerticalLayout(parent=window.layout_social)
redef type W: HomeWindow
- redef fun on_load(res) do intercept_error(res)
+ redef fun on_load(res, status) do intercept_error(res)
end
# Today's date as a `String`
init do affected_views.add_all([window.but_search, window.but_followed, window.but_followers])
- redef fun on_load(users)
+ redef fun on_load(users, status)
do
window.layout.remove window.list_search
window.list_search = new ListLayout(parent=window.layout)
private var button: FollowButton
init do affected_views.add(button)
- redef fun on_load(res)
+ redef fun on_load(res, status)
do
if intercept_error(res) then return
end
init do affected_views.add_all([window.but_login, window.but_signup])
- redef fun on_load(res)
+ redef fun on_load(res, status)
do
if intercept_error(res) then return
pre-build: assets/images/drawing.png
-bin/moles: $(shell ../../bin/nitls -M src/moles_linux.nit) assets/images/drawing.png
+bin/moles: $(shell nitls -M src/moles_linux.nit) assets/images/drawing.png
mkdir -p bin
- ../../bin/nitc -o bin/moles src/moles_linux.nit
+ nitc -o bin/moles src/moles_linux.nit
android: bin/moles.apk
-bin/moles.apk: android/res/ $(shell ../../bin/nitls -M src/moles_android.nit) assets/images/drawing.png
+bin/moles.apk: android/res/ $(shell nitls -M src/moles_android.nit) assets/images/drawing.png
mkdir -p bin
- ../../bin/nitc -o bin/moles.apk src/moles_android.nit
+ nitc -o bin/moles.apk src/moles_android.nit
-android-release: android/res/ $(shell ../../bin/nitls -M src/moles_android.nit) assets/images/drawing.png
+android-release: android/res/ $(shell nitls -M src/moles_android.nit) assets/images/drawing.png
mkdir -p bin
- ../../bin/nitc -o bin/moles.apk src/moles_android.nit --release
+ nitc -o bin/moles.apk src/moles_android.nit --release
$(SVG2ICONS):
$(MAKE) -C ../inkscape_tools
linux:
mkdir -p bin
- ../../bin/nitc -o bin/friendz src/friendz_linux.nit
+ nitc -o bin/friendz src/friendz_linux.nit
android: android/res/drawable-hdpi/icon.png
mkdir -p bin
- ../../bin/nitc -o bin/friendz.apk src/friendz_android.nit
+ nitc -o bin/friendz.apk src/friendz_android.nit
android-release: android/res/drawable-hdpi/icon.png
mkdir -p bin
- ../../bin/nitc -o bin/friendz.apk src/friendz_android.nit --release
+ nitc -o bin/friendz.apk src/friendz_android.nit --release
android/res/drawable-hdpi/icon.png: art/icon.svg
mkdir -p android/res
doc:
mkdir -p doc
- ../../bin/nitdoc -d doc/ src/friendz.nit src/friendz_linux.nit
+ nitdoc -d doc/ src/friendz.nit src/friendz_linux.nit
clean:
rm -rf bin/ doc/ android/
default:
mkdir -p bin
- ../../bin/nitc -o bin/github_search_for_jni src/github_search_for_jni.nit
+ nitc -o bin/github_search_for_jni src/github_search_for_jni.nit
bin/header_keeper:
mkdir -p bin
- ../../bin/nitc --dir bin src/header_keeper.nit
+ nitc --dir bin src/header_keeper.nit
check: tests
tests: bin/header_keeper
all:
mkdir -p bin
- ../../bin/nitc --dir bin src/svg_to_png_and_nit.nit src/svg_to_icons.nit
+ nitc --dir bin src/svg_to_png_and_nit.nit src/svg_to_icons.nit
check: test-tinks test-app
mv javap_*.nit src/
mv javap* gen/
-src/serial.nit: $(shell ../../bin/nitls -M src/jwrapper.nit)
- ../../bin/nitserial -o src/serial.nit src/jwrapper.nit
+src/serial.nit: $(shell nitls -M src/jwrapper.nit)
+ nitserial -o src/serial.nit src/jwrapper.nit
-bin/jwrapper: src/javap_test_parser.nit src/serial.nit $(shell ../../bin/nitls -M src/jwrapper.nit) ../../bin/nitc
+bin/jwrapper: src/javap_test_parser.nit src/serial.nit $(shell nitls -M src/jwrapper.nit)
mkdir -p bin
- ../../bin/nitc src/jwrapper.nit -o bin/jwrapper -m src/serial.nit
+ nitc src/jwrapper.nit -o bin/jwrapper -m src/serial.nit
clean:
rm -f bin/javap_test_parser bin/jwrapper
check: bin/jwrapper tests/wildcards.javap
mkdir -p tmp
bin/jwrapper -v -u stub -o tests/statics.nit tests/statics.javap
- ../../bin/nitpick -q tests/statics.nit
+ nitpick -q tests/statics.nit
bin/jwrapper -v -u comment -o tests/generics.nit tests/generics.javap
- ../../bin/nitpick -q tests/generics.nit
+ nitpick -q tests/generics.nit
bin/jwrapper -v -u comment -o tests/long.nit tests/long.javap
- ../../bin/nitpick -q tests/long.nit
+ nitpick -q tests/long.nit
bin/jwrapper -v -u comment -o tests/inits.nit tests/inits.javap
- ../../bin/nitpick -q tests/inits.nit
+ nitpick -q tests/inits.nit
bin/jwrapper -v -u comment -o tests/testjvm.nit tests/testjvm.javap
- ../../bin/nitpick -q tests/testjvm.nit
+ nitpick -q tests/testjvm.nit
bin/jwrapper -v -u comment -o tests/many.nit tests/many.javap
- ../../bin/nitpick -q tests/many.nit
+ nitpick -q tests/many.nit
bin/jwrapper -v -u comment -o tests/wildcards.nit tests/wildcards.javap
- ../../bin/nitpick -q tests/wildcards.nit
+ nitpick -q tests/wildcards.nit
make -C examples/queue/ check
make -C examples/java_api/ check
bin/memory: assets/images/drawing.png src/*.nit
mkdir -p bin
- ../../bin/nitc -o bin/memory src/memory.nit -m ../../lib/mnit/linux/linux.nit
+ nitc -o bin/memory src/memory.nit -m ../../lib/mnit/linux/linux.nit
assets/images/drawing.png: art/drawing.svg
mkdir -p assets/images/
android: bin/memory.apk
bin/memory.apk: assets/images/drawing.png src/*.nit android/res/
mkdir -p bin
- ../../bin/nitc -o bin/memory.apk src/memory.nit -m ../../lib/mnit/android/android.nit -m ../../lib/android/landscape.nit
+ nitc -o bin/memory.apk src/memory.nit -m ../../lib/mnit/android/android.nit -m ../../lib/android/landscape.nit
android-release: assets/images/drawing.png src/*.nit android/res/
mkdir -p bin
- ../../bin/nitc -o bin/memory.apk src/memory.nit -m ../../lib/mnit/android/android.nit -m ../../lib/android/landscape.nit --release
+ nitc -o bin/memory.apk src/memory.nit -m ../../lib/mnit/android/android.nit -m ../../lib/android/landscape.nit --release
linux:
mkdir -p bin
- ../../bin/nitc -o bin/simple src/simple_linux.nit
+ nitc -o bin/simple src/simple_linux.nit
android:
mkdir -p bin
- ../../bin/nitc -o bin/complete.apk src/complete_simple_android.nit --semi-global
- ../../bin/nitc -o bin/minimal.apk src/simple_android.nit --semi-global
+ nitc -o bin/complete.apk src/complete_simple_android.nit --semi-global
+ nitc -o bin/minimal.apk src/simple_android.nit --semi-global
android-release:
mkdir -p bin
- ../../bin/nitc -o bin/complete.apk src/complete_simple_android.nit --semi-global --release
- ../../bin/nitc -o bin/minimal.apk src/simple_android.nit --semi-global --release
+ nitc -o bin/complete.apk src/complete_simple_android.nit --semi-global --release
+ nitc -o bin/minimal.apk src/simple_android.nit --semi-global --release
clean:
rm -rf bin
-NITC=../../bin/nitc
-NITLS=../../bin/nitls
+NITC=nitc
+NITLS=nitls
all: bin/model_viewer
-bin/model_viewer: $(shell ${NITLS} -M src/model_viewer.nit linux) ${NITC}
+bin/model_viewer: $(shell ${NITLS} -M src/model_viewer.nit linux)
${NITC} src/model_viewer.nit -m linux -o $@
check: bin/model_viewer
# Android
android: bin/model_viewer.apk
-bin/model_viewer.apk: $(shell ${NITLS} -M src/model_viewer.nit android) ${NITC} android/res/
+bin/model_viewer.apk: $(shell ${NITLS} -M src/model_viewer.nit android) android/res/
${NITC} src/model_viewer.nit -m android -o $@
-android-release: $(shell ${NITLS} -M src/model_viewer.nit android) ${NITC} android/res/
+android-release: $(shell ${NITLS} -M src/model_viewer.nit android) android/res/
${NITC} src/model_viewer.nit -m android -o bin/model_viewer.apk --release
android/res/: art/icon.png
convert -resize 144x144 art/icon.png android/res/drawable-xxhdpi/icon.png
convert -resize 192x192 art/icon.png android/res/drawable-xxxhdpi/icon.png
-bin/model_viewer_vr.apk: $(shell ${NITLS} -M src/model_viewer.nit android) ${NITC} android/res/ android/libs/cardboard.jar
+bin/model_viewer_vr.apk: $(shell ${NITLS} -M src/model_viewer.nit android) android/res/ android/libs/cardboard.jar
${NITC} src/model_viewer.nit -m android -m ../../lib/gamnit/depth/vr.nit -o $@
android/libs/cardboard.jar:
# See the License for the specific language governing permissions and
# limitations under the License.
-NITC=../../bin/nitc
+NITC=nitc
NITC_FLAGS=--dir bin
NEO4J_DIR=/var/lib/neo4j
OLD_PWD=${PWD}
all:
mkdir -p bin/
- ../../bin/nitc src/nitester.nit -o bin/nitester
+ nitc src/nitester.nit -o bin/nitester
nitiwiki:
mkdir -p bin
- ../../bin/nitc src/nitiwiki.nit -o bin/nitiwiki
+ nitc src/nitiwiki.nit -o bin/nitiwiki
-bin/nitiwiki_server: $(shell ../../bin/nitls -M src/wiki_edit.nit)
- ../../bin/nitc -o $@ src/wiki_edit.nit
+bin/nitiwiki_server: $(shell nitls -M src/wiki_edit.nit)
+ nitc -o $@ src/wiki_edit.nit
check: nitiwiki
cd tests; make
doc:
- ../../bin/nitdoc -d doc src/nitiwiki.nit
+ nitdoc -d doc src/nitiwiki.nit
clean:
rm -rf bin
# See the License for the specific language governing permissions and
# limitations under the License.
-NITC=../../bin/nitc
-NITU=../../bin/nitunit
+NITC=nitc
+NITU=nitunit
all: listener web
mv *.nit src/
mv objc* gen/
-bin/objcwrapper: $(shell ../../bin/nitls -M src/objcwrapper.nit) src/objc_parser.nit
- ../../bin/nitc -o bin/objcwrapper src/objcwrapper.nit --semi-global
+bin/objcwrapper: $(shell nitls -M src/objcwrapper.nit) src/objc_parser.nit
+ nitc -o bin/objcwrapper src/objcwrapper.nit --semi-global
-bin/objc_test_parser: $(shell ../../bin/nitls -M src/objc_test_parser.nit)
- ../../bin/nitc -o bin/objc_test_parser src/objc_test_parser.nit --semi-global
+bin/objc_test_parser: $(shell nitls -M src/objc_test_parser.nit)
+ nitc -o bin/objc_test_parser src/objc_test_parser.nit --semi-global
check: bin/objc_test_parser bin/objcwrapper
# Test the parser
# Test objcwrapper
bin/objcwrapper tests/MyClass.h -o tests/MyClass.nit
- ../../bin/nitpick tests/MyClass.nit
+ nitpick tests/MyClass.nit
# Test on classes of libgnustep-base-dev
check-gnustep: bin/objcwrapper
bin/objcwrapper /usr/include/GNUstep/Foundation/*.h -o tests/gnustep.nit -p "-I /usr/include/GNUstep/ -Wno-deprecated -Wno-cpp"
- ../../bin/nitpick tests/nsarray.nit
+ nitpick tests/nsarray.nit
# Test on classes of the Apple Foundation framework
check-apple: bin/objcwrapper
bin/objcwrapper /System/Library/Frameworks/Foundation.framework/Versions/C/Headers/NSArray.h -o tests/nsarray.nit
- ../../bin/nitpick tests/nsarray.nit
+ nitpick tests/nsarray.nit
bin/objcwrapper /System/Library/Frameworks/AppKit.framework/Headers/NSAlert.h -o tests/nsalert.nit
- ../../bin/nitpick tests/nsalert.nit
+ nitpick tests/nsalert.nit
-bin/header_static: $(shell ../../bin/nitls -M src/header_static.nit)
- ../../bin/nitc --dir bin src/header_static.nit
+bin/header_static: $(shell nitls -M src/header_static.nit)
+ nitc --dir bin src/header_static.nit
ACE_BUILDS ?= ../../../ace-builds/
default:
- ../../bin/nitc --semi-global sources/nit/pnacl_nit.nit
+ nitc --semi-global sources/nit/pnacl_nit.nit
cp pnacl_nit/pnacl_nit.pexe www/pnacl/ -f
rm -rf pnacl_nit/
end
redef class ToolContext
- # We don't need 'the compute_nit_dir'.
- redef fun compute_nit_dir
+ # We don't need 'the locate_nit_dir'.
+ redef fun locate_nit_dir
do
return "/pnacl"
end
all: fr
mkdir -p bin/
- ../../bin/nitc --dir bin/ src/opportunity_web.nit
+ nitc --dir bin/ src/opportunity_web.nit
fr:
make -C src/templates/languages/fr/LC_MESSAGES/
super OpportunityAction
redef fun answer(request, url) do
- print "Received request for {url}"
var get = request.get_args
var rq = url.split("/")
if rq.has("meetup_create") then
rsp.body = meetpage.write_to_string
return rsp
end
- if not meet.commit(db) then
+
+ var success = meet.commit(db)
+ if not success then
db.close
- var rsp = new HttpResponse(200)
+ var rsp = new HttpResponse(500)
var meetpage = new MeetupCreationPage
meetpage.meet = meet
meetpage.ans = ansset
- meetpage.error = """<p>Could not create Meetup.</p>
- <p>Hmm, that's embarassing, the database indicates that your meetup already exists.</p>
- <p>If this is not a duplicated submission, please contact the mainainers of the website, you might have found a bug !</p>"""
+ meetpage.error = """
+<p>Failed to create event</p>
+<p>This is a server side error, it has been logged.
+ You may still want to contact the maintainers of this website.</p>"""
rsp.body = meetpage.write_to_string
return rsp
end
+
for v in ansset do
var ans = new Answer(v)
ans.meetup = meet
super OpportunityAction
redef fun answer(request, uri) do
- print "Received REST request from {uri}"
var req = uri.split("/")
if req.has("people") then
return (new OpportunityPeopleREST).answer(request, uri)
# Creates the tables and triggers for Opportunity (SQLite3 DB)
fun create_db do
assert create_table("IF NOT EXISTS meetups (id CHAR(40) PRIMARY KEY, name TEXT, date TEXT, place TEXT, answer_mode INTEGER DEFAULT 0);") else
- print error or else "?"
+ print_error error or else "?"
end
assert create_table("IF NOT EXISTS people(id INTEGER PRIMARY KEY AUTOINCREMENT, name TEXT, surname TEXT);") else
- print error or else "?"
+ print_error error or else "?"
end
assert create_table("IF NOT EXISTS answers(id INTEGER PRIMARY KEY AUTOINCREMENT, meetup_id CHAR(40), name TEXT, FOREIGN KEY(meetup_id) REFERENCES meetups(id));") else
- print error or else "?"
+ print_error error or else "?"
end
assert create_table("IF NOT EXISTS part_answers(id_part INTEGER, id_ans INTEGER, value INTEGER, FOREIGN KEY(id_part) REFERENCES people(id), FOREIGN KEY(id_ans) REFERENCES answers(id));") else
- print error or else "?"
+ print_error error or else "?"
end
#NOTE: The following triggers could be replaced by ON DELETE CASCADE clauses
# Thing is, SQLite does not seem to support those operations (well, not by default, it seems
# we must re-compile the lib to support it. So, well, let's just create triggers heh.
assert execute("CREATE TRIGGER IF NOT EXISTS answers_clean AFTER DELETE ON meetups BEGIN DELETE FROM answers WHERE answers.meetup_id=OLD.id;END;") else
- print error or else "?"
+ print_error error or else "?"
end
assert execute("CREATE TRIGGER IF NOT EXISTS ans_clean AFTER DELETE ON answers BEGIN DELETE FROM part_answers WHERE OLD.id=part_answers.id_ans;END;") else
- print error or else "?"
+ print_error error or else "?"
end
assert execute("CREATE TRIGGER IF NOT EXISTS ppl_clean AFTER DELETE ON people BEGIN DELETE FROM part_answers WHERE OLD.id=part_answers.id_part;END;")
end
fun change_answer(pid: Int, ansid: Int, resp: Int): Bool do
var p = find_people_by_id(pid)
if p == null then
- print "Error while updating answer {ansid}:{pid}"
+ print_error "Opportunity error while updating answer {ansid}:{pid}"
return false
end
var a = find_answer_by_id(ansid)
if a == null then
- print "Error while updating answer {ansid}:{pid}"
+ print_error "Opportunity error while updating answer {ansid}:{pid}"
return false
end
p.answers[a] = resp
fun remove_people_by_id(id: Int): Bool do
var rq = execute("DELETE FROM people WHERE id = {id};")
if not rq then
- print "Cannot delete people {id}"
- print error or else "Unknown error"
+ print_error "Opportunity error deleting people {id}"
+ print_error error or else "Unknown error"
return false
end
return true
redef fun commit(db) do
if id == -1 then
if not db.execute("INSERT INTO people (name,surname) VALUES ({name.html_escape.to_sql_string}, {surname.html_escape.to_sql_string});") then
- print "Error while adding people {self}"
- print db.error or else "Unknown error"
+ print_error "Opportunity error while adding people {self}"
+ print_error db.error or else "Unknown error"
return false
end
id = db.last_insert_rowid
else
if not db.execute("UPDATE people SET name={name.html_escape.to_sql_string}, surname={surname.html_escape.to_sql_string} WHERE ID={id};") then
- print "Error while updating people {self}"
- print db.error or else "Unknown error"
+ print_error "Opportunity error while updating people {self}"
+ print_error db.error or else "Unknown error"
return false
end
end
var s = db.select("* FROM part_answers WHERE id_part={id} AND id_ans={i.id}")
if s != null and s.iterator.is_ok then
if not db.execute("UPDATE part_answers SET value={j} WHERE id_part={id} AND id_ans={i.id};") then
- print "Error while updating part_answers {id}|{i.id} = {j}"
- print db.error or else "Unknown error"
+ print_error "Opportunity error while updating part_answers {id}|{i.id} = {j}"
+ print_error db.error or else "Unknown error"
return false
end
continue
end
if not db.execute("INSERT INTO part_answers(id_part, id_ans, value) VALUES ({id},{i.id},{val});") then
- print("Error while adding part_answers {id}|{i.id}|{j}")
- print db.error or else "Unknown error"
+ print_error "Opportunity error while adding part_answers {id}|{i.id}|{j}"
+ print_error db.error or else "Unknown error"
return false
end
end
var time = get_time
var tmpid = (name + date + place + time.to_s).sha1.hexdigest
if not db.execute("INSERT INTO meetups (id, name, date, place, answer_mode) VALUES({tmpid.to_sql_string}, {name.html_escape.to_sql_string}, {date.html_escape.to_sql_string}, {place.html_escape.to_sql_string}, {answer_mode});") then
- print "Error recording entry Meetup {self}"
- print db.error or else "Null error"
+ print_error "Opportunity error recording entry Meetup {self}"
+ print_error db.error or else "Unknown error"
return false
end
id = tmpid
end
end
- redef fun to_s do
- return "Event : {name}\nWhen : {date}\nWhere : {place}"
- end
+ redef fun to_s do return "Event: {name}, date: {date}, place: {place}"
end
# An answer linked to a Meetup in the database
if m == null then return false
if m.id == "" then
if not m.commit(db) then
- print "Error when creating meetup {m}"
+ print_error "Opportunity error when creating meetup {m}"
return false
end
end
if id == -1 then
if not db.execute("INSERT INTO answers (name, meetup_id) VALUES({name.html_escape.to_sql_string}, {m.id.to_sql_string});") then
- print "Cannot create {self} in database"
- print db.error or else "Unknown error"
+ print_error "Opportunity error creating {self} in database"
+ print_error db.error or else "Unknown error"
return false
end
id = db.last_insert_rowid
else
if not db.execute("UPDATE answers SET name=({name.html_escape.to_sql_string}) WHERE meetup_id={m.id.to_sql_string};") then
- print "Error updating {self} in database"
- print db.error or else "Unknown error"
+ print_error "Opportunity error updating {self} in database"
+ print_error db.error or else "Unknown error"
return false
end
end
bin/pep8analysis:
mkdir -p bin
- ../../bin/nitc -o bin/pep8analysis src/pep8analysis.nit
+ nitc -o bin/pep8analysis src/pep8analysis.nit
doc/index.html:
- ../../bin/nitdoc src/pep8analysis.nit
+ nitdoc src/pep8analysis.nit
check: tests
tests: bin/pep8analysis
diff test.out test.sav
www/pep8analysis.js:
- ../../bin/nitc -o www/pep8analysis.js --semi-global src/pep8analysis_web.nit
+ nitc -o www/pep8analysis.js --semi-global src/pep8analysis_web.nit
mkdir -p www/samples
cp tests/micro/*.pep tests/privat/02-fibo.pep tests/privat/06-calc-non-pur.pep www/samples
refund:
mkdir -p bin
- ../../bin/nitc src/refund.nit -o bin/refund
+ nitc src/refund.nit -o bin/refund
check: refund
cd tests; make
all:
mkdir -p bin/
- ../../bin/nitc --dir bin/ src/*.nit
+ nitc --dir bin/ src/*.nit
-NITC=../../bin/nitc
+NITC=nitc
NITCC=../nitcc/src/nitcc
all: simplan
build:
mkdir -p bin/
- ../../bin/nitc --dir bin/ src/*.nit
+ nitc --dir bin/ src/*.nit
install:
install bin/sort_downloads /usr/local/bin/
pre-build: assets/images/drawing.png src/server/server_serialize.nit
# Client
-bin/tinks: assets/images/drawing.png src/client/client.nit $(shell ../../bin/nitls -M src/client/linux_client.nit)
- ../../bin/nitserial -o src/client/client_serialize.nit src/client/client.nit
- ../../bin/nitc -o bin/tinks src/client/linux_client.nit -m src/client/client_serialize.nit
+bin/tinks: assets/images/drawing.png src/client/client.nit $(shell nitls -M src/client/linux_client.nit)
+ nitserial -o src/client/client_serialize.nit src/client/client.nit
+ nitc -o bin/tinks src/client/linux_client.nit -m src/client/client_serialize.nit
-bin/tinks3d: $(shell ../../bin/nitls -M src/client/client3d.nit -m linux)
- ../../bin/nitserial -o src/client/client_serialize.nit src/client/client3d.nit
- ../../bin/nitc -o bin/tinks3d src/client/client3d.nit \
+bin/tinks3d: $(shell nitls -M src/client/client3d.nit -m linux)
+ nitserial -o src/client/client_serialize.nit src/client/client3d.nit
+ nitc -o bin/tinks3d src/client/client3d.nit \
-m src/client/client_serialize.nit -m linux
assets/images/drawing.png: art/drawing.svg
../inkscape_tools/bin/svg_to_png_and_nit art/drawing.svg -a assets/ -s src/client/ -x 2.0
# Server
-bin/server: src/server/server_serialize.nit $(shell ../../bin/nitls -M src/server/dedicated.nit)
- ../../bin/nitc -o bin/server src/server/dedicated.nit -m src/server/server_serialize.nit
+bin/server: src/server/server_serialize.nit $(shell nitls -M src/server/dedicated.nit)
+ nitc -o bin/server src/server/dedicated.nit -m src/server/server_serialize.nit
-src/server/server_serialize.nit: $(shell ../../bin/nitls -M src/server/dedicated.nit)
- ../../bin/nitserial -o src/server/server_serialize.nit src/server/dedicated.nit
+src/server/server_serialize.nit: $(shell nitls -M src/server/dedicated.nit)
+ nitserial -o src/server/server_serialize.nit src/server/dedicated.nit
# Android
android: bin/tinks.apk
-bin/tinks.apk: assets/images/drawing.png android/res/ $(shell ../../bin/nitls -M src/client/android_client.nit)
- ../../bin/nitserial -o src/client/client_serialize.nit src/client/client.nit
- ../../bin/nitc -o bin/tinks.apk src/client/android_client.nit -m src/client/client_serialize.nit
+bin/tinks.apk: assets/images/drawing.png android/res/ $(shell nitls -M src/client/android_client.nit)
+ nitserial -o src/client/client_serialize.nit src/client/client.nit
+ nitc -o bin/tinks.apk src/client/android_client.nit -m src/client/client_serialize.nit
-android-release: assets/images/drawing.png android/res/ $(shell ../../bin/nitls -M src/client/android_client.nit)
- ../../bin/nitserial -o src/client/client_serialize.nit src/client/client.nit
- ../../bin/nitc -o bin/tinks.apk src/client/android_client.nit -m src/client/client_serialize.nit --release
+android-release: assets/images/drawing.png android/res/ $(shell nitls -M src/client/android_client.nit)
+ nitserial -o src/client/client_serialize.nit src/client/client.nit
+ nitc -o bin/tinks.apk src/client/android_client.nit -m src/client/client_serialize.nit --release
android/res/: art/icon.svg
../inkscape_tools/bin/svg_to_icons art/icon.svg --android --out android/res/
all: bin/tnitter_server bin/tnitter
-bin/tnitter_server: $(shell ../../bin/nitls -M src/tnitter.nit)
+bin/tnitter_server: $(shell nitls -M src/tnitter.nit)
mkdir -p bin/
- ../../bin/nitc -o bin/tnitter_server src/tnitter.nit -D tnitter_interface=$(SERVER)
+ nitc -o bin/tnitter_server src/tnitter.nit -D tnitter_interface=$(SERVER)
-bin/tnitter: $(shell ../../bin/nitls -M src/tnitter_app.nit)
+bin/tnitter: $(shell nitls -M src/tnitter_app.nit)
mkdir -p bin/
- ../../bin/nitc -o bin/tnitter src/tnitter_app.nit -m linux -D tnitter_server_uri=http://$(SERVER)
+ nitc -o bin/tnitter src/tnitter_app.nit -m linux -D tnitter_server_uri=http://$(SERVER)
# ---
# Android
android: bin/tnitter.apk
-bin/tnitter.apk: $(shell ../../bin/nitls -M src/tnitter_app_android.nit) android/res/
+bin/tnitter.apk: $(shell nitls -M src/tnitter_app_android.nit) android/res/
mkdir -p bin/
- ../../bin/nitc -o bin/tnitter.apk src/tnitter_app_android.nit -D tnitter_server_uri=http://$(SERVER)
+ nitc -o bin/tnitter.apk src/tnitter_app_android.nit -D tnitter_server_uri=http://$(SERVER)
-android-release: $(shell ../../bin/nitls -M src/tnitter_app_android.nit) android/res/
+android-release: $(shell nitls -M src/tnitter_app_android.nit) android/res/
mkdir -p bin/
- ../../bin/nitc -o bin/tnitter.apk src/tnitter_app_android.nit --release -D tnitter_server_uri=http://tnitter.xymus.net
+ nitc -o bin/tnitter.apk src/tnitter_app_android.nit --release -D tnitter_server_uri=http://tnitter.xymus.net
android/res/: art/icon.svg
mkdir -p android
# iOS
ios: bin/tnitter.app
-bin/tnitter.app: $(shell ../../bin/nitls -M src/tnitter_app.nit ios) ios/AppIcon.appiconset/Contents.json
+bin/tnitter.app: $(shell nitls -M src/tnitter_app.nit ios) ios/AppIcon.appiconset/Contents.json
mkdir -p bin/
- ../../bin/nitc -o bin/tnitter.app src/tnitter_app.nit -m ios -D tnitter_server_uri=http://$(SERVER)
+ nitc -o bin/tnitter.app src/tnitter_app.nit -m ios -D tnitter_server_uri=http://$(SERVER)
-ios-release: $(shell ../../bin/nitls -M src/tnitter_app.nit ios) ios/AppIcon.appiconset/Contents.json
+ios-release: $(shell nitls -M src/tnitter_app.nit ios) ios/AppIcon.appiconset/Contents.json
mkdir -p bin/
- ../../bin/nitc -o bin/tnitter.app src/tnitter_app.nit -m ios -D tnitter_server_uri=http://tnitter.xymus.net
+ nitc -o bin/tnitter.app src/tnitter_app.nit -m ios -D tnitter_server_uri=http://tnitter.xymus.net
ios/AppIcon.appiconset/Contents.json: art/icon-ios.svg
mkdir -p ios
private var window: TnitterWindow
- redef fun rest_server_uri do return tnitter_server_uri
+ redef fun uri_root do return tnitter_server_uri
- redef var rest_action
+ redef var uri_tail
# Should this request be delayed by `request_delay_on_error` seconds?
fun after_error(value: Bool) is autoinit do if value then delay = request_delay_on_error
class ListPostRequest
super AsyncTnitterRequest
- redef fun on_load(posts)
+ redef fun on_load(posts, status)
do
# Deal with server-side errors
if posts isa Error then
- print_error "Server Error: '{posts.message}' from '{rest_server_uri / rest_action}'"
+ print_error "Server Error: '{posts.message}' from '{uri}'"
return
end
redef fun on_fail(error)
do
- print "Warning: Request {rest_server_uri/rest_action} failed with {error}"
+ print "Warning: Request {uri} failed with {error}"
window.request_full_list_on_error
end
end
all: xymus.net
-xymus.net: ../benitlux/src/server/benitlux_restful.nit $(shell ../../bin/nitls -M xymus_net.nit)
- ../../bin/nitc -o $@ xymus_net.nit
+xymus.net: ../benitlux/src/server/benitlux_restful.nit $(shell nitls -M xymus_net.nit)
+ nitc -o $@ xymus_net.nit
../benitlux/src/server/benitlux_restful.nit:
make -C ../benitlux src/server/benitlux_restful.nit
# Portable calculator UI
module calculator is
-app_name "app.nit Calc."
+ app_name "app.nit Calc."
app_version(0, 1, git_revision)
app_namespace "org.nitlanguage.calculator"
fun native_context: NativeContext do return native_activity
end
-extern class JavaClassLoader in "Java" `{java.lang.ClassLoader`}
- super JavaObject
-end
-
redef class Sys
+
# We cannot create a JVM on Android
#
# This method is not reachable on this platform anyway.
redef fun jni_env do return jvm.attach_current_thread
private var class_loader: nullable JavaObject = null
+
private var class_loader_method: nullable JMethodID = null
+
redef fun load_jclass(name)
do
var class_loader = self.class_loader
end
# Java list of `NativeScanResult`
-extern class NativeListOfScanResult in "Java" `{ java.util.List `}
+extern class NativeListOfScanResult in "Java" `{ java.util.List<android.net.wifi.ScanResult> `}
# Number of elements in this list
fun length: Int in "Java" `{ return self.size();`}
# Element at `index`
fun [](index: Int): NativeScanResult in "Java" `{
- return ((java.util.List<android.net.wifi.ScanResult>)self).get((int)index);
+ return self.get((int)index);
`}
end
The module `app::http_request` provides services to execute asynchronous HTTP request.
The class `AsyncHttpRequest` hides the complex parallel logic and
lets the user implement methods acting only on the UI thread.
-See the documentation of `AsyncHttpRequest` for more information.
+See the documentation of `AsyncHttpRequest` for more information and
+the full example at `examples/http_request_example.nit`.
# Metadata annotations
--- /dev/null
+http_request_example
+http_request_example.apk
+http_request_example.app
--- /dev/null
+all: http_request_example
+
+http_request_example: $(shell nitls -M http_request_example.nit linux)
+ nitc http_request_example.nit -m linux
+
+http_request_example.apk: $(shell nitls -M http_request_example.nit android)
+ nitc http_request_example.nit -m android
+
+http_request_example.app: $(shell nitls -M http_request_example.nit ios)
+ nitc http_request_example.nit -m ios
--- /dev/null
+# This file is part of NIT ( http://www.nitlanguage.org ).
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# Example for the `app::http_request` main service `AsyncHttpRequest`
+module http_request_example
+
+import app::ui
+import app::http_request
+
+# Simple asynchronous HTTP request to http://example.com/ displaying feedback to the window
+class MyHttpRequest
+ super AsyncHttpRequest
+
+ # Back reference to the window to show feedback to the user
+ var win: HttpRequestClientWindow
+
+ # ---
+ # Config the request
+
+ redef fun uri do return "http://example.com/"
+ redef fun deserialize_json do return false
+
+ # ---
+ # Customize callbacks
+
+ redef fun before
+ do
+ win.label_response.text = "Sending request..."
+
+ # Disable button to prevent double requests
+ win.button_request.enabled = false
+ end
+
+ redef fun on_load(data, status)
+ do win.label_response.text = "Received response code {status} with {data.as(Text).byte_length} bytes"
+
+ redef fun on_fail(error)
+ do win.label_response.text = "Connection error: {error}"
+
+ redef fun after do win.button_request.enabled = true
+end
+
+# Simpe window with a label and a button
+class HttpRequestClientWindow
+ super Window
+
+ # Root layout
+ var layout = new VerticalLayout(parent=self)
+
+ # Button to send request
+ var button_request = new Button(parent=layout, text="Press to send HTTP request")
+
+ # Label displaying feedback to user
+ var label_response = new Label(parent=layout, text="No response yet.")
+
+ init do button_request.observers.add self
+
+ redef fun on_event(event)
+ do
+ if event isa ButtonPressEvent and event.sender == button_request then
+ # Prepare and send request
+ var request = new MyHttpRequest(self)
+ request.start
+ end
+ end
+end
+
+redef class App
+ redef fun on_create
+ do
+ # Create the main window
+ push_window new HttpRequestClientWindow
+ super
+ end
+end
# Thread executing an HTTP request asynchronously
#
-# The request is sent to `rest_server_uri / rest_action`.
+# The request is sent to `uri`.
+# Either `uri`, or `uri_root` and `uri_tail`, must be set in subclasses.
#
# If `deserialize_json`, the default behavior, the response is deserialized from JSON
#
-# If `delay > 0.0`, sending the reqest is delayed by the given `delay` in seconds.
+# If `delay > 0.0`, sending the request is delayed by the given `delay` in seconds.
# It can be used to delay resending a request on error.
#
# Four callback methods act on the main/UI thread,
# * `on_load`
# * `on_fail`
# * `after`
-class AsyncHttpRequest
+#
+# See full example at `examples/http_request_example.nit`.
+abstract class AsyncHttpRequest
super Thread
- # Root URI of the remote server
- fun rest_server_uri: String is abstract
+ # URI target of this request, by default it is composed of `uri_root / uri_tail`
+ fun uri: Text do return uri_root / uri_tail
+
+ # Root URI of the remote server, usually the scheme and remote host
+ fun uri_root: String is abstract
- # Action, or path, for this request within the `rest_server_uri`
- fun rest_action: String is abstract
+ # Right part of the URI, after `uri_root`, often the resource path and the query
+ fun uri_tail: String do return ""
# Should the response content be deserialized from JSON?
var deserialize_json = true is writable
var delay = delay
if delay > 0.0 then delay.sleep
- var uri = rest_server_uri / rest_action
+ var uri = uri
# Execute REST request
var rep = uri.http_get
return null
end
- if not deserialize_json then
- app.run_on_ui_thread new RestRunnableOnLoad(self, rep)
+ if deserialize_json then
+ # Deserialize
+ var deserializer = new JsonDeserializer(rep.value)
+ var res = deserializer.deserialize
+ if deserializer.errors.not_empty then
+ app.run_on_ui_thread new RestRunnableOnFail(self, deserializer.errors.first)
+ else
+ app.run_on_ui_thread new RestRunnableOnLoad(self, res, rep.code)
+ end
+ else
+ # Return text data
+ app.run_on_ui_thread new RestRunnableOnLoad(self, rep.value, rep.code)
return null
end
- # Deserialize
- var deserializer = new JsonDeserializer(rep.value)
- var res = deserializer.deserialize
- if deserializer.errors.not_empty then
- app.run_on_ui_thread new RestRunnableOnFail(self, deserializer.errors.first)
- end
+ app.run_on_ui_thread new RestRunnableJoin(self)
- app.run_on_ui_thread new RestRunnableOnLoad(self, res)
return null
end
# In this case, `result` may be any deserialized object.
#
# Otherwise, if `not deserialize_json`, `result` contains the content of the response as a `String`.
- fun on_load(result: nullable Object) do end
+ fun on_load(result: nullable Object, http_status_code: Int) do end
# Invoked when the HTTP request has failed and no data was received or deserialization failed
- fun on_fail(error: Error) do print_error "REST request '{rest_action}' failed with: {error}"
+ fun on_fail(error: Error) do print_error "HTTP request '{uri}' failed with: {error}"
# Complete this request whether it was a success or not
fun after do end
end
+# Minimal implementation of `AsyncHttpRequest` where `uri` is an attribute
+#
+# Prints on communication errors and when the server returns an HTTP status code not in the 200s.
+#
+# ~~~
+# var request = new SimpleAsyncHttpRequest("http://example.com")
+# request.start
+# ~~~
+class SimpleAsyncHttpRequest
+ super AsyncHttpRequest
+
+ redef var uri
+
+ redef fun on_load(data, status) do if status < 200 or status >= 299
+ then print_error "HTTP request '{uri}' received HTTP status code: {status}"
+end
+
redef class Text
# Execute an HTTP GET request synchronously at the URI `self`
#
var maybe_code: nullable Int
# The status code
+ #
# Require: `not is_error`
fun code: Int do return maybe_code.as(not null)
end
var res: nullable Object
+ var code: Int
+
redef fun main
do
- sender_thread.on_load(res)
+ sender_thread.on_load(res, code)
sender_thread.after
end
end
sender_thread.after
end
end
+
+private class RestRunnableJoin
+ super HttpRequestTask
+
+ redef fun main do sender_thread.join
+end
# Offers the base 64 encoding and decoding algorithms
module base64
-redef class NativeString
- # Alphabet used by the base64 algorithm
- private fun base64_chars : SequenceRead[Byte]
- do
- return "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".bytes
+redef class Char
+ # Is `self` a valid Base64 character ?
+ fun is_base64_char: Bool do
+ if code_point >= 127 then return false
+ return ascii.is_base64_char
end
+end
- # Reversed alphabet for base64
- private fun inverted_base64_chars : HashMap[Byte, Byte]
- do
- var inv_base64_chars = new HashMap[Byte, Byte]
- var l = base64_chars.length
- for k in [0 .. l[ do
- inv_base64_chars[base64_chars[k]] = k.to_b
+redef class Byte
+ # Is `self` a valid Base64 character ?
+ fun is_base64_char: Bool do
+ if self == b'+' then return true
+ if self == b'/' then return true
+ if self > b'Z' then
+ if self < b'a' then return false
+ if self <= b'z' then return true
+ return false
+ end
+ if self >= b'A' then return true
+ if self <= b'9' and self >= b'0' then return true
+ return false
+ end
+
+ # Returns the `base64` equivalent of `self`
+ #
+ # REQUIRE `self`.`is_base64_char`
+ fun to_base64_char: Byte do
+ if self == b'+' then return 62u8
+ if self == b'/' then return 63u8
+ if self > b'Z' then
+ if self < b'a' then abort
+ if self <= b'z' then return self - 71u8
+ abort
end
- return inv_base64_chars
+ if self >= b'A' then return self - 0x41u8
+ if self <= b'9' and self >= b'0' then return self + 4u8
+ abort
+ end
+end
+
+redef class NativeString
+ # Alphabet used by the base64 algorithm
+ private fun base64_chars : Bytes
+ do
+ return b"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"
end
# Encodes `self` to base64.
# By default, uses "=" for padding.
#
# assert "string".encode_base64 == "c3RyaW5n"
- private fun encode_base64(length: Int, padding: nullable Byte): Bytes do
+ private fun encode_base64(length: Int): Bytes do
var base64_bytes = once base64_chars
- if padding == null then padding = '='.ascii
var steps = length / 3
var bytes_in_last_step = length % 3
var result_length = steps * 4
result.add base64_bytes[((self[in_off + 1] & 0b0000_1111u8) << 2).to_i]
end
var rempad = if bytes_in_last_step > 0 then 3 - bytes_in_last_step else 0
- for i in [0 .. rempad[ do result.add padding
+ for i in [0 .. rempad[ do result.add b'='
return result
end
# Decodes `self` from base64
#
- # assert "c3RyaW5n".decode_base64 == "string"
- # assert "c3Rya\nW5n".decode_base64 == "string"
+ # assert "c3RyaW5n".decode_base64.to_s == "string"
+ # assert "c3Rya\nW5n".decode_base64.to_s == "string"
+ # assert "c3RyaW5nCg==".decode_base64.to_s == "string\n"
+ # assert "c3RyaW5nCg".decode_base64.to_s == "string\n"
+ # assert "c3RyaW5neQo=".decode_base64.to_s == "stringy\n"
+ # assert "c3RyaW5neQo".decode_base64.to_s == "stringy\n"
#
- # REQUIRE: `length % 4 == 0`
- private fun decode_base64(length: Int, padding: nullable Byte): Bytes do
- if padding == null then padding = '='.ascii
- var inv = once inverted_base64_chars
+ private fun decode_base64(length: Int): Bytes do
if length == 0 then return new Bytes.empty
- # Remove non-base64 chars
- var bytes = new Bytes.with_capacity(length)
- for k in [0 .. length[ do
- var byte = self[k]
- if inv.has_key(byte) or byte == padding then bytes.add(byte)
+ # Avoids constant unboxing
+ var pad = b'='
+
+ var result = new Bytes.with_capacity((length / 4 + 1) * 3)
+
+ var curr = 0
+ var cnt = 0
+ var endpos = -1
+ for i in [0 .. length[ do
+ var b = self[i]
+ if b == pad then
+ endpos = i
+ break
+ end
+ # Ignore whitespaces
+ if b <= 0x20u8 then continue
+ if not b.is_base64_char then continue
+ curr <<= 6
+ curr += b.to_base64_char.to_i
+ cnt += 1
+ if cnt == 4 then
+ result.add(((curr & 0xFF0000) >> 16).to_b)
+ result.add(((curr & 0xFF00) >> 8).to_b)
+ result.add((curr & 0xFF).to_b)
+ curr = 0
+ cnt = 0
+ end
end
- length = bytes.length
-
- var steps = length / 4
- var result_length = steps * 3
-
- var epos = length - 1
- var padding_len = 0
- while epos >= 0 and bytes[epos] == padding do
- epos -= 1
- padding_len += 1
+ if endpos != -1 or cnt != 0 then
+ var pads = 0
+ for i in [endpos .. length[ do
+ var b = self[i]
+ if b <= 0x20u8 then continue
+ pads += 1
+ end
+ if cnt == 2 then
+ curr >>= 4
+ result.add(curr.to_b)
+ else if cnt == 3 then
+ curr >>= 2
+ result.add(((curr & 0xFF00) >> 8).to_b)
+ result.add((curr & 0xFF).to_b)
+ end
end
+ return result
+ end
- if padding_len != 0 then steps -= 1
- if padding_len == 1 then result_length -= 1
- if padding_len == 2 then result_length -= 2
-
- var result = new Bytes.with_capacity(result_length + 1)
+ # Is `self` a well-formed Base64 entity ?
+ #
+ # ~~~nit
+ # assert "Qn03".is_base64
+ # assert not "#sd=".is_base64
+ # ~~~
+ fun is_base64(length: Int): Bool do return check_base64(length) == null
- for s in [0 .. steps[ do
- var c0 = inv[bytes[s * 4]]
- var c1 = inv[bytes[s * 4 + 1]]
- var c2 = inv[bytes[s * 4 + 2]]
- var c3 = inv[bytes[s * 4 + 3]]
- result.add (((c0 & 0b0011_1111u8) << 2) | ((c1 & 0b0011_0000u8) >> 4))
- result.add (((c1 & 0b0000_1111u8) << 4) | ((c2 & 0b0011_1100u8) >> 2))
- result.add (((c2 & 0b0000_0011u8) << 6) | (c3 & 0b0011_1111u8))
+ # Is `self` a well-formed Base64 entity ?
+ #
+ # Will return an Error otherwise with info on which part is erroneous.
+ fun check_base64(length: Int): nullable Error do
+ var rlen = 0
+ var opos = length
+ for i in [0 .. length[ do
+ if self[i] == b'=' then
+ opos = i
+ break
+ end
+ if self[i].is_whitespace then continue
+ if not self[i].is_base64_char then return new Error("Invalid Base64 character at position {i}: {self[i].ascii}")
+ rlen += 1
+ if rlen > 4 then rlen -= 4
end
-
- var last_start = steps * 4
- if padding_len == 1 then
- var c0 = inv[bytes[last_start]]
- var c1 = inv[bytes[last_start + 1]]
- var c2 = inv[bytes[last_start + 2]]
- result.add (((c0 & 0b0011_1111u8) << 2) | ((c1 & 0b0011_0000u8) >> 4))
- result.add (((c1 & 0b0000_1111u8) << 4) | ((c2 & 0b0011_1100u8) >> 2))
- else if padding_len == 2 then
- var c0 = inv[bytes[last_start]]
- var c1 = inv[bytes[last_start + 1]]
- result.add (((c0 & 0b0011_1111u8) << 2) | ((c1 & 0b0011_0000u8) >> 4))
+ var pad = 0
+ for i in [opos .. length[ do
+ if self[i].is_whitespace then continue
+ if self[i] != b'=' then return new Error("Invalid padding character {self[i].ascii} at position {i}")
+ pad += 1
end
-
- return result
+ if rlen + pad != 4 then return new Error("Invalid padding length")
+ return null
end
end
# Encodes the receiver string to base64 using a custom padding character.
#
# If using the default padding character `=`, see `encode_base64`.
- fun encode_base64(padding: nullable Byte): Bytes
- do
- return items.encode_base64(length, padding)
- end
+ fun encode_base64: Bytes do return items.encode_base64(length)
# Decodes the receiver string to base64 using a custom padding character.
#
# Default padding character `=`
- fun decode_base64(padding : nullable Byte) : Bytes
- do
- return items.decode_base64(length, padding)
- end
+ fun decode_base64: Bytes do return items.decode_base64(length)
+
+ # Is `self` a well-formed Base64 entity ?
+ fun is_base64: Bool do return items.is_base64(length)
+
+ # Is `self` a well-formed Base64 entity ?
+ #
+ # Will return an Error otherwise with info on which part is erroneous.
+ fun check_base64: nullable Error do return items.check_base64(length)
end
-redef class String
+redef class Text
# Encodes the receiver string to base64 using a custom padding character.
#
# If using the default padding character `=`, see `encode_base64`.
- fun encode_base64(padding: nullable Byte): String
- do
- return to_cstring.encode_base64(bytelen, padding).to_s
- end
+ fun encode_base64: String do return to_cstring.encode_base64(byte_length).to_s
# Decodes the receiver string to base64 using a custom padding character.
#
# Default padding character `=`
- fun decode_base64(padding : nullable Byte) : String
- do
- return to_cstring.decode_base64(bytelen, padding).to_s
- end
+ fun decode_base64: Bytes do return to_cstring.decode_base64(byte_length)
+
+ # Is `self` a well-formed Base64 entity ?
+ fun is_base64: Bool do return to_cstring.is_base64(byte_length)
+
+ # Is `self` a well-formed Base64 entity ?
+ #
+ # Will return an Error otherwise with info on which part is erroneous.
+ fun check_base64: nullable Error do return to_cstring.check_base64(byte_length)
+end
+
+redef class FlatText
+ redef fun encode_base64 do return fast_cstring.encode_base64(byte_length).to_s
+
+ redef fun decode_base64 do return fast_cstring.decode_base64(byte_length)
+
+ redef fun is_base64 do return fast_cstring.is_base64(byte_length)
+
+ redef fun check_base64 do return fast_cstring.check_base64(byte_length)
end
# Compared to `write_string`, this method supports null bytes in `text`.
fun write_block(text: Text)
do
- write_int64 text.bytelen
+ write_int64 text.byte_length
write text
end
redef class Text
# Get a `NSString` from `self`
- fun to_nsstring: NSString do return to_cstring.to_nsstring(bytelen)
+ fun to_nsstring: NSString do return to_cstring.to_nsstring(byte_length)
end
# Wrapper of byte buffers
# Appends the bytes of `s` to `selftextextt`
fun append_text(s: Text) do
for i in s.substrings do
- append_ns(i.fast_cstring, i.bytelen)
+ append_ns(i.fast_cstring, i.byte_length)
end
end
# assert "String".to_bytes == [83u8, 116u8, 114u8, 105u8, 110u8, 103u8]
# ~~~
fun to_bytes: Bytes do
- var b = new Bytes.with_capacity(bytelen)
+ var b = new Bytes.with_capacity(byte_length)
append_to_bytes b
return b
end
fun append_to_bytes(b: Bytes) do
for s in substrings do
var from = if s isa FlatString then s.first_byte else 0
- b.append_ns_from(s.items, s.bytelen, from)
+ b.append_ns_from(s.items, s.byte_length, from)
end
end
# assert "a b c".hexdigest_to_bytes.hexdigest == "0ABC"
fun hexdigest_to_bytes: Bytes do
var b = bytes
- var max = bytelen
+ var max = byte_length
var dlength = 0 # Number of hex digits
var pos = 0
#
# assert "<STRING/&rt;".hexdigest == "266C743B535452494E47262334373B2672743B"
fun hexdigest: String do
- var ln = bytelen
+ var ln = byte_length
var outns = new NativeString(ln * 2)
var oi = 0
for i in [0 .. ln[ do
# assert "\\x41\\x42\\x43".unescape_to_bytes.chexdigest == "\\x41\\x42\\x43"
# assert "B\\n\\x41\\u0103D3".unescape_to_bytes.chexdigest == "\\x42\\x0A\\x41\\xF0\\x90\\x8F\\x93"
fun unescape_to_bytes: Bytes do
- var res = new Bytes.with_capacity(self.bytelen)
+ var res = new Bytes.with_capacity(self.byte_length)
var was_slash = false
var i = 0
while i < length do
fun binarydigest_to_bytes: Bytes
do
var b = bytes
- var max = bytelen
+ var max = byte_length
# Count bits
var bitlen = 0
redef class FlatText
redef fun append_to_bytes(b) do
var from = if self isa FlatString then first_byte else 0
- b.append_ns_from(items, bytelen, from)
+ b.append_ns_from(items, byte_length, from)
end
end
end
redef fun encode_string(s) do
- var ns = new Bytes.with_capacity(s.bytelen)
+ var ns = new Bytes.with_capacity(s.byte_length)
add_string_to(s, ns)
return ns
end
end
redef fun encode_string(s) do
- var buf = new Bytes.with_capacity(s.bytelen)
+ var buf = new Bytes.with_capacity(s.byte_length)
add_string_to(s, buf)
return buf
end
redef fun add_string_to(s, b) do
s.append_to_bytes(b)
- return s.bytelen
+ return s.byte_length
end
redef fun is_valid_char(ns, len) do
if rit == ns then
var nns = new NativeString(len)
rit.copy_to(nns, len, 0, 0)
- return nns.to_s_full(ret.bytelen, ret.length)
+ return nns.to_s_full(ret.byte_length, ret.length)
end
return ret
end
private fun write_native_to(s: FileWriter)
do
- for i in substrings do s.write_native(i.to_cstring, 0, i.bytelen)
+ for i in substrings do s.write_native(i.to_cstring, 0, i.byte_length)
end
end
redef class FlatString
redef fun write_native_to(s)
do
- s.write_native(items, first_byte, bytelen)
+ s.write_native(items, first_byte, byte_length)
end
redef fun file_extension do
# assert not "Not an Int".is_int
# assert not "-".is_int
fun is_int: Bool do
- if bytelen == 0 then return false
+ if byte_length == 0 then return false
var s = remove_all('_')
var pos = 0
var len = s.length
return self
end
end
+
+ # Is `self` an ASCII whitespace ?
+ fun is_whitespace: Bool do return self == 0x7Fu8 or self <= 0x20u8
end
# Native integer numbers.
# Actually execute
var cstr = text.to_cstring
- var rets = cstr.to_s_with_length(text.bytelen)
+ var rets = cstr.to_s_with_length(text.byte_length)
var bytefrom = cstr.char_to_byte_index_cached(charfrom, 0, 0)
var subcstr = cstr.fast_cstring(bytefrom)
var eflags = gather_eflags
# Actually execute
var cstr = text.to_cstring
var subcstr = cstr
- var rets = cstr.to_s_with_length(text.bytelen)
+ var rets = cstr.to_s_with_length(text.byte_length)
var eflags = gather_eflags
var eflags_or_notbol = eflags | flag_notbol
var native_match = self.native_match
var rets = ""
var pos = 0
var str = s.items.clean_utf8(slen)
- slen = str.bytelen
+ slen = str.byte_length
var sits = str.items
var remsp = slen
while pos < slen do
break
end
var st = sits.find_beginning_of_char_at(pos + chunksz - 1)
- var bytelen = st - pos
- rets += new FlatString.with_infos(sits, bytelen, pos)
+ var byte_length = st - pos
+ rets += new FlatString.with_infos(sits, byte_length, pos)
pos = st
- remsp -= bytelen
+ remsp -= byte_length
end
if rets isa Concat then return rets.balance
return rets
return new Bytes(nns, nslen, nslen)
end
- redef fun eof do return cursor >= source.bytelen
+ redef fun eof do return cursor >= source.byte_length
end
# Number of bytes in `self`
#
- # assert "12345".bytelen == 5
- # assert "あいうえお".bytelen == 15
- fun bytelen: Int is abstract
+ # assert "12345".byte_length == 5
+ # assert "あいうえお".byte_length == 15
+ fun byte_length: Int is abstract
# Create a substring.
#
# assert "%c3%a9%e3%81%82%e3%81%84%e3%81%86".from_percent_encoding == "éあいう"
fun from_percent_encoding: String
do
- var len = bytelen
+ var len = byte_length
var has_percent = false
for c in chars do
if c == '%' then
redef var length = 0
- redef var bytelen = 0
+ redef var byte_length = 0
redef fun output
do
redef fun is_empty do return target.is_empty
- redef fun length do return target.bytelen
+ redef fun length do return target.byte_length
redef fun iterator do return self.iterator_from(0)
- redef fun reverse_iterator do return self.reverse_iterator_from(target.bytelen - 1)
+ redef fun reverse_iterator do return self.reverse_iterator_from(target.byte_length - 1)
end
# Immutable sequence of characters.
# use only when the data has already been verified as valid UTF-8.
fun to_s_unsafe(length: nullable Int): String is abstract
- # Get a `String` from the raw `bytelen` bytes at `self` with `unilen` Unicode characters
+ # Get a `String` from the raw `byte_length` bytes at `self` with `unilen` Unicode characters
#
# The created `String` points to the data at `self`.
# This method should be used when `self` was allocated by the Nit GC,
# use only when the data has already been verified as valid UTF-8.
#
# SEE: `abstract_text::Text` for more info on the difference
- # between `Text::bytelen` and `Text::length`.
- fun to_s_full(bytelen, unilen: Int): String is abstract
+ # between `Text::byte_length` and `Text::length`.
+ fun to_s_full(byte_length, unilen: Int): String is abstract
# Copies the content of `src` to `self`
#
- # NOTE: `self` must be large enough to withold `self.bytelen` bytes
- fun fill_from(src: Text) do src.copy_to_native(self, src.bytelen, 0, 0)
+ # NOTE: `self` must be large enough to withold `self.byte_length` bytes
+ fun fill_from(src: Text) do src.copy_to_native(self, src.byte_length, 0, 0)
end
redef class NativeArray[E]
protected fun first_byte: Int do return 0
# Last byte of the NativeString
- protected fun last_byte: Int do return first_byte + _bytelen - 1
+ protected fun last_byte: Int do return first_byte + _byte_length - 1
# Cache of the latest position (char) explored in the string
var position: Int = 0
var its = _items
var max = last_byte
var pos = first_byte
- var nlen = extra + _bytelen
+ var nlen = extra + _byte_length
var nits = new NativeString(nlen)
var outpos = 0
while pos <= max do
if ln_extra == 0 then return self.to_s
var its = _items
var max = last_byte
- var nlen = _bytelen + ln_extra
+ var nlen = _byte_length + ln_extra
var nns = new NativeString(nlen)
var pos = first_byte
var opos = 0
redef var bytes = new FlatStringByteView(self) is lazy
redef var to_cstring is lazy do
- var blen = _bytelen
+ var blen = _byte_length
var new_items = new NativeString(blen + 1)
_items.copy_to(new_items, blen, _first_byte, 0)
new_items[blen] = 0u8
end
redef fun reversed do
- var b = new FlatBuffer.with_capacity(_bytelen + 1)
+ var b = new FlatBuffer.with_capacity(_byte_length + 1)
var i = _length - 1
while i >= 0 do
b.add self.fetch_char_at(i)
redef fun to_upper
do
- var outstr = new FlatBuffer.with_capacity(self._bytelen + 1)
+ var outstr = new FlatBuffer.with_capacity(self._byte_length + 1)
var mylen = _length
var pos = 0
redef fun to_lower
do
- var outstr = new FlatBuffer.with_capacity(self._bytelen + 1)
+ var outstr = new FlatBuffer.with_capacity(self._byte_length + 1)
var mylen = _length
var pos = 0
#
# `_items` will be used as is, without copy, to retrieve the characters of the string.
# Aliasing issues is the responsibility of the caller.
- private new with_infos(items: NativeString, bytelen, from: Int)
+ private new with_infos(items: NativeString, byte_length, from: Int)
do
- var len = items.utf8_length(from, bytelen)
- if bytelen == len then return new ASCIIFlatString.full_data(items, bytelen, from, len)
- return new UnicodeFlatString.full_data(items, bytelen, from, len)
+ var len = items.utf8_length(from, byte_length)
+ if byte_length == len then return new ASCIIFlatString.full_data(items, byte_length, from, len)
+ return new UnicodeFlatString.full_data(items, byte_length, from, len)
end
# Low-level creation of a new string with all the data.
#
# `_items` will be used as is, without copy, to retrieve the characters of the string.
# Aliasing issues is the responsibility of the caller.
- private new full(items: NativeString, bytelen, from, length: Int)
+ private new full(items: NativeString, byte_length, from, length: Int)
do
- if bytelen == length then return new ASCIIFlatString.full_data(items, bytelen, from, length)
- return new UnicodeFlatString.full_data(items, bytelen, from, length)
+ if byte_length == length then return new ASCIIFlatString.full_data(items, byte_length, from, length)
+ return new UnicodeFlatString.full_data(items, byte_length, from, length)
end
redef fun ==(other)
if self.object_id == other.object_id then return true
- var my_length = _bytelen
+ var my_length = _byte_length
- if other._bytelen != my_length then return false
+ if other._byte_length != my_length then return false
var my_index = _first_byte
var its_index = other.first_byte
var myits = _items
var itsits = other._items
- var mbt = _bytelen
- var obt = other.bytelen
+ var mbt = _byte_length
+ var obt = other.byte_length
var minln = if mbt < obt then mbt else obt
var mst = _first_byte
redef fun +(o) do
var s = o.to_s
- var slen = s.bytelen
- var mlen = _bytelen
+ var slen = s.byte_length
+ var mlen = _byte_length
var nlen = mlen + slen
var mits = _items
var mifrom = _first_byte
end
redef fun *(i) do
- var mybtlen = _bytelen
- var new_bytelen = mybtlen * i
+ var mybtlen = _byte_length
+ var new_byte_length = mybtlen * i
var mylen = _length
var newlen = mylen * i
var its = _items
var fb = _first_byte
- var ns = new NativeString(new_bytelen + 1)
- ns[new_bytelen] = 0u8
+ var ns = new NativeString(new_byte_length + 1)
+ ns[new_byte_length] = 0u8
var offset = 0
while i > 0 do
its.copy_to(ns, mybtlen, fb, offset)
offset += mybtlen
i -= 1
end
- return new FlatString.full(ns, new_bytelen, 0, newlen)
+ return new FlatString.full(ns, new_byte_length, 0, newlen)
end
redef fun hash
private class UnicodeFlatString
super FlatString
- init full_data(items: NativeString, bytelen, from, length: Int) do
+ init full_data(items: NativeString, byte_length, from, length: Int) do
self._items = items
self._length = length
- self._bytelen = bytelen
+ self._byte_length = byte_length
_first_byte = from
_bytepos = from
end
if from <= 0 then return self
var c = char_to_byte_index(from)
var st = c - _first_byte
- var fln = bytelen - st
+ var fln = byte_length - st
return new FlatString.full(items, fln, c, _length - from)
end
end
private class ASCIIFlatString
super FlatString
- init full_data(items: NativeString, bytelen, from, length: Int) do
+ init full_data(items: NativeString, byte_length, from, length: Int) do
self._items = items
self._length = length
- self._bytelen = bytelen
+ self._byte_length = byte_length
_first_byte = from
_bytepos = from
end
redef fun [](idx) do
- assert idx < _bytelen and idx >= 0
+ assert idx < _byte_length and idx >= 0
return _items[idx + _first_byte].ascii
end
end
redef fun reversed do
- var b = new FlatBuffer.with_capacity(_bytelen + 1)
+ var b = new FlatBuffer.with_capacity(_byte_length + 1)
var i = _length - 1
while i >= 0 do
b.add self[i]
# Check that the index (+ _first_byte) is not larger than last_byte
# In other terms, if the index is valid
var target = _target
- assert index >= 0 and index < target._bytelen
+ assert index >= 0 and index < target._byte_length
var ind = index + target._first_byte
return target._items[ind]
end
# the Copy-On-Write flag `written` is set at true.
private fun reset do
var nns = new NativeString(capacity)
- if _bytelen != 0 then _items.copy_to(nns, _bytelen, 0, 0)
+ if _byte_length != 0 then _items.copy_to(nns, _byte_length, 0, 0)
_items = nns
written = false
end
# Shifts the content of the buffer by `len` bytes to the right, starting at byte `from`
#
- # Internal only, does not modify _bytelen or length, this is the caller's responsability
+ # Internal only, does not modify _byte_length or length, this is the caller's responsability
private fun rshift_bytes(from: Int, len: Int) do
var oit = _items
var nit = _items
- var bt = _bytelen
+ var bt = _byte_length
if bt + len > capacity then
capacity = capacity * 2 + 2
nit = new NativeString(capacity)
# Shifts the content of the buffer by `len` bytes to the left, starting at `from`
#
- # Internal only, does not modify _bytelen or length, this is the caller's responsability
+ # Internal only, does not modify _byte_length or length, this is the caller's responsability
private fun lshift_bytes(from: Int, len: Int) do
var it = _items
- it.copy_to(it, _bytelen - from, from, from - len)
+ it.copy_to(it, _byte_length - from, from, from - len)
end
redef fun []=(index, item)
else if size_diff < 0 then
lshift_bytes(ip + clen, -size_diff)
end
- _bytelen += size_diff
+ _byte_length += size_diff
it.set_char_at(ip, item)
end
if written then reset
is_dirty = true
var clen = c.u8char_len
- var bt = _bytelen
+ var bt = _byte_length
enlarge(bt + clen)
_items.set_char_at(bt, c)
- _bytelen += clen
+ _byte_length += clen
_length += 1
end
redef fun clear do
is_dirty = true
- _bytelen = 0
+ _byte_length = 0
_length = 0
if written then
_capacity = 16
# The COW flag can be set at false here, since
# it does a copy of the current `Buffer`
written = false
- var bln = _bytelen
+ var bln = _byte_length
var a = new NativeString(c)
if bln > 0 then
var it = _items
redef fun to_s
do
written = true
- var bln = _bytelen
+ var bln = _byte_length
if bln == 0 then _items = new NativeString(1)
return new FlatString.full(_items, bln, 0, _length)
end
redef fun to_cstring
do
if is_dirty then
- var bln = _bytelen
+ var bln = _byte_length
var new_native = new NativeString(bln + 1)
new_native[bln] = 0u8
if _length > 0 then _items.copy_to(new_native, bln, 0, 0)
#
# If `_items` is shared, `written` should be set to true after the creation
# so that a modification will do a copy-on-write.
- private init with_infos(items: NativeString, capacity, bytelen, length: Int)
+ private init with_infos(items: NativeString, capacity, byte_length, length: Int)
do
self._items = items
self.capacity = capacity
- self._bytelen = bytelen
+ self._byte_length = byte_length
self._length = length
end
# Create a new string copied from `s`.
init from(s: Text)
do
- _items = new NativeString(s.bytelen)
- for i in s.substrings do i._items.copy_to(_items, i._bytelen, first_byte, 0)
- _bytelen = s.bytelen
+ _items = new NativeString(s.byte_length)
+ for i in s.substrings do i._items.copy_to(_items, i._byte_length, first_byte, 0)
+ _byte_length = s.byte_length
_length = s.length
- _capacity = _bytelen
+ _capacity = _byte_length
end
# Create a new empty string with a given capacity.
assert cap >= 0
_items = new NativeString(cap)
capacity = cap
- _bytelen = 0
+ _byte_length = 0
end
redef fun append(s)
do
if s.is_empty then return
is_dirty = true
- var sl = s.bytelen
- var nln = _bytelen + sl
+ var sl = s.byte_length
+ var nln = _byte_length + sl
enlarge(nln)
if s isa FlatText then
- s._items.copy_to(_items, sl, s.first_byte, _bytelen)
+ s._items.copy_to(_items, sl, s.first_byte, _byte_length)
else
for i in s.substrings do append i
return
end
- _bytelen = nln
+ _byte_length = nln
_length += s.length
end
var bytest = s.char_to_byte_index(from)
var bytend = s.char_to_byte_index(from + length - 1)
var btln = bytend - bytest + 1
- enlarge(btln + _bytelen)
- s._items.copy_to(_items, btln, bytest, _bytelen)
- _bytelen += btln
+ enlarge(btln + _byte_length)
+ s._items.copy_to(_items, btln, bytest, _byte_length)
+ _byte_length += btln
_length += length
end
redef fun times(repeats)
do
- var bln = _bytelen
+ var bln = _byte_length
var x = new FlatString.full(_items, bln, 0, _length)
for i in [1 .. repeats[ do
append(x)
redef fun index do return curr_pos
- redef fun is_ok do return curr_pos < target._bytelen
+ redef fun is_ok do return curr_pos < target._byte_length
redef fun item do return target_items[curr_pos]
return clean_utf8(length)
end
- redef fun to_s_full(bytelen, unilen) do
- return new FlatString.full(self, bytelen, 0, unilen)
+ redef fun to_s_full(byte_length, unilen) do
+ return new FlatString.full(self, byte_length, 0, unilen)
end
redef fun to_s_unsafe(len) do
continue
end
var tmp = itsi.to_s
- sl += tmp.bytelen
+ sl += tmp.byte_length
na[mypos] = tmp
i += 1
mypos += 1
while i < mypos do
var tmp = na[i]
if tmp isa FlatString then
- var tpl = tmp._bytelen
+ var tpl = tmp._byte_length
tmp._items.copy_to(ns, tpl, tmp._first_byte, off)
off += tpl
else
for j in tmp.substrings do
var s = j.as(FlatString)
- var slen = s._bytelen
+ var slen = s._byte_length
s._items.copy_to(ns, slen, s._first_byte, off)
off += slen
end
var sl = 0
var mypos = 0
while i < l do
- sl += na[i].bytelen
+ sl += na[i].byte_length
i += 1
mypos += 1
end
while i < mypos do
var tmp = na[i]
if tmp isa FlatString then
- var tpl = tmp._bytelen
+ var tpl = tmp._byte_length
tmp._items.copy_to(ns, tpl, tmp._first_byte, off)
off += tpl
else
for j in tmp.substrings do
var s = j.as(FlatString)
- var slen = s._bytelen
+ var slen = s._byte_length
s._items.copy_to(ns, slen, s._first_byte, off)
off += slen
end
return endpos
end
- # Number of UTF-8 characters in `self` starting at `from`, for a length of `bytelen`
- fun utf8_length(from, bytelen: Int): Int is intern do
+ # Number of UTF-8 characters in `self` starting at `from`, for a length of `byte_length`
+ fun utf8_length(from, byte_length: Int): Int is intern do
var st = from
var ln = 0
- while bytelen > 0 do
- while bytelen >= 4 do
+ while byte_length > 0 do
+ while byte_length >= 4 do
var i = fetch_4_chars(st)
if i & 0x80808080 != 0 then break
- bytelen -= 4
+ byte_length -= 4
st += 4
ln += 4
end
- if bytelen == 0 then break
+ if byte_length == 0 then break
var cln = length_of_char_at(st)
st += cln
ln += 1
- bytelen -= cln
+ byte_length -= cln
end
return ln
end
redef var length is noinit
- redef var bytelen is noinit
+ redef var byte_length is noinit
redef fun substrings do return new RopeSubstrings.from(self, 0)
var flat_last_pos_end: Int = -1
redef var to_cstring is lazy do
- var len = _bytelen
+ var len = _byte_length
var ns = new NativeString(len + 1)
ns[len] = 0u8
var off = 0
for i in substrings do
- var ilen = i._bytelen
+ var ilen = i._byte_length
i.as(FlatString)._items.copy_to(ns, ilen, i.as(FlatString)._first_byte, off)
off += ilen
end
var l = _left
var r = _right
length = l.length + r.length
- _bytelen = l.bytelen + r.bytelen
+ _byte_length = l.byte_length + r.byte_length
end
- redef fun is_empty do return _bytelen == 0
+ redef fun is_empty do return _byte_length == 0
redef fun output do
_left.output
redef fun +(o) do
var s = o.to_s
- var slen = s.bytelen
+ var slen = s.byte_length
if s isa Concat then
return new Concat(self, s)
else
var r = _right
- var rlen = r.bytelen
+ var rlen = r.byte_length
if rlen + slen > maxlen then return new Concat(self, s)
return new Concat(_left, r + s)
end
redef fun copy_to_native(dest, n, src_offset, dest_offset) do
var l = _left
- if src_offset < l.bytelen then
- var lcopy = l.bytelen - src_offset
+ if src_offset < l.byte_length then
+ var lcopy = l.byte_length - src_offset
lcopy = if lcopy > n then n else lcopy
l.copy_to_native(dest, lcopy, src_offset, dest_offset)
dest_offset += lcopy
end
# Length of the complete rope in bytes
- redef var bytelen = 0
+ redef var byte_length = 0
# Length of the mutable part (in bytes)
#
self.str = str
ns = new NativeString(maxlen)
buf_size = maxlen
- _bytelen = str.length
+ _byte_length = str.length
dumped = 0
end
assert i >= 0 and i <= length
if i == length then add c
if i < str.length then
- _bytelen += c.u8char_len - str[i].u8char_len
+ _byte_length += c.u8char_len - str[i].u8char_len
var s = str
var l = s.substring(0, i)
var r = s.substring_from(i + 1)
else
ns.copy_to(ns, rpos - st_nxt, st_nxt, st_nxt + delta)
end
- _bytelen += delta
+ _byte_length += delta
rpos += delta
end
ns.set_char_at(index, c)
redef fun clear do
str = ""
- _bytelen = 0
+ _byte_length = 0
rpos = 0
dumped = 0
if written then
end
redef fun append(s) do
- var slen = s.bytelen
+ var slen = s.byte_length
if slen >= maxlen then
persist_buffer
str += s.to_s
end
ns.set_char_at(rp, c)
rp += cln
- _bytelen += cln
+ _byte_length += cln
rpos = rp
end
redef fun +(o) do
var s = o.to_s
- var slen = s.bytelen
- var mlen = _bytelen
+ var slen = s.byte_length
+ var mlen = _byte_length
if slen == 0 then return self
if mlen == 0 then return s
var nlen = slen + mlen
return new FlatString.full(ns, nlen, 0, length + s.length)
else if s isa Concat then
var sl = s._left
- var sllen = sl.bytelen
+ var sllen = sl.byte_length
if sllen + mlen > maxlen then return new Concat(self, s)
return new Concat(self + sl, s._right)
else
var ns: NativeString is noautoinit
# Substrings of the Rope
var subs: IndexedIterator[FlatString] is noautoinit
- # Maximum position to iterate on (e.g. Rope.bytelen)
+ # Maximum position to iterate on (e.g. Rope.byte_length)
var max: Int is noautoinit
# Position (char) in the Rope (0-indexed)
var pos: Int is noautoinit
pns = pos - subs.index
self.pos = pos
ns = subs.item._items
- max = root.bytelen - 1
+ max = root.byte_length - 1
end
redef fun item do return ns[pns]
redef fun next do
pns += 1
pos += 1
- if pns < subs.item._bytelen then return
+ if pns < subs.item._byte_length then return
if not subs.is_ok then return
subs.next
if not subs.is_ok then return
var cache_end: Int = -1
redef fun [](i) do
- assert i >= 0 and i < target._bytelen
+ assert i >= 0 and i < target._byte_length
var flps = _cache_start
if i >= flps and i <= _cache_end then
return _cache.bytes[i - flps]
if s isa FlatString then break
s = s.as(Concat)
var lft = s._left
- var llen = lft.bytelen
+ var llen = lft.byte_length
if pos >= llen then
s = s._right
pos -= llen
end
end
_cache_start = st - pos
- _cache_end = st - pos + s.bytelen - 1
+ _cache_end = st - pos + s.byte_length - 1
_cache = s
return s
end
# Init the iterator from a RopeBuffer starting from `pos`.
init from(t: RopeBuffer, pos: Int) do
ns = t.ns
- maxpos = t._bytelen
+ maxpos = t._byte_length
sit = t.str.bytes.iterator_from(pos)
pns = pos - t.str.length
index = pos
# Init the iterator from a RopeBuffer starting from `pos`.
init from(tgt: RopeBuffer, pos: Int) do
sit = tgt.str.bytes.reverse_iterator_from(pos - (tgt.rpos - tgt.dumped))
- pns = pos - tgt.str.bytelen + tgt.rpos
+ pns = pos - tgt.str.byte_length + tgt.rpos
index = pos
ns = tgt.ns
end
redef type SELFTYPE: RopeBuffer
redef fun [](i) do
- if i < target.str.bytelen then
+ if i < target.str.byte_length then
return target.str.bytes[i]
else
- return target.ns[i - target.str.bytelen]
+ return target.ns[i - target.str.byte_length]
end
end
private fun escape_to_csv(sep_char, delim_char: Char, eol: String): String do
var add_sp = chars_to_escape_csv(sep_char, delim_char, eol)
if add_sp == 0 then return to_s
- var bf = new Buffer.with_cap(add_sp + bytelen)
+ var bf = new Buffer.with_cap(add_sp + byte_length)
bf.add '"'
for i in [0 .. length[ do
var c = self[i]
private fun unescape_csv(delim_char: Char): String do
var to_un = chars_to_unescape_csv(delim_char)
if to_un == 0 then return to_s
- var buf = new Buffer.with_cap(bytelen - to_un)
+ var buf = new Buffer.with_cap(byte_length - to_un)
var pos = 0
var ln = length
while pos < ln do
# ~~~
module collections
-import base
+import ffi_support
# Java primitive array
#
# See the License for the specific language governing permissions and
# limitations under the License.
-# Supporting services for the FFI with Java
+# Core supporting services for the FFI with Java
#
-# This modules relies on `Sys::jvm`, `Sys::jni_env` and
-# `Sys::create_default_jvm` to get a handle on a JVM. You can adapt the
-# behavior of the FFI and services in this module by redefing
-# `Sys::create_default_jvm` and supply your own JVM object. You can manage
-# multiple java thread by switching the current environment in a redef
-# of `Sys::jni_env`, and multiple JVM using `Sys::jvm`.
-module base is
+# This module *must* be imported by modules using the Java FFI.
+# Some might prefer to import the whole `java` package as it provides
+# other useful services.
+module ffi_support is
cflags "-I $(JAVA_HOME)/include/ -I $(JAVA_HOME)/include/linux/"
ldflags "-L $(JNI_LIB_PATH) -ljvm"
new_annotation extra_java_files
assert jvm != null else print "JVM creation failed"
self.jvm = jvm
- self.jni_env = builder.jni_env.as(not null)
+ assert not jvm.address_is_null
+ self.jni_env = jvm.env
+ assert not jni_env.address_is_null
end
# Get a Java class by its name from the current `jni_env`
# This module is used by `android::assets_and_resources` and `android::audio`.
module io
-import base
+import ffi_support
in "Java" `{
import java.io.File;
# See the License for the specific language governing permissions and
# limitations under the License.
-# Supporting services for the FFI with Java
+# Supporting services for the FFI with Java and to access Java libraries
#
# This modules relies on `Sys::jvm`, `Sys::jni_env` and
# `Sys::create_default_jvm` to get a handle on a JVM. You can adapt the
# multiple java thread by switching the current environment in a redef
# of `Sys::jni_env`, and multiple JVM using `Sys::jvm`.
#
-# The module `jvm` gives more control over the JVM instances and wraps
-# most of JNI functions. You can use it to further customize the behavior
-# of your code.
+# See also, the module `jvm` to control the JVM instances and access JNI functions.
+# You can use it to further customize the behavior of your code.
module java
-import base
+import ffi_support
import collections
# assert "\\nEscape\\t\\n".json_to_nit_string == "\nEscape\t\n"
# assert "\\u0041zu\\uD800\\uDFD3".json_to_nit_string == "Azu𐏓"
protected fun json_to_nit_string: String do
- var res = new FlatBuffer.with_capacity(bytelen)
+ var res = new FlatBuffer.with_capacity(byte_length)
var i = 0
var ln = self.length
while i < ln do
# "\"\\t\\\"http://example.com\\\"\\r\\n\\u0000\\\\\""
# ~~~
redef fun to_json do
- var b = new FlatBuffer.with_capacity(bytelen)
+ var b = new FlatBuffer.with_capacity(byte_length)
append_json(b)
return b.to_s
end
# See the License for the specific language governing permissions and
# limitations under the License.
-# Java Virtual Machine services
+# Java Virtual Machine invocation API and others services from the JNI C API
+#
+# Users of this module and the Java FFI, on desktop computers, must define three environment variables:
+# * `JAVA_HOME` points to the installation folder of the target Java VM.
+# This folder should contain the JNI header file `include/jni.h`.
+# e.g. `/usr/lib/jvm/default-java` on Debian Jessie.
+# * `JNI_LIB_PATH` points to the folder with `libjvm.so`.
+# e.g. `/usr/lib/jvm/default-java/jre/lib/amd64/server/` on Debian Jessie.
+# * `LD_LIBRARY_PATH` has the path to the folder with `libjvm.so`.
+# It's the same value as `JNI_LIB_PATH` but `LD_LIBRARY_PATH` is a colon separated list
+# which may contain other paths.
#
# See: http://docs.oracle.com/javase/1.5.0/docs/guide/jni/spec/jniTOC.html
module jvm is
# var env = builder.jni_env
# ~~~~
class JavaVMBuilder
- super JniEnvRef
# Version code of the JVM requested by `create_jvm`
#
- # Default at 0x00010002
+ # Default at 0x00010002 for `JNI_VERSION_1_2`.
var version = 0x00010002 is writable
# Additional option strings
var options = new Array[String]
- # Create the JVM and return it on success
+ # Create a JVM instance, or return `null` on error
fun create_jvm: nullable JavaVM
do
var args = new JavaVMInitArgs
args.options = c_options
- var jvm = new JavaVM(args, self)
+ var jvm = new JavaVM(args)
args.free
c_options.free
# Represents a jni JavaVM
extern class JavaVM `{JavaVM *`}
- # Create the JVM, returns its handle and store the a pointer to JniEnv in `env_ref`
+ # Create the JVM
#
- # Unavailable on Android, where you cannot instanciate a new JVM.
- private new(args: JavaVMInitArgs, env_ref: JniEnvRef)
- import jni_error, JniEnvRef.jni_env=, JniEnv.as nullable `{
+ # The corresponding `JniEnv` can be obtained by calling `env`.
+ #
+ # Unavailable on some platforms, including Android where you cannot instanciate a new JVM.
+ private new(args: JavaVMInitArgs) import jni_error `{
#ifdef ANDROID
JavaVM_jni_error(NULL, "JVM creation not supported on Android", 0);
res = JNI_CreateJavaVM(&jvm, (void**)&env, args);
- if (res != 0) {
+ if (res != JNI_OK) {
JavaVM_jni_error(NULL, "Could not create Java VM", res);
return NULL;
}
- else {
- JniEnvRef_jni_env__assign(env_ref, JniEnv_as_nullable_JniEnv(env));
- return jvm;
- }
+
+ return jvm;
`}
private fun jni_error(msg: NativeString, v: Int)
abort
end
+ # Unload the Java VM when the calling thread is the only remaining non-daemon attached user thread
fun destroy `{
(*self)->DestroyJavaVM(self);
`}
+ # `JniEnv` attached to the calling thread
+ #
+ # A null pointer is returned if the calling thread is not attached to the JVM.
fun env: JniEnv import jni_error `{
JNIEnv *env;
int res = (*self)->GetEnv(self, (void **)&env, JNI_VERSION_1_6);
- if (res != JNI_OK) {
+ if (res == JNI_EDETACHED) {
+ JavaVM_jni_error(NULL, "Requesting JNIEnv from an unattached thread", res);
+ return NULL;
+ }
+ else if (res != JNI_OK) {
JavaVM_jni_error(NULL, "Could not get JNIEnv from Java VM", res);
return NULL;
}
return env;
`}
+ # Attach the calling thread to the JVM and return its `JniEnv`
fun attach_current_thread: JniEnv import jni_error `{
JNIEnv *env;
#ifdef ANDROID
`}
end
-# used to initialize a JavaVM
-class JniEnvRef
- var jni_env: nullable JniEnv = null
-end
-
# Represents a jni jclass
extern class JClass `{jclass`}
end
redef fun close
do
if closed then return
- var success = native_buffer_event.destroy
- close_requested = true
- closed = success
+
+ var i = native_buffer_event.input_buffer
+ var o = native_buffer_event.output_buffer
+ if i.length > 0 or o.length > 0 then
+ close_requested = true
+ else
+ force_close
+ end
+ end
+
+ # Force closing this connection and freeing `native_buffer_event`
+ fun force_close
+ do
+ if closed then return
+
+ native_buffer_event.free
+ closed = true
end
# Callback method on a write event
fun event_callback(events: Int): Bool
do
if events & bev_event_error != 0 or events & bev_event_eof != 0 then
- if events & bev_event_error != 0 then print_error "Error from bufferevent"
- close
+ if events & bev_event_error != 0 then
+ var sock_err = evutil_socket_error
+ # Ignore some normal errors and print the others for debugging
+ if sock_err == 110 then
+ # Connection timed out (ETIMEDOUT)
+ else if sock_err == 104 then
+ # Connection reset by peer (ECONNRESET)
+ else
+ print_error "libevent error event: {evutil_socket_error_to_string(sock_err)} ({sock_err})"
+ end
+ end
+ force_close
return true
end
redef fun write(str)
do
if close_requested then return
- native_buffer_event.write(str.to_cstring, str.bytelen)
+ native_buffer_event.write(str.to_cstring, str.byte_length)
end
redef fun write_byte(byte)
# connect operation finished.
fun bev_event_connected: Int `{ return BEV_EVENT_CONNECTED; `}
+# Global error code for the last socket operation on the calling thread
+#
+# Not idempotent on all platforms.
+fun evutil_socket_error: Int `{
+ return EVUTIL_SOCKET_ERROR();
+`}
+
+# Convert an error code from `evutil_socket_error` to a string
+fun evutil_socket_error_to_string(error_code: Int): NativeString `{
+ return evutil_socket_error_to_string(error_code);
+`}
+
# ---
# Options that can be specified when creating a `NativeBufferEvent`
return bufferevent_write(self, &byt, 1);
`}
- # Check if we have anything left in our buffers. If so, we set our connection to be closed
- # on a callback. Otherwise we close it and free it right away.
- fun destroy: Bool `{
- struct evbuffer* out = bufferevent_get_output(self);
- struct evbuffer* in = bufferevent_get_input(self);
- if(evbuffer_get_length(in) > 0 || evbuffer_get_length(out) > 0) {
- return 0;
- } else {
- bufferevent_free(self);
- return 1;
- }
- `}
+ redef fun free `{ bufferevent_free(self); `}
# The output buffer associated to `self`
fun output_buffer: OutputNativeEvBuffer `{ return bufferevent_get_output(self); `}
# Callback method on listening error
fun error_callback do
- var cstr = socket_error
- sys.stderr.write "libevent error: '{cstr}'"
+ var cstr = evutil_socket_error_to_string(evutil_socket_error)
+ print_error "libevent error: '{cstr}'"
end
-
- # Error with sockets
- fun socket_error: NativeString `{
- // TODO move to Nit and maybe NativeEventBase
- int err = EVUTIL_SOCKET_ERROR();
- return evutil_socket_error_to_string(err);
- `}
end
# Factory to listen on sockets and create new `Connection`
-NITC=../../bin/nitc
+NITC=nitc
all: nitmd
# Set the content length if not already set
if not header.keys.has("Content-Length") then
# Size of the body
- var len = body.bytelen
+ var len = body.byte_length
# Size of included files
for path in files do
# See the License for the specific language governing permissions and
# limitations under the License.
-NITUNIT=../../bin/nitunit
+NITUNIT=nitunit
+
+all:
check:
$(NITUNIT) .
redef class FlatString
redef fun internal_to_dot: String
do
- return "n{object_id} [label=\"FlatString\\nlength = {length}\\nbytelen = {bytelen}\\nfirst_byte = {first_byte}\\nlast_byte = {last_byte}\\nText = {self.escape_to_dot}\"];\n"
+ return "n{object_id} [label=\"FlatString\\nlength = {length}\\nbyte_length = {byte_length}\\nfirst_byte = {first_byte}\\nlast_byte = {last_byte}\\nText = {self.escape_to_dot}\"];\n"
end
end
redef class FlatBuffer
redef fun internal_to_dot: String
do
- return "n{object_id} [label=\"FlatBuffer\\nbytelen = {bytelen}\\nlength = {length}\\ncapacity = {capacity}\\nText = {escape_to_dot}\"];\n"
+ return "n{object_id} [label=\"FlatBuffer\\nbyte_length = {byte_length}\\nlength = {length}\\ncapacity = {capacity}\\nText = {escape_to_dot}\"];\n"
end
end
# import base64
# assert "The quick brown fox jumps over the lazy dog".sha1 == [0x2Fu8, 0xD4u8, 0xE1u8, 0xC6u8, 0x7Au8, 0x2Du8, 0x28u8, 0xFCu8, 0xEDu8, 0x84u8, 0x9Eu8, 0xE1u8, 0xBBu8, 0x76u8, 0xE7u8, 0x39u8, 0x1Bu8, 0x93u8, 0xEBu8, 0x12u8]
fun sha1: Bytes do
- return new Bytes(to_cstring.sha1_intern(bytelen), 20, 20)
+ return new Bytes(to_cstring.sha1_intern(byte_length), 20, 20)
end
# Computes the SHA1 of the receiver.
var index_len = new Counter[Int]
# Length (bytes) of the FlatString created by lib
- var str_bytelen = new Counter[Int]
+ var str_byte_length = new Counter[Int]
- # Counter of the times `bytelen` is called on FlatString
- var bytelen_call = new Counter[String]
+ # Counter of the times `byte_length` is called on FlatString
+ var byte_length_call = new Counter[String]
# Counter of the times `bytepos` is called on each type of receiver
var position_call = new Counter[String]
printn "\n"
end
- print "Calls to bytelen for each type:"
- for k, v in bytelen_call do
+ print "Calls to byte_length for each type:"
+ for k, v in byte_length_call do
print "\t{k} = {v}"
end
index_len.print_content
print "Byte length of the FlatStrings created:"
- str_bytelen.print_content
+ str_byte_length.print_content
end
redef fun run do
sys.concat_allocations += 1
end
- redef fun bytelen do
- sys.bytelen_call.inc "Concat"
+ redef fun byte_length do
+ sys.byte_length_call.inc "Concat"
return super
end
sys.ropebuf_allocations += 1
end
- redef fun bytelen do
- sys.bytelen_call.inc "RopeBuffer"
+ redef fun byte_length do
+ sys.byte_length_call.inc "RopeBuffer"
return super
end
super
end
- redef fun bytelen do
- sys.bytelen_call.inc "FlatBuffer"
+ redef fun byte_length do
+ sys.byte_length_call.inc "FlatBuffer"
return super
end
super
end
- redef fun bytelen do
- sys.bytelen_call.inc "FlatString"
+ redef fun byte_length do
+ sys.byte_length_call.inc "FlatString"
return super
end
var l = length_cache
if l != null then return l
sys.length_cache_miss.inc "FlatString"
- if bytelen == 0 then return 0
+ if byte_length == 0 then return 0
var st = first_byte
var its = items
var ln = 0
end
redef class ASCIIFlatString
- redef init full_data(items, bytelen, from, length)
+ redef init full_data(items, byte_length, from, length)
do
super
sys.asciiflatstr_allocations += 1
end
redef class UnicodeFlatString
- redef init full_data(items, bytelen, from, length)
+ redef init full_data(items, byte_length, from, length)
do
super
sys.uniflatstr_allocations += 1
It is expected that the created/updated files are checked since the tests are considered passed.
A VCS like `git` is often a good tool to check the creation and modification of those files.
+### `--no-time`
+Disable time information in XML.
+
+This is used to have reproducible XML results.
+
+This option is automatically activated if `NIT_TESTING` is set.
+
## SUITE GENERATION
### `--gen-suite`
var native_mtype = mmodule.native_string_type
var nat = self.new_var(native_mtype)
self.add("{nat} = \"{string.escape_to_c}\";")
- var bytelen = self.int_instance(string.bytelen)
+ var byte_length = self.int_instance(string.byte_length)
var unilen = self.int_instance(string.length)
- self.add("{res} = {self.send(self.get_property("to_s_full", native_mtype), [nat, bytelen, unilen]).as(not null)};")
+ self.add("{res} = {self.send(self.get_property("to_s_full", native_mtype), [nat, byte_length, unilen]).as(not null)};")
self.add("{name} = {res};")
self.add("\}")
return res
--- /dev/null
+# This file is part of NIT ( http://www.nitlanguage.org ).
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# This is an example of a client of the frontend without command-line processing.
+#
+# It offers a simple nitcorn web server that offers a textarea and nitpick and nitlignt it.
+module nitlight_as_a_service
+
+import frontend
+import highlight
+import nitcorn
+import nitcorn::log
+
+# Fully process a content as a nit source file.
+fun hightlightcode(hl: HighlightVisitor, content: String): SourceFile
+do
+ # Prepare a stand-alone tool context
+ var tc = new ToolContext
+ tc.nit_dir = tc.locate_nit_dir # still use the common lib to have core
+ tc.keep_going = true # no exit, obviously
+ tc.opt_warn.value = -1 # no output, obviously
+
+ # Prepare an stand-alone model and model builder.
+ # Unfortunately, models are enclosing and append-only.
+ # There is no way (yet?) to have a shared module `core` with
+ # isolated and throwable user modules.
+ var model = new Model
+ var mb = new ModelBuilder(model, tc)
+
+ # Parse the code
+ var source = new SourceFile.from_string("", content)
+ var lexer = new Lexer(source)
+ var parser = new Parser(lexer)
+ var tree = parser.parse
+
+ # Check syntax error
+ var eof = tree.n_eof
+ if eof isa AError then
+ mb.error(eof, eof.message)
+ hl.hightlight_source(source)
+ return source
+ end
+ var amodule = tree.n_base.as(not null)
+
+ # Load the AST as a module in the model
+ # Then process it
+ mb.load_rt_module(null, amodule, "")
+ mb.run_phases
+
+ # Highlight the processed module
+ hl.enter_visit(amodule)
+ return source
+end
+
+# Nitcorn service to hightlight code
+#
+# It's a single stand-alone page that has to form to itself.
+class HighlightAction
+ super Action
+
+ redef fun answer(http_request, turi)
+ do
+ var code = http_request.post_args.get_or_null("code")
+
+ var hl = new HighlightVisitor
+ var page = "<doctype html><html><head>{hl.head_content}<style>{hl.css_content} textarea \{width:100%;\}</style></head><body>"
+ # Add the form+textarea
+ page += """
+ <form action="#light" method=post><textarea name=code rows=10>{{{code or else ""}}}</textarea><br><input type=submit></form>
+ """
+
+ if code != null then
+ # There is code? Process it
+ var source = hightlightcode(hl, code)
+
+ # Inject highlight
+ page += "<pre id=light><code>"
+ page += hl.html.write_to_string
+ page += "</code></pre><hr>"
+ page += "<ul>"
+
+ # List messages
+ for m in source.messages do
+ page += "<li>{m.location.as(not null)}: {m.text}</li>"
+ end
+ page += "</ul>"
+ end
+
+ page += hl.foot_content
+
+ var response = new HttpResponse(200)
+ response.header["Content-Type"] = "text/html"
+ response.body = page
+ return response
+ end
+end
+
+var host = "localhost:8080"
+if args.length > 0 then host = args.first
+
+var vh = new VirtualHost(host)
+vh.routes.add new Route("/", new HighlightAction)
+var factory = new HttpFactory.and_libevent
+factory.config.virtual_hosts.add vh
+factory.run
# The last line to generate, null if finish at the last line
var last_line: nullable Int = null is writable
+ # When highlighting a node, show its messages (errors, warnings), if any.
+ #
+ # default: true
+ var show_messages = true is writable
+
+ # When highlighting a node, attach a full popupable infobox, if any.
+ #
+ # If `false`, only a simple `title` tooltip is used.
+ #
+ # default: true
+ var show_infobox = true is writable
+
+ # A reference to an entity used in generated `<a>` elements.
+ #
+ # It is used to refer to some specific entities when generating links.
+ # If `null` is returned, then no link are generated and `<a>` elements become `<span>`.
+ #
+ # By default, `null` is returned.
+ # Clients are therefore encouraged to redefine the method in a subclass to control where entities should link to.
+ fun hrefto(entitiy: MEntity): nullable String do return null
+
init
do
html.add_class("nitcode")
if infobox == null and anode isa Token then
var pa = anode.parent
if pa != null then
- var c = anode
- if c isa TId or c isa TClassid or c isa TAttrid or c isa TokenLiteral or c isa TokenOperator or c isa TComment and pa isa ADoc then
- infobox = pa.decorate_tag(hv, tag, anode)
- end
+ infobox = pa.decorate_tag(hv, tag, anode)
end
end
+ if infobox != null and not show_infobox then
+ tag.attr("title", infobox.title)
+ tag.classes.add "titled"
+ infobox = null
+ end
var messages = anode.location.messages
- if messages != null then
+ if messages != null and show_messages then
tag.css("border-bottom", "solid 2px red")
if infobox == null then
infobox = new HInfoBox(hv, "Messages")
return tag
end
+ # Highlight a full lexed source file.
+ #
+ # REQUIRE `source.first_token != null`
+ fun hightlight_source(source: SourceFile)
+ do
+ htmlize(source.first_token.as(not null), null)
+ end
+
# Produce HTML between two tokens
- protected fun htmlize(first_token, last_token: Token)
+ protected fun htmlize(first_token: Token, last_token: nullable Token)
do
var stack2 = new Array[HTMLTag]
var stack = new Array[Prod]
var line = 0
var c: nullable Token = first_token
- var hv = new HighlightVisitor
+ var hv = self
while c != null do
var starting
do
return """
.nitcode a { color: inherit; cursor:pointer; }
+.nitcode .titled:hover { text-decoration: underline; } /* underline titles */
.nitcode .popupable:hover { text-decoration: underline; cursor:help; } /* underline titles */
.nitcode .foldable { display: block } /* for block productions*/
.nitcode .line{ display: block } /* for lines */
interface HInfoBoxable
# An new infobox documenting the entity
fun infobox(v: HighlightVisitor): HInfoBox is abstract
-
- # A human-readable hyper-text for the entity
- fun linkto: HTMLTag is abstract
end
redef class MDoc
redef class MEntity
super HInfoBoxable
+
+ # A HTML version of `to_s` with hyper-links.
+ #
+ # By default, `linkto_text(v, to_s)` is used, c.f. see `linkto_text`.
+ #
+ # For some complex entities, like generic types, multiple `<a>` and `<span>` elements can be generated.
+ # E.g. `Array[Int]` might become `<a>Array</a>[<a>Int</a>]` with the correct `href` attributes
+ # provided by `v.hrefto`.
+ fun linkto(v: HighlightVisitor): HTMLTag do return linkto_text(v, to_s)
+
+ # Link to the `self` with a specific text.
+ #
+ # The whole text is linked with a single `<a>` element.
+ #
+ # The `href` used is provided by `v.hrefto`.
+ # If `href` is null then a `<span>` element is used instead of `<a>`.
+ fun linkto_text(v: HighlightVisitor, text: String): HTMLTag
+ do
+ var href = v.hrefto(self)
+ if href == null then
+ return (new HTMLTag("span")).text(text)
+ end
+ return (new HTMLTag("a")).attr("href", href).text(text)
+ end
end
redef class MModule
redef fun infobox(v)
do
var res = new HInfoBox(v, "module {name}")
- res.href = href
- res.new_field("module").add(linkto)
+ res.href = v.hrefto(self)
+ res.new_field("module").add(linkto(v))
var mdoc = self.mdoc
if mdoc != null then mdoc.fill_infobox(res)
if in_importation.greaters.length > 1 then
var c = res.new_dropdown("imports", "{in_importation.greaters.length-1} modules")
for x in in_importation.greaters do
if x == self then continue
- c.open("li").add x.linkto
+ c.open("li").add x.linkto(v)
end
end
return res
end
- # The module HTML page
- fun href: String
- do
- return c_name + ".html"
- end
-
- redef fun linkto do return linkto_text(name)
-
- # Link to the entitiy with a specific text
- fun linkto_text(text: String): HTMLTag
- do
- return (new HTMLTag("a")).attr("href", href).text(text)
- end
+ redef fun linkto(v) do return linkto_text(v, name)
end
redef class MClassDef
redef fun infobox(v)
do
var res = new HInfoBox(v, "class {mclass.name}")
- res.href = href
+ res.href = v.hrefto(self)
if is_intro then
res.new_field("class").text(mclass.name)
else
res.new_field("redef class").text(mclass.name)
- res.new_field("intro").add mclass.intro.linkto_text("in {mclass.intro_mmodule.to_s}")
+ res.new_field("intro").add mclass.intro.linkto_text(v, "in {mclass.intro_mmodule.to_s}")
end
var mdoc = self.mdoc
if mdoc == null then mdoc = mclass.intro.mdoc
for x in in_hierarchy.greaters do
if x == self then continue
if not x.is_intro then continue
- c.open("li").add x.linkto
+ c.open("li").add x.linkto(v)
end
end
if in_hierarchy.smallers.length > 1 then
for x in in_hierarchy.smallers do
if x == self then continue
if not x.is_intro then continue
- c.open("li").add x.linkto
+ c.open("li").add x.linkto(v)
end
end
if mclass.mclassdefs.length > 1 then
var c = res.new_dropdown("redefs", "refinements")
for x in mclass.mclassdefs do
if x == self then continue
- c.open("li").add x.linkto_text("in {x.mmodule}")
+ c.open("li").add x.linkto_text(v, "in {x.mmodule}")
end
end
return res
end
-
- # The class HTML page (an anchor in the module page)
- fun href: String
- do
- return mmodule.href + "#" + to_s
- end
-
- redef fun linkto do return linkto_text(mclass.name)
-
- # Link to the entitiy with a specific text
- fun linkto_text(text: String): HTMLTag
- do
- return (new HTMLTag("a")).attr("href", href).text(text)
- end
end
redef class MPropDef
redef fun infobox(v)
do
var res = new HInfoBox(v, to_s)
- res.href = href
+ res.href = v.hrefto(self)
if self isa MMethodDef then
- if msignature != null then res.new_field("fun").append(mproperty.name).add msignature.linkto
+ if msignature != null then res.new_field("fun").append(mproperty.name).add msignature.linkto(v)
else if self isa MAttributeDef then
- if static_mtype != null then res.new_field("fun").append(mproperty.name).add static_mtype.linkto
+ if static_mtype != null then res.new_field("fun").append(mproperty.name).add static_mtype.linkto(v)
else if self isa MVirtualTypeDef then
- if bound != null then res.new_field("add").append(mproperty.name).add bound.linkto
+ if bound != null then res.new_field("add").append(mproperty.name).add bound.linkto(v)
else
res.new_field("wat?").append(mproperty.name)
end
if is_intro then
else
- res.new_field("intro").add mproperty.intro.linkto_text("in {mproperty.intro.mclassdef}")
+ res.new_field("intro").add mproperty.intro.linkto_text(v, "in {mproperty.intro.mclassdef}")
end
var mdoc = self.mdoc
if mdoc == null then mdoc = mproperty.intro.mdoc
if mproperty.mpropdefs.length > 1 then
var c = res.new_dropdown("redef", "redefinitions")
for x in mproperty.mpropdefs do
- c.open("li").add x.linkto_text("in {x.mclassdef}")
+ c.open("li").add x.linkto_text(v, "in {x.mclassdef}")
end
end
return res
end
-
- # The property HTML page (an anchor in the module page)
- fun href: String
- do
- return self.mclassdef.mmodule.href + "#" + self.to_s
- end
-
- redef fun linkto do return linkto_text(mproperty.name)
-
- # Link to the entitiy with a specific text
- fun linkto_text(text: String): HTMLTag
- do
- return (new HTMLTag("a")).attr("href", href).text(text)
- end
end
redef class MClassType
redef fun infobox(v)
do
var res = new HInfoBox(v, to_s)
- res.href = mclass.intro.href
- res.new_field("class").add mclass.intro.linkto
+ res.href = v.hrefto(self)
+ res.new_field("class").add mclass.intro.linkto(v)
var mdoc = mclass.mdoc
if mdoc == null then mdoc = mclass.intro.mdoc
if mdoc != null then mdoc.fill_infobox(res)
return res
end
- redef fun linkto
+ redef fun linkto(v)
do
- return mclass.intro.linkto
+ return mclass.intro.linkto(v)
end
end
redef class MVirtualType
redef fun infobox(v)
do
var res = new HInfoBox(v, to_s)
- res.href = mproperty.intro.href
+ res.href = v.hrefto(mproperty)
var p = mproperty
var pd = p.intro
- res.new_field("virtual type").add pd.linkto
+ res.new_field("virtual type").add pd.linkto(v)
var mdoc = pd.mdoc
if mdoc != null then mdoc.fill_infobox(res)
return res
end
- redef fun linkto
+ redef fun linkto(v)
do
- return mproperty.intro.linkto
+ return mproperty.intro.linkto(v)
end
end
redef class MParameterType
redef fun infobox(v)
do
var res = new HInfoBox(v, to_s)
- res.new_field("parameter type").append("{name} from class ").add mclass.intro.linkto
+ res.new_field("parameter type").append("{name} from class ").add mclass.intro.linkto(v)
return res
end
- redef fun linkto
- do
- return (new HTMLTag("span")).text(name)
- end
end
redef class MNullableType
do
return mtype.infobox(v)
end
- redef fun linkto
+ redef fun linkto(v)
do
var res = new HTMLTag("span")
- res.append("nullable ").add(mtype.linkto)
+ res.append("nullable ").add(mtype.linkto(v))
return res
end
end
do
return mtype.infobox(v)
end
- redef fun linkto
+ redef fun linkto(v)
do
var res = new HTMLTag("span")
- res.append("not null ").add(mtype.linkto)
+ res.append("not null ").add(mtype.linkto(v))
return res
end
end
var res = new HInfoBox(v, to_s)
return res
end
- redef fun linkto
+ redef fun linkto(v)
do
var res = new HTMLTag("span")
res.append("null")
end
redef class MSignature
- redef fun linkto
+ redef fun linkto(v)
do
var res = new HTMLTag("span")
var first = true
end
res.append p.name
res.append ": "
- res.add p.mtype.linkto
+ res.add p.mtype.linkto(v)
end
res.append ")"
end
var ret = return_mtype
if ret != null then
res.append ": "
- res.add ret.linkto
+ res.add ret.linkto(v)
end
return res
end
redef fun infobox(v)
do
var res = new HInfoBox(v, "call {mpropdef}")
- res.href = mpropdef.href
- res.new_field("call").add(mpropdef.linkto).add(msignature.linkto)
+ res.href = v.hrefto(mpropdef)
+ res.new_field("call").add(mpropdef.linkto(v)).add(msignature.linkto(v))
if mpropdef.is_intro then
else
- res.new_field("intro").add mproperty.intro.linkto_text("in {mproperty.intro.mclassdef}")
+ res.new_field("intro").add mproperty.intro.linkto_text(v, "in {mproperty.intro.mclassdef}")
end
var mdoc = mpropdef.mdoc
if mdoc == null then mdoc = mproperty.intro.mdoc
return res
end
- redef fun linkto
+ redef fun linkto(v)
do
- return mpropdef.linkto
+ return mpropdef.linkto(v)
end
end
return res
end
var res = new HInfoBox(v, "{name}: {declared_type}")
- res.new_field("local var").append("{name}:").add(declared_type.linkto)
+ res.new_field("local var").append("{name}:").add(declared_type.linkto(v))
return res
end
- redef fun linkto
- do
- return (new HTMLTag("span")).text(name)
- end
end
fun infobox(v: HighlightVisitor): nullable HInfoBox do return null
end
+redef class AQclassid
+ redef fun decorate_tag(v, res, token)
+ do
+ if token != n_id then return null
+ return parent.decorate_tag(v, res, token)
+ end
+end
+
+redef class AQid
+ redef fun decorate_tag(v, res, token)
+ do
+ if token != n_id then return null
+ return parent.decorate_tag(v, res, token)
+ end
+end
+
redef class AStdClassdef
redef fun make_tag(v)
do
redef fun make_tag(v)
do
var res = super
- var p = parent
- if p != null then p.decorate_tag(v, res, self)
res.add_class("nc_o")
return res
end
redef class AVarFormExpr
redef fun decorate_tag(v, res, token)
do
+ if token != n_id then return null
var variable = self.variable
if variable == null then return null
res.add_class("nc_v")
redef class AVardeclExpr
redef fun decorate_tag(v, res, token)
do
+ if token != n_id then return null
var variable = self.variable
if variable == null then return null
res.add_class("nc_v")
redef class AParam
redef fun decorate_tag(v, res, token)
do
+ if token != n_id then return null
var mp = mparameter
if mp == null then return null
var variable = self.variable
redef class AAssertExpr
redef fun decorate_tag(v, res, token)
do
+ if not token isa TId then return null
res.add_class("nc_ast")
return null
end
redef class ALabel
redef fun decorate_tag(v, res, token)
do
+ if not token isa TId then return null
res.add_class("nc_la")
return null
end
redef class AModuledecl
redef fun decorate_tag(v, res, token)
do
+ if not token isa TId then return null
res.add_class("nc_def")
res.add_class("nc_m")
var p = parent
redef class AStdImport
redef fun decorate_tag(v, res, token)
do
+ if not token isa TId then return null
res.add_class("nc_m")
var mm = mmodule
if mm == null then return null
redef class AAttrPropdef
redef fun decorate_tag(v, res, token)
do
+ if not token isa TId then return null
res.add_class("nc_def")
var mpd: nullable MPropDef
mpd = mreadpropdef
redef fun make_tag(v)
do
var res = super
- var p = parent
- if p != null then p.decorate_tag(v, res, self)
res.add_class("nc_i")
return res
end
redef fun make_tag(v)
do
var res = super
- var p = parent
- if p != null then p.decorate_tag(v, res, self)
res.add_class("nc_a")
return res
end
redef class AAttrFormExpr
redef fun decorate_tag(v, res, token)
do
+ if not token isa TAttrid then return null
var p = mproperty
if p == null then return null
return p.intro.infobox(v)
redef fun make_tag(v)
do
var res = super
- var p = parent
- if p != null then p.decorate_tag(v, res, self)
res.add_class("nc_t")
return res
end
redef class AType
redef fun decorate_tag(v, res, token)
do
+ if not token isa TClassid then return null
var mt = mtype
if mt == null then return null
mt = mt.undecorate
redef class AFormaldef
redef fun decorate_tag(v, res, token)
do
+ if not token isa TClassid then return null
res.add_class("nc_vt")
if mtype == null then return null
return mtype.infobox(v)
redef class ATypePropdef
redef fun decorate_tag(v, res, token)
do
+ if not token isa TClassid then return null
res.add_class("nc_def")
var md = mpropdef
if md == null then return null
do
var res = super
res.add_class("nc_l")
- var p = parent
- if p != null then p.decorate_tag(v, res, self)
return res
end
end
# Workaround to tag strings
res.classes.remove("nc_l")
res.add_class("nc_s")
- return null
+ return super
end
end
redef class AExpr
# Return a new native string initialized with `txt`
fun native_string_instance(txt: String): Instance
do
- var instance = native_string_instance_len(txt.bytelen+1)
+ var instance = native_string_instance_len(txt.byte_length+1)
var val = instance.val
- val[txt.bytelen] = 0u8
- txt.to_cstring.copy_to(val, txt.bytelen, 0, 0)
+ val[txt.byte_length] = 0u8
+ txt.to_cstring.copy_to(val, txt.byte_length, 0, 0)
return instance
end
fun string_instance(txt: String): Instance
do
var nat = native_string_instance(txt)
- var res = self.send(self.force_get_primitive_method("to_s_full", nat.mtype), [nat, self.int_instance(txt.bytelen), self.int_instance(txt.length)])
+ var res = self.send(self.force_get_primitive_method("to_s_full", nat.mtype), [nat, self.int_instance(txt.byte_length), self.int_instance(txt.length)])
assert res != null
return res
end
end
var nit_dir = toolcontext.nit_dir
- var libname = nit_dir/"lib"
- if libname.file_exists then paths.add(libname)
- libname = nit_dir/"contrib"
- if libname.file_exists then paths.add(libname)
+ if nit_dir != null then
+ var libname = nit_dir/"lib"
+ if libname.file_exists then paths.add(libname)
+ libname = nit_dir/"contrib"
+ if libname.file_exists then paths.add(libname)
+ end
end
# Load a bunch of modules.
super MEntity
# The module that introduce the class
+ #
# While classes are not bound to a specific module,
- # the introducing module is used for naming an visibility
+ # the introducing module is used for naming and visibility.
var intro_mmodule: MModule
# The short name of the class
import highlight
+class NitlightVisitor
+ super HighlightVisitor
+
+ # The current highlight module
+ #
+ # It is used to know when to use anchored local links
+ var current_module: MModule
+
+ # List of all highlighted modules
+ #
+ # It is used to have links that only targets highlighted entities
+ #
+ # Entities outside these modules will not be linked.
+ var mmodules: Collection[MModule]
+
+ redef fun hrefto(entitiy) do return entitiy.href(self)
+end
+
+redef class MEntity
+ private fun href(v: NitlightVisitor): nullable String do return null
+end
+
+redef class MModule
+ redef fun href(v)
+ do
+ if self == v.current_module then return ""
+ if not v.mmodules.has(self) then return null
+ return c_name + ".html"
+ end
+end
+
+redef class MClass
+ redef fun href(v)
+ do
+ # Because we only have code, just link to the introduction
+ return intro.href(v)
+ end
+end
+
+redef class MClassDef
+ redef fun href(v)
+ do
+ var m = mmodule.href(v)
+ if m == null then return null
+ return m + "#" + to_s
+ end
+end
+
+redef class MProperty
+ redef fun href(v)
+ do
+ # Because we only have code, just link to the introduction
+ return intro.href(v)
+ end
+end
+
+redef class MPropDef
+ redef fun href(v)
+ do
+ var m = mclassdef.mmodule.href(v)
+ if m == null then return null
+ return m + "#" + to_s
+ end
+end
+
var toolcontext = new ToolContext
# Try to colorize, even if programs are non valid
for mm in mmodules do
if dir != null then toolcontext.info("write {dir}/{mm.c_name}.html", 1)
- var v = new HighlightVisitor
+ var v = new NitlightVisitor(mm, mmodules)
var prefix = opt_line_id_prefix.value
if prefix != null then
v.line_id_prefix = prefix.trim
exit(0)
end
+# When testing `nitunit`, disable time.
+if "NIT_TESTING".environ != "" then
+ toolcontext.opt_no_time.value = true
+end
+
"NIT_TESTING".setenv("true")
"NIT_TESTING_ID".setenv(pid.to_s)
"SRAND".setenv("0")
import highlight
import test_phase
+class TestHighlightVisitor
+ super HighlightVisitor
+ redef fun hrefto(e) do
+ return "#" + e.c_name
+ end
+end
+
redef fun do_work(mainmodule, mmodules, mb)
do
- var v = new HighlightVisitor
+ var v = new TestHighlightVisitor
print """<head>
<meta charset="utf-8">
<style type="text/css">
for mm in mmodules do for cd in mm.mclassdefs do for pd in cd.mpropdefs do
var n = mb.mpropdef2node(pd)
if not n isa APropdef then continue
- var hl = new HighlightVisitor
+ var hl = new TestHighlightVisitor
hl.enter_visit(n)
- print "<h1>{pd.full_name}</h1>"
+ print "<h1 id=\"{pd.c_name}\">{pd.full_name}</h1>"
printn "<pre><code>"
hl.html.write_to(stdout)
print "</code></pre>"
if not seen.has(cn) then
seen.add cn
- var hl = new HighlightVisitor
+ var hl = new TestHighlightVisitor
hl.enter_visit(n)
print "<h2>AST node: {cn} at {n.location}</h2>"
printn "<pre><code>"
var opt_noact = new OptionBool("Does not compile and run tests", "--no-act")
# opt --nitc
var opt_nitc = new OptionString("nitc compiler to use", "--nitc")
+ # opt --no-time
+ var opt_no_time = new OptionBool("Disable time information in XML", "--no-time")
# Working directory for testing.
fun test_dir: String do
# Additional noteworthy information when a test success.
var info: nullable String = null
+ # Time for the execution, in seconds
+ var real_time: Float = 0.0 is writable
+
# A colorful `[OK]` or `[KO]`.
fun status_tag(color: nullable Bool): String do
color = color or else true
var tc = new HTMLTag("testcase")
tc.attr("classname", xml_classname)
tc.attr("name", xml_name)
+ tc.attr("time", real_time.to_s)
+
+ var output = self.raw_output
+ if output != null then output = output.trunc(8192).filter_nonprintable
var error = self.error
if error != null then
+ var node
if was_exec then
- tc.open("error").append(error)
+ node = tc.open("error").attr("message", error)
else
- tc.open("failure").append(error)
+ node = tc.open("failure").attr("message", error)
end
- end
- var output = self.raw_output
- if output != null then
- tc.open("system-err").append(output.trunc(8192).filter_nonprintable)
+ if output != null then
+ node.append(output)
+ end
+ else if output != null then
+ tc.open("system-err").append(output)
end
return tc
end
import testing_base
import markdown
import html
+import realtime
# Extractor, Executor and Reporter for the tests in a module
class NitUnitExecutor
var file = du.test_file.as(not null)
var i = du.test_arg.as(not null)
toolcontext.info("Execute doc-unit {du.full_name} in {file} {i}", 1)
+ var clock = new Clock
var res2 = toolcontext.safe_exec("{file.to_program_name}.bin {i} >'{file}.out1' 2>&1 </dev/null")
+ if not toolcontext.opt_no_time.value then du.real_time = clock.total
du.was_exec = true
var content = "{file}.out1".to_path.read_all
var res = compile_unitfile(file)
var res2 = 0
if res == 0 then
+ var clock = new Clock
res2 = toolcontext.safe_exec("{file.to_program_name}.bin >'{file}.out1' 2>&1 </dev/null")
+ if not toolcontext.opt_no_time.value then du.real_time = clock.total
du.was_exec = true
end
var ndoc = nclassdef.n_doc
if ndoc != null then
doc_entities += 1
- d2m.extract(ndoc.to_mdoc, "nitunit." + mmodule.full_name + "." + mclassdef.mclass.full_name, "<class>")
+ d2m.extract(ndoc.to_mdoc, "nitunit." + mclassdef.full_name.replace("$", "."), "<class>")
end
end
for npropdef in nclassdef.n_propdefs do
var ndoc = npropdef.n_doc
if ndoc != null then
doc_entities += 1
- d2m.extract(ndoc.to_mdoc, "nitunit." + mmodule.full_name + "." + mclassdef.mclass.full_name, mpropdef.mproperty.full_name)
+ var a = mpropdef.full_name.split("$")
+ d2m.extract(ndoc.to_mdoc, "nitunit." + a[0] + "." + a[1], a[2])
end
end
end
doc_entities += 1
# NOTE: jenkins expects a '.' in the classname attr
- d2m.extract(mdoc, "nitunit." + mgroup.full_name, "<group>")
+ d2m.extract(mdoc, "nitunit." + mgroup.mpackage.name + "." + mgroup.name + ".<group>", "<group>")
d2m.run_tests
import testing_base
import html
private import annotation
+private import realtime
redef class ToolContext
# --pattern
end
write_to_nit
compile
+ if failure != null then
+ for case in test_cases do
+ case.is_done = true
+ case.error = "Compilation Error"
+ case.raw_output = failure
+ toolcontext.modelbuilder.failed_tests += 1
+ toolcontext.clear_progress_bar
+ toolcontext.show_unit(case)
+ end
+ show_status
+ print ""
+ return
+ end
toolcontext.info("Execute test-suite {mmodule.name}", 1)
var before_module = self.before_module
if not before_module == null then before_module.run
fun to_xml: HTMLTag do
var n = new HTMLTag("testsuite")
n.attr("package", mmodule.name)
- var failure = self.failure
- if failure != null then
- var f = new HTMLTag("failure")
- f.attr("message", failure.to_s)
- n.add f
- else
- for test in test_cases do n.add test.to_xml
- end
+ for test in test_cases do n.add test.to_xml
return n
end
var f = new FileReader.open("{file}.out")
var msg = f.read_all
f.close
- # set test case result
- var loc = mmodule.location
if res != 0 then
failure = msg
- toolcontext.warning(loc, "failure", "FAILURE: {mmodule.name} (in file {file}.nit): {msg}")
- toolcontext.modelbuilder.failed_tests += 1
end
- toolcontext.check_errors
end
# Error occured during test-suite compilation.
var method_name = test_method.name
var test_file = test_suite.test_file
var res_name = "{test_file}_{method_name.escape_to_c}"
+ var clock = new Clock
var res = toolcontext.safe_exec("{test_file}.bin {method_name} > '{res_name}.out1' 2>&1 </dev/null")
+ if not toolcontext.opt_no_time.value then real_time = clock.total
+
var raw_output = "{res_name}.out1".to_path.read_all
self.raw_output = raw_output
# set test case result
end
redef fun xml_classname do
- var mclassdef = test_method.mclassdef
- return "nitunit." + mclassdef.mmodule.full_name + "." + mclassdef.mclass.full_name
+ var a = test_method.full_name.split("$")
+ return "nitunit.{a[0]}.{a[1]}"
end
redef fun xml_name do
- return test_method.mproperty.full_name
+ var a = test_method.full_name.split("$")
+ return a[2]
end
end
var m = new Message(l, null, s, 2)
if messages.has(m) then return m
if l != null then l.add_message m
+ if opt_warn.value <= -1 then return m
messages.add m
error_count = error_count + 1
if opt_stop_on_first_error.value then check_errors
if messages.has(m) then return null
if l != null then l.add_message m
if opt_warning.value.has("no-{tag}") then return null
- if not opt_warning.value.has(tag) and opt_warn.value == 0 then return null
+ if not opt_warning.value.has(tag) and opt_warn.value <= 0 then return null
messages.add m
warning_count = warning_count + 1
if opt_stop_on_first_error.value then check_errors
exit 1
end
- nit_dir = compute_nit_dir
+ nit_dir = locate_nit_dir
if option_context.rest.is_empty and not accept_no_arguments then
print tooldescription
end
# The identified root directory of the Nit package
- var nit_dir: String is noinit
+ #
+ # It is assignable but is automatically set by `process_options` with `locate_nit_dir`.
+ var nit_dir: nullable String = null is writable
# Shared files directory.
#
return sharedir
end
- private fun compute_nit_dir: String
+ # Guess a possible nit_dir.
+ #
+ # It uses, in order:
+ #
+ # * the option `opt_no_color`
+ # * the environment variable `NIT_DIR`
+ # * the runpath of the program from argv[0]
+ # * the runpath of the process from /proc
+ # * the search in PATH
+ #
+ # If there is errors (e.g. the indicated path is invalid) or if no
+ # path is found, then an error is displayed and the program exits.
+ #
+ # The result is returned without being assigned to `nit_dir`.
+ # This function is automatically called by `process_options`
+ fun locate_nit_dir: String
do
# the option has precedence
var res = opt_nit_dir.value
modifiers.add modifier
end
obj["modifiers"] = modifiers
+ var mentity = self.mentity
+ if mentity isa MMethod then
+ obj["msignature"] = mentity.intro.msignature
+ else if mentity isa MMethodDef then
+ obj["msignature"] = mentity.msignature
+ else if mentity isa MVirtualTypeProp then
+ obj["bound"] = to_mentity_ref(mentity.intro.bound)
+ else if mentity isa MVirtualTypeDef then
+ obj["bound"] = to_mentity_ref(mentity.bound)
+ end
return obj
end
end
s = "Je dis «{s}» et redis «{s}» et trois fois de plus : «{s}{s}{s}».\n"
i = i + 1
end
-print s.bytelen
+print s.byte_length
s = ["Je dis «", s, "» et redis «", s, "» et trois fois de plus : «", s, s, s, "».\n"].plain_to_s
i = i + 1
end
-print(s.bytelen)
+print(s.byte_length)
../lib/core/kernel.nit:431,1--486,3: Error: `kernel$Numeric` does not specialize `module_0$Object`. Possible duplication of the root class `Object`?
../lib/core/kernel.nit:492,1--515,3: Error: `kernel$Bool` does not specialize `module_0$Object`. Possible duplication of the root class `Object`?
../lib/core/kernel.nit:517,1--599,3: Error: `kernel$Float` does not specialize `module_0$Object`. Possible duplication of the root class `Object`?
-../lib/core/kernel.nit:601,1--702,3: Error: `kernel$Byte` does not specialize `module_0$Object`. Possible duplication of the root class `Object`?
-../lib/core/kernel.nit:704,1--882,3: Error: `kernel$Int` does not specialize `module_0$Object`. Possible duplication of the root class `Object`?
-../lib/core/kernel.nit:884,1--1052,3: Error: `kernel$Char` does not specialize `module_0$Object`. Possible duplication of the root class `Object`?
-../lib/core/kernel.nit:1054,1--1061,3: Error: `kernel$Pointer` does not specialize `module_0$Object`. Possible duplication of the root class `Object`?
-../lib/core/kernel.nit:1063,1--1072,3: Error: `kernel$Task` does not specialize `module_0$Object`. Possible duplication of the root class `Object`?
+../lib/core/kernel.nit:601,1--705,3: Error: `kernel$Byte` does not specialize `module_0$Object`. Possible duplication of the root class `Object`?
+../lib/core/kernel.nit:707,1--885,3: Error: `kernel$Int` does not specialize `module_0$Object`. Possible duplication of the root class `Object`?
+../lib/core/kernel.nit:887,1--1055,3: Error: `kernel$Char` does not specialize `module_0$Object`. Possible duplication of the root class `Object`?
+../lib/core/kernel.nit:1057,1--1064,3: Error: `kernel$Pointer` does not specialize `module_0$Object`. Possible duplication of the root class `Object`?
+../lib/core/kernel.nit:1066,1--1075,3: Error: `kernel$Task` does not specialize `module_0$Object`. Possible duplication of the root class `Object`?
-Runtime error: Cast failed. Expected `OTHER`, got `Float` (../lib/core/kernel.nit:725)
+Runtime error: Cast failed. Expected `OTHER`, got `Float` (../lib/core/kernel.nit:728)
11
21
31
-Runtime error: Cast failed. Expected `OTHER`, got `Float` (../lib/core/kernel.nit:725)
+Runtime error: Cast failed. Expected `OTHER`, got `Float` (../lib/core/kernel.nit:728)
11
21
31
-Runtime error: Cast failed. Expected `OTHER`, got `Float` (../lib/core/kernel.nit:725)
+Runtime error: Cast failed. Expected `OTHER`, got `Float` (../lib/core/kernel.nit:728)
11
21
31
</span></span><span class="line" id="L16">
</span><span class="line" id="L17"><span class="nc_k">import</span> <span class="nc_k">end</span>
</span><span class="line" id="L18">
-</span><span class="nc_cdef foldable" id="base_simple3$Object"><span class="line" id="L19"><span class="nc_k">interface</span> <span class="nc_t">Object</span>
+</span><span class="nc_cdef foldable" id="base_simple3$Object"><span class="line" id="L19"><span class="nc_k">interface</span> <span class="nc_t nc_def popupable" title="class Object" data-title="<a href="#base_simple3$Object">class Object</a>" data-content="<div><b>class</b> <span>Object</span><br/><div class="dropdown"> <a data-toggle="dropdown" href="#"><b>hier</b> sub-classes<span class="caret"></span></a><ul class="dropdown-menu" role="menu" aria-labelledby="dLabel"><li><a href="#base_simple3$Bool">base_simple3$Bool</a></li><li><a href="#base_simple3$Int">base_simple3$Int</a></li><li><a href="#base_simple3$A">base_simple3$A</a></li><li><a href="#base_simple3$B">base_simple3$B</a></li><li><a href="#base_simple3$C">base_simple3$C</a></li><li><a href="#base_simple3$Sys">base_simple3$Sys</a></li></ul></div></div>" data-toggle="popover">Object</span>
</span><span class="line" id="L20"><span class="nc_k">end</span>
</span></span><span class="line" id="L21">
-</span><span class="nc_cdef foldable" id="base_simple3$Bool"><span class="line" id="L22"><span class="nc_k">enum</span> <span class="nc_t">Bool</span>
+</span><span class="nc_cdef foldable" id="base_simple3$Bool"><span class="line" id="L22"><span class="nc_k">enum</span> <span class="nc_t nc_def popupable" title="class Bool" data-title="<a href="#base_simple3$Bool">class Bool</a>" data-content="<div><b>class</b> <span>Bool</span><br/><div class="dropdown"> <a data-toggle="dropdown" href="#"><b>hier</b> super-classes<span class="caret"></span></a><ul class="dropdown-menu" role="menu" aria-labelledby="dLabel"><li><a href="#base_simple3$Object">base_simple3$Object</a></li></ul></div></div>" data-toggle="popover">Bool</span>
</span><span class="line" id="L23"><span class="nc_k">end</span>
</span></span><span class="line" id="L24">
-</span><span class="nc_cdef foldable" id="base_simple3$Int"><span class="line" id="L25"><span class="nc_k">enum</span> <span class="nc_t">Int</span>
-</span><span class="nc_pdef foldable" id="base_simple3$Int$output"><span class="line" id="L26"> <span class="nc_k">fun</span> <span class="nc_def popupable" title="base_simple3$Int$output" data-title="<a href="base_simple3.html#base_simple3$Int$output">base_simple3$Int$output</a>" data-content="<div><b>fun</b> <span>output<span></span></span><br/></div>" data-toggle="popover"><span class="nc_i">output</span></span> <span class="nc_k">is</span> <span class="nc_i">intern</span>
+</span><span class="nc_cdef foldable" id="base_simple3$Int"><span class="line" id="L25"><span class="nc_k">enum</span> <span class="nc_t nc_def popupable" title="class Int" data-title="<a href="#base_simple3$Int">class Int</a>" data-content="<div><b>class</b> <span>Int</span><br/><div class="dropdown"> <a data-toggle="dropdown" href="#"><b>hier</b> super-classes<span class="caret"></span></a><ul class="dropdown-menu" role="menu" aria-labelledby="dLabel"><li><a href="#base_simple3$Object">base_simple3$Object</a></li></ul></div></div>" data-toggle="popover">Int</span>
+</span><span class="nc_pdef foldable" id="base_simple3$Int$output"><span class="line" id="L26"> <span class="nc_k">fun</span> <span class="nc_def popupable" title="base_simple3$Int$output" data-title="<a href="#base_simple3$Int$output">base_simple3$Int$output</a>" data-content="<div><b>fun</b> <span>output<span></span></span><br/></div>" data-toggle="popover"><span class="nc_i">output</span></span> <span class="nc_k">is</span> <span class="nc_i">intern</span>
</span></span><span class="line" id="L27"><span class="nc_k">end</span>
</span></span><span class="line" id="L28">
-</span><span class="nc_cdef foldable" id="base_simple3$A"><span class="line" id="L29"><span class="nc_k">class</span> <span class="nc_t">A</span>
-</span><span class="nc_pdef foldable" id="base_simple3$A$init"><span class="line" id="L30"> <span class="nc_k">init</span> <span class="nc_k">do</span> <span class="nc_l">5</span><span>.</span><span class="nc_i">output</span>
-</span></span><span class="nc_pdef foldable" id="base_simple3$A$run"><span class="line" id="L31"> <span class="nc_k">fun</span> <span class="nc_def popupable" title="base_simple3$A$run" data-title="<a href="base_simple3.html#base_simple3$A$run">base_simple3$A$run</a>" data-content="<div><b>fun</b> <span>run<span></span></span><br/></div>" data-toggle="popover"><span class="nc_i">run</span></span> <span class="nc_k">do</span> <span class="nc_l">6</span><span>.</span><span class="nc_i">output</span>
+</span><span class="nc_cdef foldable" id="base_simple3$A"><span class="line" id="L29"><span class="nc_k">class</span> <span class="nc_t nc_def popupable" title="class A" data-title="<a href="#base_simple3$A">class A</a>" data-content="<div><b>class</b> <span>A</span><br/><div class="dropdown"> <a data-toggle="dropdown" href="#"><b>hier</b> super-classes<span class="caret"></span></a><ul class="dropdown-menu" role="menu" aria-labelledby="dLabel"><li><a href="#base_simple3$Object">base_simple3$Object</a></li></ul></div></div>" data-toggle="popover">A</span>
+</span><span class="nc_pdef foldable" id="base_simple3$A$init"><span class="line" id="L30"> <span class="nc_k">init</span> <span class="nc_k">do</span> <span class="nc_l popupable" title="Int" data-content="<div><b>class</b> <span><a href="#base_simple3$Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">5</span><span class="popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3$Int$output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$Int$output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">.</span><span class="nc_i popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3$Int$output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$Int$output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">output</span>
+</span></span><span class="nc_pdef foldable" id="base_simple3$A$run"><span class="line" id="L31"> <span class="nc_k">fun</span> <span class="nc_def popupable" title="base_simple3$A$run" data-title="<a href="#base_simple3$A$run">base_simple3$A$run</a>" data-content="<div><b>fun</b> <span>run<span></span></span><br/></div>" data-toggle="popover"><span class="nc_i">run</span></span> <span class="nc_k">do</span> <span class="nc_l popupable" title="Int" data-content="<div><b>class</b> <span><a href="#base_simple3$Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">6</span><span class="popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3$Int$output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$Int$output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">.</span><span class="nc_i popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3$Int$output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$Int$output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">output</span>
</span></span><span class="line" id="L32"><span class="nc_k">end</span>
</span></span><span class="line" id="L33">
-</span><span class="nc_cdef foldable" id="base_simple3$B"><span class="line" id="L34"><span class="nc_k">class</span> <span class="nc_t">B</span>
-</span><span class="nc_pdef foldable" id="base_simple3$B$_val"><a id="base_simple3$B$val"></a><a id="base_simple3$B$val="></a><span class="line" id="L35"> <span class="nc_k">var</span> <span class="nc_def nc_i">val</span><span>:</span> <span class="nc_t">Int</span>
-</span></span><span class="nc_pdef foldable" id="base_simple3$B$init"><span class="line" id="L36"> <span class="nc_k popupable" style="border-bottom: solid 2px red" title="Messages" data-content="<div><div class="dropdown"> <a data-toggle="dropdown" href="#"><b>1 message(s)</b> <span class="caret"></span></a><ul class="dropdown-menu" role="menu" aria-labelledby="dLabel"><li>Warning: init with signature in base_simple3$B</li></ul></div></div>" data-toggle="popover">init</span><span>(</span><span class="nc_v nc_i">v</span><span>:</span> <span class="nc_t">Int</span><span>)</span>
+</span><span class="nc_cdef foldable" id="base_simple3$B"><span class="line" id="L34"><span class="nc_k">class</span> <span class="nc_t nc_def popupable" title="class B" data-title="<a href="#base_simple3$B">class B</a>" data-content="<div><b>class</b> <span>B</span><br/><div class="dropdown"> <a data-toggle="dropdown" href="#"><b>hier</b> super-classes<span class="caret"></span></a><ul class="dropdown-menu" role="menu" aria-labelledby="dLabel"><li><a href="#base_simple3$Object">base_simple3$Object</a></li></ul></div></div>" data-toggle="popover">B</span>
+</span><span class="nc_pdef foldable" id="base_simple3$B$_val"><a id="base_simple3$B$val"></a><a id="base_simple3$B$val="></a><span class="line" id="L35"> <span class="nc_k">var</span> <span class="nc_i nc_def popupable" title="base_simple3$B$val" data-title="<a href="#base_simple3$B$val">base_simple3$B$val</a>" data-content="<div><b>fun</b> <span>val<span>: <a href="#base_simple3$Int">base_simple3$Int</a></span></span><br/></div>" data-toggle="popover">val</span><span>:</span> <span class="nc_t popupable" title="Int" data-content="<div><b>class</b> <span><a href="#base_simple3$Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">Int</span>
+</span></span><span class="nc_pdef foldable" id="base_simple3$B$init"><span class="line" id="L36"> <span class="nc_k popupable" style="border-bottom: solid 2px red" title="Messages" data-content="<div><div class="dropdown"> <a data-toggle="dropdown" href="#"><b>1 message(s)</b> <span class="caret"></span></a><ul class="dropdown-menu" role="menu" aria-labelledby="dLabel"><li>Warning: init with signature in base_simple3$B</li></ul></div></div>" data-toggle="popover">init</span><span>(</span><span class="nc_i nc_v popupable" title="v: Int" data-content="<div><b>local var</b> <span>v:<a href="#base_simple3$Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">v</span><span>:</span> <span class="nc_t popupable" title="Int" data-content="<div><b>class</b> <span><a href="#base_simple3$Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">Int</span><span>)</span>
</span><span class="line" id="L37"> <span class="nc_k">do</span>
-</span><span class="line" id="L38"> <span class="nc_l">7</span><span>.</span><span class="nc_i">output</span>
-</span><span class="line" id="L39"> <span class="nc_k">self</span><span>.</span><span class="nc_i">val</span> <span>=</span> <span class="nc_v nc_i">v</span>
+</span><span class="line" id="L38"> <span class="nc_l popupable" title="Int" data-content="<div><b>class</b> <span><a href="#base_simple3$Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">7</span><span class="popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3$Int$output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$Int$output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">.</span><span class="nc_i popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3$Int$output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$Int$output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">output</span>
+</span><span class="line" id="L39"> <span class="nc_k popupable" title="B" data-content="<div><b>class</b> <span><a href="#base_simple3$B">base_simple3$B</a></span><br/></div>" data-toggle="popover">self</span><span class="popupable" title="call base_simple3$B$val=" data-title="<a href="#base_simple3$B$val=">call base_simple3$B$val=</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$B$val=">base_simple3$B$val=</a><span>(val: <a href="#base_simple3$Int">base_simple3$Int</a>)</span></span><br/></div>" data-toggle="popover">.</span><span class="nc_i popupable" title="call base_simple3$B$val=" data-title="<a href="#base_simple3$B$val=">call base_simple3$B$val=</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$B$val=">base_simple3$B$val=</a><span>(val: <a href="#base_simple3$Int">base_simple3$Int</a>)</span></span><br/></div>" data-toggle="popover">val</span> <span class="popupable" title="call base_simple3$B$val=" data-title="<a href="#base_simple3$B$val=">call base_simple3$B$val=</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$B$val=">base_simple3$B$val=</a><span>(val: <a href="#base_simple3$Int">base_simple3$Int</a>)</span></span><br/></div>" data-toggle="popover">=</span> <span class="nc_i nc_v popupable" title="v: Int" data-content="<div><b>local var</b> <span>v:<a href="#base_simple3$Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">v</span>
</span><span class="line" id="L40"> <span class="nc_k">end</span>
-</span></span><span class="nc_pdef foldable" id="base_simple3$B$run"><span class="line" id="L41"> <span class="nc_k">fun</span> <span class="nc_def popupable" title="base_simple3$B$run" data-title="<a href="base_simple3.html#base_simple3$B$run">base_simple3$B$run</a>" data-content="<div><b>fun</b> <span>run<span></span></span><br/></div>" data-toggle="popover"><span class="nc_i">run</span></span> <span class="nc_k">do</span> <span class="nc_i">val</span><span>.</span><span class="nc_i">output</span>
+</span></span><span class="nc_pdef foldable" id="base_simple3$B$run"><span class="line" id="L41"> <span class="nc_k">fun</span> <span class="nc_def popupable" title="base_simple3$B$run" data-title="<a href="#base_simple3$B$run">base_simple3$B$run</a>" data-content="<div><b>fun</b> <span>run<span></span></span><br/></div>" data-toggle="popover"><span class="nc_i">run</span></span> <span class="nc_k">do</span> <span class="nc_i popupable" title="call base_simple3$B$val" data-title="<a href="#base_simple3$B$val">call base_simple3$B$val</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$B$val">base_simple3$B$val</a><span>: <a href="#base_simple3$Int">base_simple3$Int</a></span></span><br/></div>" data-toggle="popover">val</span><span class="popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3$Int$output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$Int$output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">.</span><span class="nc_i popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3$Int$output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$Int$output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">output</span>
</span></span><span class="line" id="L42"><span class="nc_k">end</span>
</span></span><span class="line" id="L43">
-</span><span class="nc_cdef foldable" id="base_simple3$C"><span class="line" id="L44"><span class="nc_k">class</span> <span class="nc_t">C</span>
-</span><span class="nc_pdef foldable" id="base_simple3$C$_val1"><a id="base_simple3$C$val1"></a><a id="base_simple3$C$val1="></a><span class="line" id="L45"> <span class="nc_k">var</span> <span class="nc_def nc_i">val1</span><span>:</span> <span class="nc_t">Int</span>
-</span></span><span class="nc_pdef foldable" id="base_simple3$C$_val2"><a id="base_simple3$C$val2"></a><a id="base_simple3$C$val2="></a><span class="line" id="L46"> <span class="nc_k">var</span> <span class="nc_def nc_i">val2</span><span>:</span> <span class="nc_t">Int</span> <span>=</span> <span class="nc_l">10</span>
+</span><span class="nc_cdef foldable" id="base_simple3$C"><span class="line" id="L44"><span class="nc_k">class</span> <span class="nc_t nc_def popupable" title="class C" data-title="<a href="#base_simple3$C">class C</a>" data-content="<div><b>class</b> <span>C</span><br/><div class="dropdown"> <a data-toggle="dropdown" href="#"><b>hier</b> super-classes<span class="caret"></span></a><ul class="dropdown-menu" role="menu" aria-labelledby="dLabel"><li><a href="#base_simple3$Object">base_simple3$Object</a></li></ul></div></div>" data-toggle="popover">C</span>
+</span><span class="nc_pdef foldable" id="base_simple3$C$_val1"><a id="base_simple3$C$val1"></a><a id="base_simple3$C$val1="></a><span class="line" id="L45"> <span class="nc_k">var</span> <span class="nc_i nc_def popupable" title="base_simple3$C$val1" data-title="<a href="#base_simple3$C$val1">base_simple3$C$val1</a>" data-content="<div><b>fun</b> <span>val1<span>: <a href="#base_simple3$Int">base_simple3$Int</a></span></span><br/></div>" data-toggle="popover">val1</span><span>:</span> <span class="nc_t popupable" title="Int" data-content="<div><b>class</b> <span><a href="#base_simple3$Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">Int</span>
+</span></span><span class="nc_pdef foldable" id="base_simple3$C$_val2"><a id="base_simple3$C$val2"></a><a id="base_simple3$C$val2="></a><span class="line" id="L46"> <span class="nc_k">var</span> <span class="nc_i nc_def popupable" title="base_simple3$C$val2" data-title="<a href="#base_simple3$C$val2">base_simple3$C$val2</a>" data-content="<div><b>fun</b> <span>val2<span>: <a href="#base_simple3$Int">base_simple3$Int</a></span></span><br/></div>" data-toggle="popover">val2</span><span>:</span> <span class="nc_t popupable" title="Int" data-content="<div><b>class</b> <span><a href="#base_simple3$Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">Int</span> <span>=</span> <span class="nc_l popupable" title="Int" data-content="<div><b>class</b> <span><a href="#base_simple3$Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">10</span>
</span></span><span class="line" id="L47"><span class="nc_k">end</span>
</span></span><span class="line" id="L48">
-</span><span class="nc_pdef foldable" id="base_simple3$Sys$foo"><span class="line" id="L49"><span class="nc_k">fun</span> <span class="nc_def popupable" title="base_simple3$Sys$foo" data-title="<a href="base_simple3.html#base_simple3$Sys$foo">base_simple3$Sys$foo</a>" data-content="<div><b>fun</b> <span>foo<span></span></span><br/></div>" data-toggle="popover"><span class="nc_i">foo</span></span> <span class="nc_k">do</span> <span class="nc_l">2</span><span>.</span><span class="nc_i">output</span>
-</span></span><span class="nc_pdef foldable" id="base_simple3$Sys$bar"><span class="line" id="L50"><span class="nc_k">fun</span> <span class="nc_def popupable" title="base_simple3$Sys$bar" data-title="<a href="base_simple3.html#base_simple3$Sys$bar">base_simple3$Sys$bar</a>" data-content="<div><b>fun</b> <span>bar<span>(i: <a href="base_simple3.html#base_simple3$Int">Int</a>)</span></span><br/></div>" data-toggle="popover"><span class="nc_i">bar</span></span><span>(</span><span class="nc_v nc_i">i</span><span>:</span> <span class="nc_t">Int</span><span>)</span> <span class="nc_k">do</span> <span class="nc_v nc_i">i</span><span>.</span><span class="nc_i">output</span>
-</span></span><span class="nc_pdef foldable" id="base_simple3$Sys$baz"><span class="line" id="L51"><span class="nc_k">fun</span> <span class="nc_def popupable" title="base_simple3$Sys$baz" data-title="<a href="base_simple3.html#base_simple3$Sys$baz">base_simple3$Sys$baz</a>" data-content="<div><b>fun</b> <span>baz<span>: <a href="base_simple3.html#base_simple3$Int">Int</a></span></span><br/></div>" data-toggle="popover"><span class="nc_i">baz</span></span><span>:</span> <span class="nc_t">Int</span> <span class="nc_k">do</span> <span class="nc_k">return</span> <span class="nc_l">4</span>
+</span><span class="nc_pdef foldable" id="base_simple3$Sys$foo"><span class="line" id="L49"><span class="nc_k">fun</span> <span class="nc_def popupable" title="base_simple3$Sys$foo" data-title="<a href="#base_simple3$Sys$foo">base_simple3$Sys$foo</a>" data-content="<div><b>fun</b> <span>foo<span></span></span><br/></div>" data-toggle="popover"><span class="nc_i">foo</span></span> <span class="nc_k">do</span> <span class="nc_l popupable" title="Int" data-content="<div><b>class</b> <span><a href="#base_simple3$Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">2</span><span class="popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3$Int$output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$Int$output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">.</span><span class="nc_i popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3$Int$output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$Int$output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">output</span>
+</span></span><span class="nc_pdef foldable" id="base_simple3$Sys$bar"><span class="line" id="L50"><span class="nc_k">fun</span> <span class="nc_def popupable" title="base_simple3$Sys$bar" data-title="<a href="#base_simple3$Sys$bar">base_simple3$Sys$bar</a>" data-content="<div><b>fun</b> <span>bar<span>(i: <a href="#base_simple3$Int">base_simple3$Int</a>)</span></span><br/></div>" data-toggle="popover"><span class="nc_i">bar</span></span><span>(</span><span class="nc_i nc_v popupable" title="i: Int" data-content="<div><b>local var</b> <span>i:<a href="#base_simple3$Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">i</span><span>:</span> <span class="nc_t popupable" title="Int" data-content="<div><b>class</b> <span><a href="#base_simple3$Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">Int</span><span>)</span> <span class="nc_k">do</span> <span class="nc_i nc_v popupable" title="i: Int" data-content="<div><b>local var</b> <span>i:<a href="#base_simple3$Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">i</span><span class="popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3$Int$output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$Int$output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">.</span><span class="nc_i popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3$Int$output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$Int$output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">output</span>
+</span></span><span class="nc_pdef foldable" id="base_simple3$Sys$baz"><span class="line" id="L51"><span class="nc_k">fun</span> <span class="nc_def popupable" title="base_simple3$Sys$baz" data-title="<a href="#base_simple3$Sys$baz">base_simple3$Sys$baz</a>" data-content="<div><b>fun</b> <span>baz<span>: <a href="#base_simple3$Int">base_simple3$Int</a></span></span><br/></div>" data-toggle="popover"><span class="nc_i">baz</span></span><span>:</span> <span class="nc_t popupable" title="Int" data-content="<div><b>class</b> <span><a href="#base_simple3$Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">Int</span> <span class="nc_k">do</span> <span class="nc_k">return</span> <span class="nc_l popupable" title="Int" data-content="<div><b>class</b> <span><a href="#base_simple3$Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">4</span>
</span></span><span class="line" id="L52">
-</span><span class="nc_pdef foldable" id="base_simple3$Sys$main"><span class="line" id="L53"><span class="nc_l">1</span><span>.</span><span class="nc_i">output</span>
-</span><span class="line" id="L54"><span class="nc_i">foo</span>
-</span><span class="line" id="L55"><span class="nc_i">bar</span><span>(</span><span class="nc_l">3</span><span>)</span>
-</span><span class="line" id="L56"><span class="nc_i">baz</span><span>.</span><span class="nc_i">output</span>
+</span><span class="nc_pdef foldable" id="base_simple3$Sys$main"><span class="line" id="L53"><span class="nc_l popupable" title="Int" data-content="<div><b>class</b> <span><a href="#base_simple3$Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">1</span><span class="popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3$Int$output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$Int$output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">.</span><span class="nc_i popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3$Int$output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$Int$output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">output</span>
+</span><span class="line" id="L54"><span class="nc_i popupable" title="call base_simple3$Sys$foo" data-title="<a href="#base_simple3$Sys$foo">call base_simple3$Sys$foo</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$Sys$foo">base_simple3$Sys$foo</a><span></span></span><br/></div>" data-toggle="popover">foo</span>
+</span><span class="line" id="L55"><span class="nc_i popupable" title="call base_simple3$Sys$bar" data-title="<a href="#base_simple3$Sys$bar">call base_simple3$Sys$bar</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$Sys$bar">base_simple3$Sys$bar</a><span>(i: <a href="#base_simple3$Int">base_simple3$Int</a>)</span></span><br/></div>" data-toggle="popover">bar</span><span>(</span><span class="nc_l popupable" title="Int" data-content="<div><b>class</b> <span><a href="#base_simple3$Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">3</span><span>)</span>
+</span><span class="line" id="L56"><span class="nc_i popupable" title="call base_simple3$Sys$baz" data-title="<a href="#base_simple3$Sys$baz">call base_simple3$Sys$baz</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$Sys$baz">base_simple3$Sys$baz</a><span>: <a href="#base_simple3$Int">base_simple3$Int</a></span></span><br/></div>" data-toggle="popover">baz</span><span class="popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3$Int$output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$Int$output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">.</span><span class="nc_i popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3$Int$output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$Int$output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">output</span>
</span><span class="line" id="L57">
-</span><span class="line" id="L58"><span class="nc_k">var</span> <span class="nc_v nc_i">a</span> <span>=</span> <span class="nc_k">new</span> <span class="nc_t">A</span>
-</span><span class="line" id="L59"><span class="nc_v nc_i">a</span><span>.</span><span class="nc_i">run</span>
+</span><span class="line" id="L58"><span class="nc_k">var</span> <span class="nc_i nc_v popupable" title="a: A" data-content="<div><b>local var</b> <span>a:<a href="#base_simple3$A">base_simple3$A</a></span><br/></div>" data-toggle="popover">a</span> <span>=</span> <span class="nc_k popupable" title="call base_simple3$A$init" data-title="<a href="#base_simple3$A$init">call base_simple3$A$init</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$A$init">base_simple3$A$init</a><span></span></span><br/><b>intro</b> <span><a href="#base_simple3$Object$init">in base_simple3$Object</a></span><br/></div>" data-toggle="popover">new</span> <span class="nc_t popupable" title="A" data-content="<div><b>class</b> <span><a href="#base_simple3$A">base_simple3$A</a></span><br/></div>" data-toggle="popover">A</span>
+</span><span class="line" id="L59"><span class="nc_i nc_v popupable" title="a: A" data-content="<div><b>local var</b> <span>a:<a href="#base_simple3$A">base_simple3$A</a></span><br/></div>" data-toggle="popover">a</span><span class="popupable" title="call base_simple3$A$run" data-title="<a href="#base_simple3$A$run">call base_simple3$A$run</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$A$run">base_simple3$A$run</a><span></span></span><br/></div>" data-toggle="popover">.</span><span class="nc_i popupable" title="call base_simple3$A$run" data-title="<a href="#base_simple3$A$run">call base_simple3$A$run</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$A$run">base_simple3$A$run</a><span></span></span><br/></div>" data-toggle="popover">run</span>
</span><span class="line" id="L60">
-</span><span class="line" id="L61"><span class="nc_k">var</span> <span class="nc_v nc_i">b</span> <span>=</span> <span class="nc_k">new</span> <span class="nc_t">B</span><span>(</span><span class="nc_l">8</span><span>)</span>
-</span><span class="line" id="L62"><span class="nc_v nc_i">b</span><span>.</span><span class="nc_i">run</span>
+</span><span class="line" id="L61"><span class="nc_k">var</span> <span class="nc_i nc_v popupable" title="b: B" data-content="<div><b>local var</b> <span>b:<a href="#base_simple3$B">base_simple3$B</a></span><br/></div>" data-toggle="popover">b</span> <span>=</span> <span class="nc_k popupable" title="call base_simple3$B$init" data-title="<a href="#base_simple3$B$init">call base_simple3$B$init</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$B$init">base_simple3$B$init</a><span>(v: <a href="#base_simple3$Int">base_simple3$Int</a>)</span></span><br/></div>" data-toggle="popover">new</span> <span class="nc_t popupable" title="B" data-content="<div><b>class</b> <span><a href="#base_simple3$B">base_simple3$B</a></span><br/></div>" data-toggle="popover">B</span><span>(</span><span class="nc_l popupable" title="Int" data-content="<div><b>class</b> <span><a href="#base_simple3$Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">8</span><span>)</span>
+</span><span class="line" id="L62"><span class="nc_i nc_v popupable" title="b: B" data-content="<div><b>local var</b> <span>b:<a href="#base_simple3$B">base_simple3$B</a></span><br/></div>" data-toggle="popover">b</span><span class="popupable" title="call base_simple3$B$run" data-title="<a href="#base_simple3$B$run">call base_simple3$B$run</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$B$run">base_simple3$B$run</a><span></span></span><br/></div>" data-toggle="popover">.</span><span class="nc_i popupable" title="call base_simple3$B$run" data-title="<a href="#base_simple3$B$run">call base_simple3$B$run</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$B$run">base_simple3$B$run</a><span></span></span><br/></div>" data-toggle="popover">run</span>
</span><span class="line" id="L63">
-</span><span class="line" id="L64"><span class="nc_k">var</span> <span class="nc_v nc_i">c</span> <span>=</span> <span class="nc_k">new</span> <span class="nc_t">C</span><span>(</span><span class="nc_l">9</span><span>)</span>
-</span><span class="line" id="L65"><span class="nc_v nc_i">c</span><span>.</span><span class="nc_i">val1</span><span>.</span><span class="nc_i">output</span>
-</span><span class="line" id="L66"><span class="nc_v nc_i">c</span><span>.</span><span class="nc_i">val2</span><span>.</span><span class="nc_i">output</span>
+</span><span class="line" id="L64"><span class="nc_k">var</span> <span class="nc_i nc_v popupable" title="c: C" data-content="<div><b>local var</b> <span>c:<a href="#base_simple3$C">base_simple3$C</a></span><br/></div>" data-toggle="popover">c</span> <span>=</span> <span class="nc_k popupable" title="call base_simple3$C$init" data-title="<a href="#base_simple3$C$init">call base_simple3$C$init</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$C$init">base_simple3$C$init</a><span>(val1: <a href="#base_simple3$Int">base_simple3$Int</a>)</span></span><br/><b>intro</b> <span><a href="#base_simple3$Object$init">in base_simple3$Object</a></span><br/></div>" data-toggle="popover">new</span> <span class="nc_t popupable" title="C" data-content="<div><b>class</b> <span><a href="#base_simple3$C">base_simple3$C</a></span><br/></div>" data-toggle="popover">C</span><span>(</span><span class="nc_l popupable" title="Int" data-content="<div><b>class</b> <span><a href="#base_simple3$Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">9</span><span>)</span>
+</span><span class="line" id="L65"><span class="nc_i nc_v popupable" title="c: C" data-content="<div><b>local var</b> <span>c:<a href="#base_simple3$C">base_simple3$C</a></span><br/></div>" data-toggle="popover">c</span><span class="popupable" title="call base_simple3$C$val1" data-title="<a href="#base_simple3$C$val1">call base_simple3$C$val1</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$C$val1">base_simple3$C$val1</a><span>: <a href="#base_simple3$Int">base_simple3$Int</a></span></span><br/></div>" data-toggle="popover">.</span><span class="nc_i popupable" title="call base_simple3$C$val1" data-title="<a href="#base_simple3$C$val1">call base_simple3$C$val1</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$C$val1">base_simple3$C$val1</a><span>: <a href="#base_simple3$Int">base_simple3$Int</a></span></span><br/></div>" data-toggle="popover">val1</span><span class="popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3$Int$output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$Int$output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">.</span><span class="nc_i popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3$Int$output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$Int$output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">output</span>
+</span><span class="line" id="L66"><span class="nc_i nc_v popupable" title="c: C" data-content="<div><b>local var</b> <span>c:<a href="#base_simple3$C">base_simple3$C</a></span><br/></div>" data-toggle="popover">c</span><span class="popupable" title="call base_simple3$C$val2" data-title="<a href="#base_simple3$C$val2">call base_simple3$C$val2</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$C$val2">base_simple3$C$val2</a><span>: <a href="#base_simple3$Int">base_simple3$Int</a></span></span><br/></div>" data-toggle="popover">.</span><span class="nc_i popupable" title="call base_simple3$C$val2" data-title="<a href="#base_simple3$C$val2">call base_simple3$C$val2</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$C$val2">base_simple3$C$val2</a><span>: <a href="#base_simple3$Int">base_simple3$Int</a></span></span><br/></div>" data-toggle="popover">val2</span><span class="popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3$Int$output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$Int$output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">.</span><span class="nc_i popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3$Int$output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3$Int$output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">output</span>
</span></span></span>
\ No newline at end of file
Numeric -> Float [dir=back arrowtail=open style=dashed];
Byte [
- label = "{Byte||+ %(i: Byte): Byte\l+ \<\<(i: Int): Byte\l+ \>\>(i: Int): Byte\l+ ascii(): Char\l}"
+ label = "{Byte||+ %(i: Byte): Byte\l+ \<\<(i: Int): Byte\l+ \>\>(i: Int): Byte\l+ ascii(): Char\l+ is_whitespace(): Bool\l}"
]
Discrete -> Byte [dir=back arrowtail=open style=dashed];
Numeric -> Byte [dir=back arrowtail=open style=dashed];
Numeric -> Float [dir=back arrowtail=open style=dashed];
Byte [
- label = "{Byte||+ %(i: Byte): Byte\l+ \<\<(i: Int): Byte\l+ \>\>(i: Int): Byte\l+ ascii(): Char\l}"
+ label = "{Byte||+ %(i: Byte): Byte\l+ \<\<(i: Int): Byte\l+ \>\>(i: Int): Byte\l+ ascii(): Char\l+ is_whitespace(): Bool\l}"
]
Discrete -> Byte [dir=back arrowtail=open style=dashed];
Numeric -> Byte [dir=back arrowtail=open style=dashed];
Test suites: Classes: 1; Test Cases: 3; Failures: 1
[FAILURE] 4/7 tests failed.
`nitunit.out` is not removed for investigation.
-<testsuites><testsuite package="test_nitunit::test_nitunit"><testcase classname="nitunit.test_nitunit::test_nitunit.<module>" name="<module>"><system-err></system-err><system-out>assert true
-</system-out></testcase><testcase classname="nitunit.test_nitunit::test_nitunit.test_nitunit::X" name="<class>"><error>Runtime error in nitunit.out/test_nitunit-2.nit</error><system-err>Runtime error: Assert failed (nitunit.out/test_nitunit-2.nit:5)
-</system-err><system-out>assert false
-</system-out></testcase><testcase classname="nitunit.test_nitunit::test_nitunit.test_nitunit::X" name="test_nitunit::X::foo"><failure>Compilation error in nitunit.out/test_nitunit-3.nit</failure><system-err>nitunit.out/test_nitunit-3.nit:5,8--27: Error: method or variable `undefined_identifier` unknown in `Sys`.
-</system-err><system-out>assert undefined_identifier
-</system-out></testcase><testcase classname="nitunit.test_nitunit::test_nitunit.test_nitunit::X" name="test_nitunit::X::foo1"><failure>Syntax Error: unexpected operator '!'.</failure><system-out>assert !@#$%^&*()
-</system-out></testcase></testsuite><testsuite package="test_test_nitunit::test_test_nitunit"></testsuite><testsuite package="test_test_nitunit"><testcase classname="nitunit.test_test_nitunit::test_test_nitunit.test_test_nitunit::TestX" name="test_test_nitunit::TestX::test_foo"><system-err></system-err></testcase><testcase classname="nitunit.test_test_nitunit::test_test_nitunit.test_test_nitunit::TestX" name="test_test_nitunit::TestX::test_foo1"><error>Runtime Error in file nitunit.out/gen_test_test_nitunit.nit</error><system-err>Runtime error: Assert failed (test_test_nitunit.nit:39)
-</system-err></testcase><testcase classname="nitunit.test_test_nitunit::test_test_nitunit.test_test_nitunit::TestX" name="test_test_nitunit::TestX::test_foo2"><system-err></system-err></testcase></testsuite></testsuites>
\ No newline at end of file
+<testsuites><testsuite package="test_nitunit::test_nitunit"><testcase classname="nitunit.test_nitunit::test_nitunit.<module>" name="<module>" time="0.0"><system-err></system-err><system-out>assert true
+</system-out></testcase><testcase classname="nitunit.test_nitunit.X" name="<class>" time="0.0"><error message="Runtime error in nitunit.out/test_nitunit-2.nit">Runtime error: Assert failed (nitunit.out/test_nitunit-2.nit:5)
+</error><system-out>assert false
+</system-out></testcase><testcase classname="nitunit.test_nitunit.X" name="foo" time="0.0"><failure message="Compilation error in nitunit.out/test_nitunit-3.nit">nitunit.out/test_nitunit-3.nit:5,8--27: Error: method or variable `undefined_identifier` unknown in `Sys`.
+</failure><system-out>assert undefined_identifier
+</system-out></testcase><testcase classname="nitunit.test_nitunit.X" name="foo1" time="0.0"><failure message="Syntax Error: unexpected operator '!'."></failure><system-out>assert !@#$%^&*()
+</system-out></testcase></testsuite><testsuite package="test_test_nitunit::test_test_nitunit"></testsuite><testsuite package="test_test_nitunit"><testcase classname="nitunit.test_test_nitunit.TestX" name="test_foo" time="0.0"><system-err></system-err></testcase><testcase classname="nitunit.test_test_nitunit.TestX" name="test_foo1" time="0.0"><error message="Runtime Error in file nitunit.out/gen_test_test_nitunit.nit">Runtime error: Assert failed (test_test_nitunit.nit:39)
+</error></testcase><testcase classname="nitunit.test_test_nitunit.TestX" name="test_foo2" time="0.0"><system-err></system-err></testcase></testsuite></testsuites>
\ No newline at end of file
Docunits: Entities: 4; Documented ones: 3; With nitunits: 3; Failures: 0
Test suites: Classes: 0; Test Cases: 0
[SUCCESS] All 3 tests passed.
-<testsuites><testsuite package="test_nitunit2::test_nitunit2"><testcase classname="nitunit.test_nitunit2::test_nitunit2.core::Sys" name="test_nitunit2::test_nitunit2::Sys::foo1"><system-err></system-err><system-out>if true then
+<testsuites><testsuite package="test_nitunit2::test_nitunit2"><testcase classname="nitunit.test_nitunit2::test_nitunit2.core::Sys" name="foo1" time="0.0"><system-err></system-err><system-out>if true then
assert true
end
-</system-out></testcase><testcase classname="nitunit.test_nitunit2::test_nitunit2.core::Sys" name="test_nitunit2::test_nitunit2::Sys::bar2"><system-err></system-err><system-out>if true then
+</system-out></testcase><testcase classname="nitunit.test_nitunit2::test_nitunit2.core::Sys" name="bar2" time="0.0"><system-err></system-err><system-out>if true then
assert true
end
-</system-out></testcase><testcase classname="nitunit.test_nitunit2::test_nitunit2.core::Sys" name="test_nitunit2::test_nitunit2::Sys::foo3"><system-err></system-err><system-out>var a = 1
+</system-out></testcase><testcase classname="nitunit.test_nitunit2::test_nitunit2.core::Sys" name="foo3" time="0.0"><system-err></system-err><system-out>var a = 1
assert a == 1
assert a == 1
</system-out></testcase></testsuite></testsuites>
\ No newline at end of file
Docunits: Entities: 6; Documented ones: 5; With nitunits: 3; Failures: 0
Test suites: Classes: 0; Test Cases: 0
[SUCCESS] All 3 tests passed.
-<testsuites><testsuite package="test_doc2::test_doc2"><testcase classname="nitunit.test_doc2::test_doc2.core::Sys" name="test_doc2::test_doc2::Sys::foo1"><system-err></system-err><system-out>assert true # tested
-</system-out></testcase><testcase classname="nitunit.test_doc2::test_doc2.core::Sys" name="test_doc2::test_doc2::Sys::foo2"><system-err></system-err><system-out>assert true # tested
-</system-out></testcase><testcase classname="nitunit.test_doc2::test_doc2.core::Sys" name="test_doc2::test_doc2::Sys::foo3"><system-err></system-err><system-out>assert true # tested
+<testsuites><testsuite package="test_doc2::test_doc2"><testcase classname="nitunit.test_doc2::test_doc2.core::Sys" name="foo1" time="0.0"><system-err></system-err><system-out>assert true # tested
+</system-out></testcase><testcase classname="nitunit.test_doc2::test_doc2.core::Sys" name="foo2" time="0.0"><system-err></system-err><system-out>assert true # tested
+</system-out></testcase><testcase classname="nitunit.test_doc2::test_doc2.core::Sys" name="foo3" time="0.0"><system-err></system-err><system-out>assert true # tested
</system-out></testcase></testsuite></testsuites>
\ No newline at end of file
Test suites: Classes: 0; Test Cases: 0
[FAILURE] 2/3 tests failed.
`nitunit.out` is not removed for investigation.
-<testsuites><testsuite package="test_nitunit3>"><testcase classname="nitunit.test_nitunit3>" name="<group>"><error>Runtime error in nitunit.out/test_nitunit3-0.nit with argument 1</error><system-err>Runtime error: Assert failed (nitunit.out/test_nitunit3-0.nit:7)
-</system-err><system-out>assert false
+<testsuites><testsuite package="test_nitunit3>"><testcase classname="nitunit.test_nitunit3.test_nitunit3.<group>" name="<group>" time="0.0"><error message="Runtime error in nitunit.out/test_nitunit3-0.nit with argument 1">Runtime error: Assert failed (nitunit.out/test_nitunit3-0.nit:7)
+</error><system-out>assert false
assert true
-</system-out></testcase><testcase classname="nitunit.test_nitunit3>" name="<group>#2"><failure>Syntax Error: unexpected malformed character '\].</failure><system-out>;'\][]
-</system-out></testcase></testsuite><testsuite package="test_nitunit3::test_nitunit3"><testcase classname="nitunit.test_nitunit3::test_nitunit3.<module>" name="<module>"><system-err></system-err><system-out>assert true
+</system-out></testcase><testcase classname="nitunit.test_nitunit3.test_nitunit3.<group>" name="<group>#2" time="0.0"><failure message="Syntax Error: unexpected malformed character '\]."></failure><system-out>;'\][]
+</system-out></testcase></testsuite><testsuite package="test_nitunit3::test_nitunit3"><testcase classname="nitunit.test_nitunit3::test_nitunit3.<module>" name="<module>" time="0.0"><system-err></system-err><system-out>assert true
</system-out></testcase></testsuite></testsuites>
\ No newline at end of file
Test suites: Classes: 0; Test Cases: 0
[FAILURE] 1/1 tests failed.
`nitunit.out` is not removed for investigation.
-<testsuites><testsuite package="test_nitunit_md.md"><testcase classname="nitunit.<file>" name="test_nitunit_md.md"><error>Runtime error in nitunit.out/file-0.nit with argument 1</error><system-err>Runtime error: Assert failed (nitunit.out/file-0.nit:8)
-</system-err><system-out>var a = 1
+<testsuites><testsuite package="test_nitunit_md.md"><testcase classname="nitunit.<file>" name="test_nitunit_md.md" time="0.0"><error message="Runtime error in nitunit.out/file-0.nit with argument 1">Runtime error: Assert failed (nitunit.out/file-0.nit:8)
+</error><system-out>var a = 1
assert 1 == 1
assert false
</system-out></testcase></testsuite></testsuites>
\ No newline at end of file
Test suites: Classes: 0; Test Cases: 0
[FAILURE] 3/3 tests failed.
`nitunit.out` is not removed for investigation.
-<testsuites><testsuite package="test_doc3::test_doc3"><testcase classname="nitunit.test_doc3::test_doc3.core::Sys" name="test_doc3::test_doc3::Sys::foo1"><failure>Syntax Error: unexpected identifier 'garbage'.</failure><system-out> *garbage*
-</system-out></testcase><testcase classname="nitunit.test_doc3::test_doc3.core::Sys" name="test_doc3::test_doc3::Sys::foo2"><failure>Syntax Error: unexpected identifier 'garbage'.</failure><system-out>*garbage*
-</system-out></testcase><testcase classname="nitunit.test_doc3::test_doc3.core::Sys" name="test_doc3::test_doc3::Sys::foo3"><failure>Syntax Error: unexpected identifier 'garbage'.</failure><system-out>*garbage*
+<testsuites><testsuite package="test_doc3::test_doc3"><testcase classname="nitunit.test_doc3::test_doc3.core::Sys" name="foo1" time="0.0"><failure message="Syntax Error: unexpected identifier 'garbage'."></failure><system-out> *garbage*
+</system-out></testcase><testcase classname="nitunit.test_doc3::test_doc3.core::Sys" name="foo2" time="0.0"><failure message="Syntax Error: unexpected identifier 'garbage'."></failure><system-out>*garbage*
+</system-out></testcase><testcase classname="nitunit.test_doc3::test_doc3.core::Sys" name="foo3" time="0.0"><failure message="Syntax Error: unexpected identifier 'garbage'."></failure><system-out>*garbage*
</system-out></testcase></testsuite></testsuites>
\ No newline at end of file
+test_nitunit4/test_bad_comp2.nit:19,7--22: Error: a class named `test_nitunit4::TestSuiteBadComp` is already defined in module `test_bad_comp` at test_nitunit4/test_bad_comp.nit:19,1--29,3.
+==== Test-suite of module test_nitunit4::test_bad_comp | tests: 2
+[KO] test_nitunit4$TestSuiteBadComp$test_good
+ test_nitunit4/test_bad_comp.nit:22,2--24,4: Compilation Error
+ Output
+ test_nitunit4/test_bad_comp.nit:27,10--19: Error: method or variable `bad_method` unknown in `TestSuiteBadComp`.
+
+[KO] test_nitunit4$TestSuiteBadComp$test_bad
+ test_nitunit4/test_bad_comp.nit:26,2--28,4: Compilation Error
+ Output
+ test_nitunit4/test_bad_comp.nit:27,10--19: Error: method or variable `bad_method` unknown in `TestSuiteBadComp`.
+
+
+==== Test-suite of module test_nitunit4::test_bad_comp2 | tests: 2
+[KO] test_nitunit4$TestSuiteBadComp$test_good
+ test_nitunit4/test_bad_comp2.nit:22,2--24,4: Compilation Error
+ Output
+ nitunit.out/gen_test_bad_comp2.nit:14,10--17: Error: expected 1 argument(s) for `test_bad(param: Bool)`; got 0. See introduction at `test_nitunit4::TestSuiteBadComp::test_bad`.
+
+[KO] test_nitunit4$TestSuiteBadComp$test_bad
+ test_nitunit4/test_bad_comp2.nit:26,2--28,4: Compilation Error
+ Output
+ nitunit.out/gen_test_bad_comp2.nit:14,10--17: Error: expected 1 argument(s) for `test_bad(param: Bool)`; got 0. See introduction at `test_nitunit4::TestSuiteBadComp::test_bad`.
+
+
==== Test-suite of module test_nitunit4::test_nitunit4 | tests: 4
[KO] test_nitunit4$TestTestSuite$test_foo
test_nitunit4/test_nitunit4.nit:22,2--26,4: Runtime Error in file nitunit.out/gen_test_nitunit4.nit
==== Test-suite of module test_nitunit4::test_nitunit4_base | tests: 0
==== Test-suite of module test_nitunit4::test_nitunit4_base | tests: 0
-Docunits: Entities: 13; Documented ones: 0; With nitunits: 0
-Test suites: Classes: 2; Test Cases: 4; Failures: 3
-[FAILURE] 3/4 tests failed.
+Docunits: Entities: 21; Documented ones: 0; With nitunits: 0
+Test suites: Classes: 4; Test Cases: 8; Failures: 7
+[FAILURE] 7/8 tests failed.
`nitunit.out` is not removed for investigation.
-<testsuites><testsuite package="test_nitunit4>"></testsuite><testsuite package="test_nitunit4::nitunit4"></testsuite><testsuite package="test_nitunit4::test_nitunit4"></testsuite><testsuite package="test_nitunit4"><testcase classname="nitunit.test_nitunit4::test_nitunit4.test_nitunit4::TestTestSuite" name="test_nitunit4::TestTestSuite::test_foo"><error>Runtime Error in file nitunit.out/gen_test_nitunit4.nit</error><system-err>Before Test
+<testsuites><testsuite package="test_nitunit4>"></testsuite><testsuite package="test_nitunit4::nitunit4"></testsuite><testsuite package="test_nitunit4::test_bad_comp"></testsuite><testsuite package="test_bad_comp"><testcase classname="nitunit.test_nitunit4.TestSuiteBadComp" name="test_good" time="0.0"><failure message="Compilation Error">test_nitunit4/test_bad_comp.nit:27,10--19: Error: method or variable `bad_method` unknown in `TestSuiteBadComp`.
+</failure></testcase><testcase classname="nitunit.test_nitunit4.TestSuiteBadComp" name="test_bad" time="0.0"><failure message="Compilation Error">test_nitunit4/test_bad_comp.nit:27,10--19: Error: method or variable `bad_method` unknown in `TestSuiteBadComp`.
+</failure></testcase></testsuite><testsuite package="test_nitunit4::test_bad_comp2"></testsuite><testsuite package="test_bad_comp2"><testcase classname="nitunit.test_nitunit4.TestSuiteBadComp" name="test_good" time="0.0"><failure message="Compilation Error">nitunit.out/gen_test_bad_comp2.nit:14,10--17: Error: expected 1 argument(s) for `test_bad(param: Bool)`; got 0. See introduction at `test_nitunit4::TestSuiteBadComp::test_bad`.
+</failure></testcase><testcase classname="nitunit.test_nitunit4.TestSuiteBadComp" name="test_bad" time="0.0"><failure message="Compilation Error">nitunit.out/gen_test_bad_comp2.nit:14,10--17: Error: expected 1 argument(s) for `test_bad(param: Bool)`; got 0. See introduction at `test_nitunit4::TestSuiteBadComp::test_bad`.
+</failure></testcase></testsuite><testsuite package="test_nitunit4::test_nitunit4"></testsuite><testsuite package="test_nitunit4"><testcase classname="nitunit.test_nitunit4.TestTestSuite" name="test_foo" time="0.0"><error message="Runtime Error in file nitunit.out/gen_test_nitunit4.nit">Before Test
Tested method
After Test
Runtime error: Assert failed (test_nitunit4/test_nitunit4_base.nit:31)
-</system-err></testcase><testcase classname="nitunit.test_nitunit4::test_nitunit4.test_nitunit4::TestTestSuite" name="test_nitunit4::TestTestSuite::test_bar"><system-err>Before Test
+</error></testcase><testcase classname="nitunit.test_nitunit4.TestTestSuite" name="test_bar" time="0.0"><system-err>Before Test
Tested method
After Test
-</system-err></testcase><testcase classname="nitunit.test_nitunit4::test_nitunit4.test_nitunit4::TestTestSuite" name="test_nitunit4::TestTestSuite::test_baz"><error>Difference with expected output: diff -u test_nitunit4/test_baz.res nitunit.out/gen_test_nitunit4_test_baz.out1</error><system-err>Diff
+</system-err></testcase><testcase classname="nitunit.test_nitunit4.TestTestSuite" name="test_baz" time="0.0"><error message="Difference with expected output: diff -u test_nitunit4/test_baz.res nitunit.out/gen_test_nitunit4_test_baz.out1">Diff
--- expected:test_nitunit4/test_baz.res
+++ got:nitunit.out/gen_test_nitunit4_test_baz.out1
@@ -1 +1,3 @@
+Before Test
+Tested method
+After Test
-</system-err></testcase><testcase classname="nitunit.test_nitunit4::test_nitunit4.test_nitunit4::TestTestSuite" name="test_nitunit4::TestTestSuite::test_sav_conflict"><error>Conflicting expected output: test_nitunit4/test_nitunit4.sav/test_sav_conflict.res, test_nitunit4/sav/test_sav_conflict.res and test_nitunit4/test_sav_conflict.res all exist</error><system-err>Before Test
+</error></testcase><testcase classname="nitunit.test_nitunit4.TestTestSuite" name="test_sav_conflict" time="0.0"><error message="Conflicting expected output: test_nitunit4/test_nitunit4.sav/test_sav_conflict.res, test_nitunit4/sav/test_sav_conflict.res and test_nitunit4/test_sav_conflict.res all exist">Before Test
Tested method
After Test
-</system-err></testcase></testsuite><testsuite package="test_nitunit4::test_nitunit4_base"></testsuite><testsuite package="test_nitunit4_base"></testsuite></testsuites>
\ No newline at end of file
+</error></testcase></testsuite><testsuite package="test_nitunit4::test_nitunit4_base"></testsuite><testsuite package="test_nitunit4_base"></testsuite></testsuites>
\ No newline at end of file
Zm9vYg==: foob
Zm9vYmE=: fooba
Zm9vYmFy: foobar
+Zm9vYg: foob
+Zm9vYmE: fooba
+Zm9v*Yg: foob
+:
+Znm=.is_base64? true
+Znm===.is_base64? false
+Z.sd=.is_base64? false
+Z==D.is_base64? false
+:
+Znm=: No error
+Znm===: Invalid padding length
+Z.sd=: Invalid Base64 character at position 1: .
+Z==D: Invalid padding character D at position 3
<meta charset="utf-8">
<style type="text/css">
.nitcode a { color: inherit; cursor:pointer; }
+.nitcode .titled:hover { text-decoration: underline; } /* underline titles */
.nitcode .popupable:hover { text-decoration: underline; cursor:help; } /* underline titles */
.nitcode .foldable { display: block } /* for block productions*/
.nitcode .line{ display: block } /* for lines */
</head><body>
-<h1>base_simple3$Int$output</h1>
-<pre><code><span class="nitcode"><span class="nc_pdef foldable" id="base_simple3$Int$output"><span class="line" id="L26"> <span class="nc_k">fun</span> <span class="nc_def popupable" title="base_simple3$Int$output" data-title="<a href="base_simple3.html#base_simple3$Int$output">base_simple3$Int$output</a>" data-content="<div><b>fun</b> <span>output<span></span></span><br/></div>" data-toggle="popover"><span class="nc_i">output</span></span> <span class="nc_k">is</span> <span class="nc_i">intern</span></span></span></span></code></pre>
-<h1>base_simple3$A$Object::init</h1>
-<pre><code><span class="nitcode"><span class="nc_pdef foldable" id="base_simple3$A$init"><span class="line" id="L30"> <span class="nc_k">init</span> <span class="nc_k">do</span> <span class="nc_l">5</span><span>.</span><span class="nc_i">output</span></span></span></span></code></pre>
-<h1>base_simple3$A$run</h1>
-<pre><code><span class="nitcode"><span class="nc_pdef foldable" id="base_simple3$A$run"><span class="line" id="L31"> <span class="nc_k">fun</span> <span class="nc_def popupable" title="base_simple3$A$run" data-title="<a href="base_simple3.html#base_simple3$A$run">base_simple3$A$run</a>" data-content="<div><b>fun</b> <span>run<span></span></span><br/></div>" data-toggle="popover"><span class="nc_i">run</span></span> <span class="nc_k">do</span> <span class="nc_l">6</span><span>.</span><span class="nc_i">output</span></span></span></span></code></pre>
-<h1>base_simple3$B$_val</h1>
-<pre><code><span class="nitcode"><span class="nc_pdef foldable" id="base_simple3$B$_val"><a id="base_simple3$B$val"></a><a id="base_simple3$B$val="></a><span class="line" id="L35"> <span class="nc_k">var</span> <span class="nc_def nc_i">val</span><span>:</span> <span class="nc_t">Int</span></span></span></span></code></pre>
-<h1>base_simple3$B$val</h1>
-<pre><code><span class="nitcode"><span class="nc_pdef foldable" id="base_simple3$B$_val"><a id="base_simple3$B$val"></a><a id="base_simple3$B$val="></a><span class="line" id="L35"> <span class="nc_k">var</span> <span class="nc_def nc_i">val</span><span>:</span> <span class="nc_t">Int</span></span></span></span></code></pre>
-<h1>base_simple3$B$val=</h1>
-<pre><code><span class="nitcode"><span class="nc_pdef foldable" id="base_simple3$B$_val"><a id="base_simple3$B$val"></a><a id="base_simple3$B$val="></a><span class="line" id="L35"> <span class="nc_k">var</span> <span class="nc_def nc_i">val</span><span>:</span> <span class="nc_t">Int</span></span></span></span></code></pre>
-<h1>base_simple3$B$init</h1>
-<pre><code><span class="nitcode"><span class="nc_pdef foldable" id="base_simple3$B$init"><span class="line" id="L36"> <span class="nc_k popupable" style="border-bottom: solid 2px red" title="Messages" data-content="<div><div class="dropdown"> <a data-toggle="dropdown" href="#"><b>1 message(s)</b> <span class="caret"></span></a><ul class="dropdown-menu" role="menu" aria-labelledby="dLabel"><li>Warning: init with signature in base_simple3$B</li></ul></div></div>" data-toggle="popover">init</span><span>(</span><span class="nc_v nc_i">v</span><span>:</span> <span class="nc_t">Int</span><span>)</span>
+<h1 id="base_simple3___base_simple3__Int___output">base_simple3$Int$output</h1>
+<pre><code><span class="nitcode"><span class="nc_pdef foldable" id="base_simple3$Int$output"><span class="line" id="L26"> <span class="nc_k">fun</span> <span class="nc_def popupable" title="base_simple3$Int$output" data-title="<a href="#base_simple3___base_simple3__Int___output">base_simple3$Int$output</a>" data-content="<div><b>fun</b> <span>output<span></span></span><br/></div>" data-toggle="popover"><span class="nc_i">output</span></span> <span class="nc_k">is</span> <span class="nc_i">intern</span></span></span></span></code></pre>
+<h1 id="base_simple3___base_simple3__A___Object__init">base_simple3$A$Object::init</h1>
+<pre><code><span class="nitcode"><span class="nc_pdef foldable" id="base_simple3$A$init"><span class="line" id="L30"> <span class="nc_k">init</span> <span class="nc_k">do</span> <span class="nc_l popupable" title="Int" data-title="<a href="#base_simple3__Int">Int</a>" data-content="<div><b>class</b> <span><a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">5</span><span class="popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3___base_simple3__Int___output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__Int___output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">.</span><span class="nc_i popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3___base_simple3__Int___output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__Int___output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">output</span></span></span></span></code></pre>
+<h1 id="base_simple3___base_simple3__A___run">base_simple3$A$run</h1>
+<pre><code><span class="nitcode"><span class="nc_pdef foldable" id="base_simple3$A$run"><span class="line" id="L31"> <span class="nc_k">fun</span> <span class="nc_def popupable" title="base_simple3$A$run" data-title="<a href="#base_simple3___base_simple3__A___run">base_simple3$A$run</a>" data-content="<div><b>fun</b> <span>run<span></span></span><br/></div>" data-toggle="popover"><span class="nc_i">run</span></span> <span class="nc_k">do</span> <span class="nc_l popupable" title="Int" data-title="<a href="#base_simple3__Int">Int</a>" data-content="<div><b>class</b> <span><a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">6</span><span class="popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3___base_simple3__Int___output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__Int___output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">.</span><span class="nc_i popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3___base_simple3__Int___output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__Int___output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">output</span></span></span></span></code></pre>
+<h1 id="base_simple3___base_simple3__B____val">base_simple3$B$_val</h1>
+<pre><code><span class="nitcode"><span class="nc_pdef foldable" id="base_simple3$B$_val"><a id="base_simple3$B$val"></a><a id="base_simple3$B$val="></a><span class="line" id="L35"> <span class="nc_k">var</span> <span class="nc_i nc_def popupable" title="base_simple3$B$val" data-title="<a href="#base_simple3___base_simple3__B___val">base_simple3$B$val</a>" data-content="<div><b>fun</b> <span>val<span>: <a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span></span><br/></div>" data-toggle="popover">val</span><span>:</span> <span class="nc_t popupable" title="Int" data-title="<a href="#base_simple3__Int">Int</a>" data-content="<div><b>class</b> <span><a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">Int</span></span></span></span></code></pre>
+<h1 id="base_simple3___base_simple3__B___val">base_simple3$B$val</h1>
+<pre><code><span class="nitcode"><span class="nc_pdef foldable" id="base_simple3$B$_val"><a id="base_simple3$B$val"></a><a id="base_simple3$B$val="></a><span class="line" id="L35"> <span class="nc_k">var</span> <span class="nc_i nc_def popupable" title="base_simple3$B$val" data-title="<a href="#base_simple3___base_simple3__B___val">base_simple3$B$val</a>" data-content="<div><b>fun</b> <span>val<span>: <a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span></span><br/></div>" data-toggle="popover">val</span><span>:</span> <span class="nc_t popupable" title="Int" data-title="<a href="#base_simple3__Int">Int</a>" data-content="<div><b>class</b> <span><a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">Int</span></span></span></span></code></pre>
+<h1 id="base_simple3___base_simple3__B___val_61d">base_simple3$B$val=</h1>
+<pre><code><span class="nitcode"><span class="nc_pdef foldable" id="base_simple3$B$_val"><a id="base_simple3$B$val"></a><a id="base_simple3$B$val="></a><span class="line" id="L35"> <span class="nc_k">var</span> <span class="nc_i nc_def popupable" title="base_simple3$B$val" data-title="<a href="#base_simple3___base_simple3__B___val">base_simple3$B$val</a>" data-content="<div><b>fun</b> <span>val<span>: <a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span></span><br/></div>" data-toggle="popover">val</span><span>:</span> <span class="nc_t popupable" title="Int" data-title="<a href="#base_simple3__Int">Int</a>" data-content="<div><b>class</b> <span><a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">Int</span></span></span></span></code></pre>
+<h1 id="base_simple3___base_simple3__B___init">base_simple3$B$init</h1>
+<pre><code><span class="nitcode"><span class="nc_pdef foldable" id="base_simple3$B$init"><span class="line" id="L36"> <span class="nc_k popupable" style="border-bottom: solid 2px red" title="Messages" data-content="<div><div class="dropdown"> <a data-toggle="dropdown" href="#"><b>1 message(s)</b> <span class="caret"></span></a><ul class="dropdown-menu" role="menu" aria-labelledby="dLabel"><li>Warning: init with signature in base_simple3$B</li></ul></div></div>" data-toggle="popover">init</span><span>(</span><span class="nc_i nc_v popupable" title="v: Int" data-content="<div><b>local var</b> <span>v:<a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">v</span><span>:</span> <span class="nc_t popupable" title="Int" data-title="<a href="#base_simple3__Int">Int</a>" data-content="<div><b>class</b> <span><a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">Int</span><span>)</span>
</span><span class="line" id="L37"> <span class="nc_k">do</span>
-</span><span class="line" id="L38"> <span class="nc_l">7</span><span>.</span><span class="nc_i">output</span>
-</span><span class="line" id="L39"> <span class="nc_k">self</span><span>.</span><span class="nc_i">val</span> <span>=</span> <span class="nc_v nc_i">v</span>
+</span><span class="line" id="L38"> <span class="nc_l popupable" title="Int" data-title="<a href="#base_simple3__Int">Int</a>" data-content="<div><b>class</b> <span><a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">7</span><span class="popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3___base_simple3__Int___output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__Int___output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">.</span><span class="nc_i popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3___base_simple3__Int___output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__Int___output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">output</span>
+</span><span class="line" id="L39"> <span class="nc_k popupable" title="B" data-title="<a href="#base_simple3__B">B</a>" data-content="<div><b>class</b> <span><a href="#base_simple3___base_simple3__B">base_simple3$B</a></span><br/></div>" data-toggle="popover">self</span><span class="popupable" title="call base_simple3$B$val=" data-title="<a href="#base_simple3___base_simple3__B___val_61d">call base_simple3$B$val=</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__B___val_61d">base_simple3$B$val=</a><span>(val: <a href="#base_simple3___base_simple3__Int">base_simple3$Int</a>)</span></span><br/></div>" data-toggle="popover">.</span><span class="nc_i popupable" title="call base_simple3$B$val=" data-title="<a href="#base_simple3___base_simple3__B___val_61d">call base_simple3$B$val=</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__B___val_61d">base_simple3$B$val=</a><span>(val: <a href="#base_simple3___base_simple3__Int">base_simple3$Int</a>)</span></span><br/></div>" data-toggle="popover">val</span> <span class="popupable" title="call base_simple3$B$val=" data-title="<a href="#base_simple3___base_simple3__B___val_61d">call base_simple3$B$val=</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__B___val_61d">base_simple3$B$val=</a><span>(val: <a href="#base_simple3___base_simple3__Int">base_simple3$Int</a>)</span></span><br/></div>" data-toggle="popover">=</span> <span class="nc_i nc_v popupable" title="v: Int" data-content="<div><b>local var</b> <span>v:<a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">v</span>
</span><span class="line" id="L40"> <span class="nc_k">end</span></span></span></span></code></pre>
-<h1>base_simple3$B$run</h1>
-<pre><code><span class="nitcode"><span class="nc_pdef foldable" id="base_simple3$B$run"><span class="line" id="L41"> <span class="nc_k">fun</span> <span class="nc_def popupable" title="base_simple3$B$run" data-title="<a href="base_simple3.html#base_simple3$B$run">base_simple3$B$run</a>" data-content="<div><b>fun</b> <span>run<span></span></span><br/></div>" data-toggle="popover"><span class="nc_i">run</span></span> <span class="nc_k">do</span> <span class="nc_i">val</span><span>.</span><span class="nc_i">output</span></span></span></span></code></pre>
-<h1>base_simple3$C$_val1</h1>
-<pre><code><span class="nitcode"><span class="nc_pdef foldable" id="base_simple3$C$_val1"><a id="base_simple3$C$val1"></a><a id="base_simple3$C$val1="></a><span class="line" id="L45"> <span class="nc_k">var</span> <span class="nc_def nc_i">val1</span><span>:</span> <span class="nc_t">Int</span></span></span></span></code></pre>
-<h1>base_simple3$C$val1</h1>
-<pre><code><span class="nitcode"><span class="nc_pdef foldable" id="base_simple3$C$_val1"><a id="base_simple3$C$val1"></a><a id="base_simple3$C$val1="></a><span class="line" id="L45"> <span class="nc_k">var</span> <span class="nc_def nc_i">val1</span><span>:</span> <span class="nc_t">Int</span></span></span></span></code></pre>
-<h1>base_simple3$C$val1=</h1>
-<pre><code><span class="nitcode"><span class="nc_pdef foldable" id="base_simple3$C$_val1"><a id="base_simple3$C$val1"></a><a id="base_simple3$C$val1="></a><span class="line" id="L45"> <span class="nc_k">var</span> <span class="nc_def nc_i">val1</span><span>:</span> <span class="nc_t">Int</span></span></span></span></code></pre>
-<h1>base_simple3$C$_val2</h1>
-<pre><code><span class="nitcode"><span class="nc_pdef foldable" id="base_simple3$C$_val2"><a id="base_simple3$C$val2"></a><a id="base_simple3$C$val2="></a><span class="line" id="L46"> <span class="nc_k">var</span> <span class="nc_def nc_i">val2</span><span>:</span> <span class="nc_t">Int</span> <span>=</span> <span class="nc_l">10</span></span></span></span></code></pre>
-<h1>base_simple3$C$val2</h1>
-<pre><code><span class="nitcode"><span class="nc_pdef foldable" id="base_simple3$C$_val2"><a id="base_simple3$C$val2"></a><a id="base_simple3$C$val2="></a><span class="line" id="L46"> <span class="nc_k">var</span> <span class="nc_def nc_i">val2</span><span>:</span> <span class="nc_t">Int</span> <span>=</span> <span class="nc_l">10</span></span></span></span></code></pre>
-<h1>base_simple3$C$val2=</h1>
-<pre><code><span class="nitcode"><span class="nc_pdef foldable" id="base_simple3$C$_val2"><a id="base_simple3$C$val2"></a><a id="base_simple3$C$val2="></a><span class="line" id="L46"> <span class="nc_k">var</span> <span class="nc_def nc_i">val2</span><span>:</span> <span class="nc_t">Int</span> <span>=</span> <span class="nc_l">10</span></span></span></span></code></pre>
-<h1>base_simple3$Sys$foo</h1>
-<pre><code><span class="nitcode"><span class="nc_pdef foldable" id="base_simple3$Sys$foo"><span class="line" id="L49"><span class="nc_k">fun</span> <span class="nc_def popupable" title="base_simple3$Sys$foo" data-title="<a href="base_simple3.html#base_simple3$Sys$foo">base_simple3$Sys$foo</a>" data-content="<div><b>fun</b> <span>foo<span></span></span><br/></div>" data-toggle="popover"><span class="nc_i">foo</span></span> <span class="nc_k">do</span> <span class="nc_l">2</span><span>.</span><span class="nc_i">output</span></span></span></span></code></pre>
-<h1>base_simple3$Sys$bar</h1>
-<pre><code><span class="nitcode"><span class="nc_pdef foldable" id="base_simple3$Sys$bar"><span class="line" id="L50"><span class="nc_k">fun</span> <span class="nc_def popupable" title="base_simple3$Sys$bar" data-title="<a href="base_simple3.html#base_simple3$Sys$bar">base_simple3$Sys$bar</a>" data-content="<div><b>fun</b> <span>bar<span>(i: <a href="base_simple3.html#base_simple3$Int">Int</a>)</span></span><br/></div>" data-toggle="popover"><span class="nc_i">bar</span></span><span>(</span><span class="nc_v nc_i">i</span><span>:</span> <span class="nc_t">Int</span><span>)</span> <span class="nc_k">do</span> <span class="nc_v nc_i">i</span><span>.</span><span class="nc_i">output</span></span></span></span></code></pre>
-<h1>base_simple3$Sys$baz</h1>
-<pre><code><span class="nitcode"><span class="nc_pdef foldable" id="base_simple3$Sys$baz"><span class="line" id="L51"><span class="nc_k">fun</span> <span class="nc_def popupable" title="base_simple3$Sys$baz" data-title="<a href="base_simple3.html#base_simple3$Sys$baz">base_simple3$Sys$baz</a>" data-content="<div><b>fun</b> <span>baz<span>: <a href="base_simple3.html#base_simple3$Int">Int</a></span></span><br/></div>" data-toggle="popover"><span class="nc_i">baz</span></span><span>:</span> <span class="nc_t">Int</span> <span class="nc_k">do</span> <span class="nc_k">return</span> <span class="nc_l">4</span></span></span></span></code></pre>
-<h1>base_simple3$Sys$main</h1>
-<pre><code><span class="nitcode"><span class="nc_pdef foldable" id="base_simple3$Sys$main"><span class="line" id="L53"><span class="nc_l">1</span><span>.</span><span class="nc_i">output</span>
-</span><span class="line" id="L54"><span class="nc_i">foo</span>
-</span><span class="line" id="L55"><span class="nc_i">bar</span><span>(</span><span class="nc_l">3</span><span>)</span>
-</span><span class="line" id="L56"><span class="nc_i">baz</span><span>.</span><span class="nc_i">output</span>
+<h1 id="base_simple3___base_simple3__B___run">base_simple3$B$run</h1>
+<pre><code><span class="nitcode"><span class="nc_pdef foldable" id="base_simple3$B$run"><span class="line" id="L41"> <span class="nc_k">fun</span> <span class="nc_def popupable" title="base_simple3$B$run" data-title="<a href="#base_simple3___base_simple3__B___run">base_simple3$B$run</a>" data-content="<div><b>fun</b> <span>run<span></span></span><br/></div>" data-toggle="popover"><span class="nc_i">run</span></span> <span class="nc_k">do</span> <span class="nc_i popupable" title="call base_simple3$B$val" data-title="<a href="#base_simple3___base_simple3__B___val">call base_simple3$B$val</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__B___val">base_simple3$B$val</a><span>: <a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span></span><br/></div>" data-toggle="popover">val</span><span class="popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3___base_simple3__Int___output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__Int___output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">.</span><span class="nc_i popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3___base_simple3__Int___output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__Int___output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">output</span></span></span></span></code></pre>
+<h1 id="base_simple3___base_simple3__C____val1">base_simple3$C$_val1</h1>
+<pre><code><span class="nitcode"><span class="nc_pdef foldable" id="base_simple3$C$_val1"><a id="base_simple3$C$val1"></a><a id="base_simple3$C$val1="></a><span class="line" id="L45"> <span class="nc_k">var</span> <span class="nc_i nc_def popupable" title="base_simple3$C$val1" data-title="<a href="#base_simple3___base_simple3__C___val1">base_simple3$C$val1</a>" data-content="<div><b>fun</b> <span>val1<span>: <a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span></span><br/></div>" data-toggle="popover">val1</span><span>:</span> <span class="nc_t popupable" title="Int" data-title="<a href="#base_simple3__Int">Int</a>" data-content="<div><b>class</b> <span><a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">Int</span></span></span></span></code></pre>
+<h1 id="base_simple3___base_simple3__C___val1">base_simple3$C$val1</h1>
+<pre><code><span class="nitcode"><span class="nc_pdef foldable" id="base_simple3$C$_val1"><a id="base_simple3$C$val1"></a><a id="base_simple3$C$val1="></a><span class="line" id="L45"> <span class="nc_k">var</span> <span class="nc_i nc_def popupable" title="base_simple3$C$val1" data-title="<a href="#base_simple3___base_simple3__C___val1">base_simple3$C$val1</a>" data-content="<div><b>fun</b> <span>val1<span>: <a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span></span><br/></div>" data-toggle="popover">val1</span><span>:</span> <span class="nc_t popupable" title="Int" data-title="<a href="#base_simple3__Int">Int</a>" data-content="<div><b>class</b> <span><a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">Int</span></span></span></span></code></pre>
+<h1 id="base_simple3___base_simple3__C___val1_61d">base_simple3$C$val1=</h1>
+<pre><code><span class="nitcode"><span class="nc_pdef foldable" id="base_simple3$C$_val1"><a id="base_simple3$C$val1"></a><a id="base_simple3$C$val1="></a><span class="line" id="L45"> <span class="nc_k">var</span> <span class="nc_i nc_def popupable" title="base_simple3$C$val1" data-title="<a href="#base_simple3___base_simple3__C___val1">base_simple3$C$val1</a>" data-content="<div><b>fun</b> <span>val1<span>: <a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span></span><br/></div>" data-toggle="popover">val1</span><span>:</span> <span class="nc_t popupable" title="Int" data-title="<a href="#base_simple3__Int">Int</a>" data-content="<div><b>class</b> <span><a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">Int</span></span></span></span></code></pre>
+<h1 id="base_simple3___base_simple3__C____val2">base_simple3$C$_val2</h1>
+<pre><code><span class="nitcode"><span class="nc_pdef foldable" id="base_simple3$C$_val2"><a id="base_simple3$C$val2"></a><a id="base_simple3$C$val2="></a><span class="line" id="L46"> <span class="nc_k">var</span> <span class="nc_i nc_def popupable" title="base_simple3$C$val2" data-title="<a href="#base_simple3___base_simple3__C___val2">base_simple3$C$val2</a>" data-content="<div><b>fun</b> <span>val2<span>: <a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span></span><br/></div>" data-toggle="popover">val2</span><span>:</span> <span class="nc_t popupable" title="Int" data-title="<a href="#base_simple3__Int">Int</a>" data-content="<div><b>class</b> <span><a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">Int</span> <span>=</span> <span class="nc_l popupable" title="Int" data-title="<a href="#base_simple3__Int">Int</a>" data-content="<div><b>class</b> <span><a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">10</span></span></span></span></code></pre>
+<h1 id="base_simple3___base_simple3__C___val2">base_simple3$C$val2</h1>
+<pre><code><span class="nitcode"><span class="nc_pdef foldable" id="base_simple3$C$_val2"><a id="base_simple3$C$val2"></a><a id="base_simple3$C$val2="></a><span class="line" id="L46"> <span class="nc_k">var</span> <span class="nc_i nc_def popupable" title="base_simple3$C$val2" data-title="<a href="#base_simple3___base_simple3__C___val2">base_simple3$C$val2</a>" data-content="<div><b>fun</b> <span>val2<span>: <a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span></span><br/></div>" data-toggle="popover">val2</span><span>:</span> <span class="nc_t popupable" title="Int" data-title="<a href="#base_simple3__Int">Int</a>" data-content="<div><b>class</b> <span><a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">Int</span> <span>=</span> <span class="nc_l popupable" title="Int" data-title="<a href="#base_simple3__Int">Int</a>" data-content="<div><b>class</b> <span><a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">10</span></span></span></span></code></pre>
+<h1 id="base_simple3___base_simple3__C___val2_61d">base_simple3$C$val2=</h1>
+<pre><code><span class="nitcode"><span class="nc_pdef foldable" id="base_simple3$C$_val2"><a id="base_simple3$C$val2"></a><a id="base_simple3$C$val2="></a><span class="line" id="L46"> <span class="nc_k">var</span> <span class="nc_i nc_def popupable" title="base_simple3$C$val2" data-title="<a href="#base_simple3___base_simple3__C___val2">base_simple3$C$val2</a>" data-content="<div><b>fun</b> <span>val2<span>: <a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span></span><br/></div>" data-toggle="popover">val2</span><span>:</span> <span class="nc_t popupable" title="Int" data-title="<a href="#base_simple3__Int">Int</a>" data-content="<div><b>class</b> <span><a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">Int</span> <span>=</span> <span class="nc_l popupable" title="Int" data-title="<a href="#base_simple3__Int">Int</a>" data-content="<div><b>class</b> <span><a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">10</span></span></span></span></code></pre>
+<h1 id="base_simple3___base_simple3__Sys___foo">base_simple3$Sys$foo</h1>
+<pre><code><span class="nitcode"><span class="nc_pdef foldable" id="base_simple3$Sys$foo"><span class="line" id="L49"><span class="nc_k">fun</span> <span class="nc_def popupable" title="base_simple3$Sys$foo" data-title="<a href="#base_simple3___base_simple3__Sys___foo">base_simple3$Sys$foo</a>" data-content="<div><b>fun</b> <span>foo<span></span></span><br/></div>" data-toggle="popover"><span class="nc_i">foo</span></span> <span class="nc_k">do</span> <span class="nc_l popupable" title="Int" data-title="<a href="#base_simple3__Int">Int</a>" data-content="<div><b>class</b> <span><a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">2</span><span class="popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3___base_simple3__Int___output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__Int___output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">.</span><span class="nc_i popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3___base_simple3__Int___output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__Int___output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">output</span></span></span></span></code></pre>
+<h1 id="base_simple3___base_simple3__Sys___bar">base_simple3$Sys$bar</h1>
+<pre><code><span class="nitcode"><span class="nc_pdef foldable" id="base_simple3$Sys$bar"><span class="line" id="L50"><span class="nc_k">fun</span> <span class="nc_def popupable" title="base_simple3$Sys$bar" data-title="<a href="#base_simple3___base_simple3__Sys___bar">base_simple3$Sys$bar</a>" data-content="<div><b>fun</b> <span>bar<span>(i: <a href="#base_simple3___base_simple3__Int">base_simple3$Int</a>)</span></span><br/></div>" data-toggle="popover"><span class="nc_i">bar</span></span><span>(</span><span class="nc_i nc_v popupable" title="i: Int" data-content="<div><b>local var</b> <span>i:<a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">i</span><span>:</span> <span class="nc_t popupable" title="Int" data-title="<a href="#base_simple3__Int">Int</a>" data-content="<div><b>class</b> <span><a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">Int</span><span>)</span> <span class="nc_k">do</span> <span class="nc_i nc_v popupable" title="i: Int" data-content="<div><b>local var</b> <span>i:<a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">i</span><span class="popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3___base_simple3__Int___output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__Int___output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">.</span><span class="nc_i popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3___base_simple3__Int___output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__Int___output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">output</span></span></span></span></code></pre>
+<h1 id="base_simple3___base_simple3__Sys___baz">base_simple3$Sys$baz</h1>
+<pre><code><span class="nitcode"><span class="nc_pdef foldable" id="base_simple3$Sys$baz"><span class="line" id="L51"><span class="nc_k">fun</span> <span class="nc_def popupable" title="base_simple3$Sys$baz" data-title="<a href="#base_simple3___base_simple3__Sys___baz">base_simple3$Sys$baz</a>" data-content="<div><b>fun</b> <span>baz<span>: <a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span></span><br/></div>" data-toggle="popover"><span class="nc_i">baz</span></span><span>:</span> <span class="nc_t popupable" title="Int" data-title="<a href="#base_simple3__Int">Int</a>" data-content="<div><b>class</b> <span><a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">Int</span> <span class="nc_k">do</span> <span class="nc_k">return</span> <span class="nc_l popupable" title="Int" data-title="<a href="#base_simple3__Int">Int</a>" data-content="<div><b>class</b> <span><a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">4</span></span></span></span></code></pre>
+<h1 id="base_simple3___base_simple3__Sys___main">base_simple3$Sys$main</h1>
+<pre><code><span class="nitcode"><span class="nc_pdef foldable" id="base_simple3$Sys$main"><span class="line" id="L53"><span class="nc_l popupable" title="Int" data-title="<a href="#base_simple3__Int">Int</a>" data-content="<div><b>class</b> <span><a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">1</span><span class="popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3___base_simple3__Int___output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__Int___output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">.</span><span class="nc_i popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3___base_simple3__Int___output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__Int___output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">output</span>
+</span><span class="line" id="L54"><span class="nc_i popupable" title="call base_simple3$Sys$foo" data-title="<a href="#base_simple3___base_simple3__Sys___foo">call base_simple3$Sys$foo</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__Sys___foo">base_simple3$Sys$foo</a><span></span></span><br/></div>" data-toggle="popover">foo</span>
+</span><span class="line" id="L55"><span class="nc_i popupable" title="call base_simple3$Sys$bar" data-title="<a href="#base_simple3___base_simple3__Sys___bar">call base_simple3$Sys$bar</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__Sys___bar">base_simple3$Sys$bar</a><span>(i: <a href="#base_simple3___base_simple3__Int">base_simple3$Int</a>)</span></span><br/></div>" data-toggle="popover">bar</span><span>(</span><span class="nc_l popupable" title="Int" data-title="<a href="#base_simple3__Int">Int</a>" data-content="<div><b>class</b> <span><a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">3</span><span>)</span>
+</span><span class="line" id="L56"><span class="nc_i popupable" title="call base_simple3$Sys$baz" data-title="<a href="#base_simple3___base_simple3__Sys___baz">call base_simple3$Sys$baz</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__Sys___baz">base_simple3$Sys$baz</a><span>: <a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span></span><br/></div>" data-toggle="popover">baz</span><span class="popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3___base_simple3__Int___output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__Int___output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">.</span><span class="nc_i popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3___base_simple3__Int___output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__Int___output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">output</span>
</span><span class="line" id="L57">
-</span><span class="line" id="L58"><span class="nc_k">var</span> <span class="nc_v nc_i">a</span> <span>=</span> <span class="nc_k">new</span> <span class="nc_t">A</span>
-</span><span class="line" id="L59"><span class="nc_v nc_i">a</span><span>.</span><span class="nc_i">run</span>
+</span><span class="line" id="L58"><span class="nc_k">var</span> <span class="nc_i nc_v popupable" title="a: A" data-content="<div><b>local var</b> <span>a:<a href="#base_simple3___base_simple3__A">base_simple3$A</a></span><br/></div>" data-toggle="popover">a</span> <span>=</span> <span class="nc_k popupable" title="call base_simple3$A$init" data-title="<a href="#base_simple3___base_simple3__A___Object__init">call base_simple3$A$init</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__A___Object__init">base_simple3$A$init</a><span></span></span><br/><b>intro</b> <span><a href="#base_simple3___base_simple3__Object___init">in base_simple3$Object</a></span><br/></div>" data-toggle="popover">new</span> <span class="nc_t popupable" title="A" data-title="<a href="#base_simple3__A">A</a>" data-content="<div><b>class</b> <span><a href="#base_simple3___base_simple3__A">base_simple3$A</a></span><br/></div>" data-toggle="popover">A</span>
+</span><span class="line" id="L59"><span class="nc_i nc_v popupable" title="a: A" data-content="<div><b>local var</b> <span>a:<a href="#base_simple3___base_simple3__A">base_simple3$A</a></span><br/></div>" data-toggle="popover">a</span><span class="popupable" title="call base_simple3$A$run" data-title="<a href="#base_simple3___base_simple3__A___run">call base_simple3$A$run</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__A___run">base_simple3$A$run</a><span></span></span><br/></div>" data-toggle="popover">.</span><span class="nc_i popupable" title="call base_simple3$A$run" data-title="<a href="#base_simple3___base_simple3__A___run">call base_simple3$A$run</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__A___run">base_simple3$A$run</a><span></span></span><br/></div>" data-toggle="popover">run</span>
</span><span class="line" id="L60">
-</span><span class="line" id="L61"><span class="nc_k">var</span> <span class="nc_v nc_i">b</span> <span>=</span> <span class="nc_k">new</span> <span class="nc_t">B</span><span>(</span><span class="nc_l">8</span><span>)</span>
-</span><span class="line" id="L62"><span class="nc_v nc_i">b</span><span>.</span><span class="nc_i">run</span>
+</span><span class="line" id="L61"><span class="nc_k">var</span> <span class="nc_i nc_v popupable" title="b: B" data-content="<div><b>local var</b> <span>b:<a href="#base_simple3___base_simple3__B">base_simple3$B</a></span><br/></div>" data-toggle="popover">b</span> <span>=</span> <span class="nc_k popupable" title="call base_simple3$B$init" data-title="<a href="#base_simple3___base_simple3__B___init">call base_simple3$B$init</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__B___init">base_simple3$B$init</a><span>(v: <a href="#base_simple3___base_simple3__Int">base_simple3$Int</a>)</span></span><br/></div>" data-toggle="popover">new</span> <span class="nc_t popupable" title="B" data-title="<a href="#base_simple3__B">B</a>" data-content="<div><b>class</b> <span><a href="#base_simple3___base_simple3__B">base_simple3$B</a></span><br/></div>" data-toggle="popover">B</span><span>(</span><span class="nc_l popupable" title="Int" data-title="<a href="#base_simple3__Int">Int</a>" data-content="<div><b>class</b> <span><a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">8</span><span>)</span>
+</span><span class="line" id="L62"><span class="nc_i nc_v popupable" title="b: B" data-content="<div><b>local var</b> <span>b:<a href="#base_simple3___base_simple3__B">base_simple3$B</a></span><br/></div>" data-toggle="popover">b</span><span class="popupable" title="call base_simple3$B$run" data-title="<a href="#base_simple3___base_simple3__B___run">call base_simple3$B$run</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__B___run">base_simple3$B$run</a><span></span></span><br/></div>" data-toggle="popover">.</span><span class="nc_i popupable" title="call base_simple3$B$run" data-title="<a href="#base_simple3___base_simple3__B___run">call base_simple3$B$run</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__B___run">base_simple3$B$run</a><span></span></span><br/></div>" data-toggle="popover">run</span>
</span><span class="line" id="L63">
-</span><span class="line" id="L64"><span class="nc_k">var</span> <span class="nc_v nc_i">c</span> <span>=</span> <span class="nc_k">new</span> <span class="nc_t">C</span><span>(</span><span class="nc_l">9</span><span>)</span>
-</span><span class="line" id="L65"><span class="nc_v nc_i">c</span><span>.</span><span class="nc_i">val1</span><span>.</span><span class="nc_i">output</span>
-</span><span class="line" id="L66"><span class="nc_v nc_i">c</span><span>.</span><span class="nc_i">val2</span><span>.</span><span class="nc_i">output</span></span></span></span></code></pre>
+</span><span class="line" id="L64"><span class="nc_k">var</span> <span class="nc_i nc_v popupable" title="c: C" data-content="<div><b>local var</b> <span>c:<a href="#base_simple3___base_simple3__C">base_simple3$C</a></span><br/></div>" data-toggle="popover">c</span> <span>=</span> <span class="nc_k popupable" title="call base_simple3$C$init" data-title="<a href="#base_simple3___base_simple3__C___Object__init">call base_simple3$C$init</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__C___Object__init">base_simple3$C$init</a><span>(val1: <a href="#base_simple3___base_simple3__Int">base_simple3$Int</a>)</span></span><br/><b>intro</b> <span><a href="#base_simple3___base_simple3__Object___init">in base_simple3$Object</a></span><br/></div>" data-toggle="popover">new</span> <span class="nc_t popupable" title="C" data-title="<a href="#base_simple3__C">C</a>" data-content="<div><b>class</b> <span><a href="#base_simple3___base_simple3__C">base_simple3$C</a></span><br/></div>" data-toggle="popover">C</span><span>(</span><span class="nc_l popupable" title="Int" data-title="<a href="#base_simple3__Int">Int</a>" data-content="<div><b>class</b> <span><a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">9</span><span>)</span>
+</span><span class="line" id="L65"><span class="nc_i nc_v popupable" title="c: C" data-content="<div><b>local var</b> <span>c:<a href="#base_simple3___base_simple3__C">base_simple3$C</a></span><br/></div>" data-toggle="popover">c</span><span class="popupable" title="call base_simple3$C$val1" data-title="<a href="#base_simple3___base_simple3__C___val1">call base_simple3$C$val1</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__C___val1">base_simple3$C$val1</a><span>: <a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span></span><br/></div>" data-toggle="popover">.</span><span class="nc_i popupable" title="call base_simple3$C$val1" data-title="<a href="#base_simple3___base_simple3__C___val1">call base_simple3$C$val1</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__C___val1">base_simple3$C$val1</a><span>: <a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span></span><br/></div>" data-toggle="popover">val1</span><span class="popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3___base_simple3__Int___output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__Int___output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">.</span><span class="nc_i popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3___base_simple3__Int___output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__Int___output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">output</span>
+</span><span class="line" id="L66"><span class="nc_i nc_v popupable" title="c: C" data-content="<div><b>local var</b> <span>c:<a href="#base_simple3___base_simple3__C">base_simple3$C</a></span><br/></div>" data-toggle="popover">c</span><span class="popupable" title="call base_simple3$C$val2" data-title="<a href="#base_simple3___base_simple3__C___val2">call base_simple3$C$val2</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__C___val2">base_simple3$C$val2</a><span>: <a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span></span><br/></div>" data-toggle="popover">.</span><span class="nc_i popupable" title="call base_simple3$C$val2" data-title="<a href="#base_simple3___base_simple3__C___val2">call base_simple3$C$val2</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__C___val2">base_simple3$C$val2</a><span>: <a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span></span><br/></div>" data-toggle="popover">val2</span><span class="popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3___base_simple3__Int___output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__Int___output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">.</span><span class="nc_i popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3___base_simple3__Int___output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__Int___output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">output</span></span></span></span></code></pre>
<h2>AST node: AModule at base_simple3.nit:17,1--66,13</h2>
<pre><code><span class="nitcode"><span class="line" id="L17"><span class="nc_k">import</span> <span class="nc_k">end</span>
</span><span class="line" id="L18">
-</span><span class="nc_cdef foldable" id="base_simple3$Object"><span class="line" id="L19"><span class="nc_k">interface</span> <span class="nc_t">Object</span>
+</span><span class="nc_cdef foldable" id="base_simple3$Object"><span class="line" id="L19"><span class="nc_k">interface</span> <span class="nc_t nc_def popupable" title="class Object" data-title="<a href="#base_simple3___base_simple3__Object">class Object</a>" data-content="<div><b>class</b> <span>Object</span><br/><div class="dropdown"> <a data-toggle="dropdown" href="#"><b>hier</b> sub-classes<span class="caret"></span></a><ul class="dropdown-menu" role="menu" aria-labelledby="dLabel"><li><a href="#base_simple3___base_simple3__Bool">base_simple3$Bool</a></li><li><a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></li><li><a href="#base_simple3___base_simple3__A">base_simple3$A</a></li><li><a href="#base_simple3___base_simple3__B">base_simple3$B</a></li><li><a href="#base_simple3___base_simple3__C">base_simple3$C</a></li><li><a href="#base_simple3___base_simple3__Sys">base_simple3$Sys</a></li></ul></div></div>" data-toggle="popover">Object</span>
</span><span class="line" id="L20"><span class="nc_k">end</span>
</span></span><span class="line" id="L21">
-</span><span class="nc_cdef foldable" id="base_simple3$Bool"><span class="line" id="L22"><span class="nc_k">enum</span> <span class="nc_t">Bool</span>
+</span><span class="nc_cdef foldable" id="base_simple3$Bool"><span class="line" id="L22"><span class="nc_k">enum</span> <span class="nc_t nc_def popupable" title="class Bool" data-title="<a href="#base_simple3___base_simple3__Bool">class Bool</a>" data-content="<div><b>class</b> <span>Bool</span><br/><div class="dropdown"> <a data-toggle="dropdown" href="#"><b>hier</b> super-classes<span class="caret"></span></a><ul class="dropdown-menu" role="menu" aria-labelledby="dLabel"><li><a href="#base_simple3___base_simple3__Object">base_simple3$Object</a></li></ul></div></div>" data-toggle="popover">Bool</span>
</span><span class="line" id="L23"><span class="nc_k">end</span>
</span></span><span class="line" id="L24">
-</span><span class="nc_cdef foldable" id="base_simple3$Int"><span class="line" id="L25"><span class="nc_k">enum</span> <span class="nc_t">Int</span>
-</span><span class="nc_pdef foldable" id="base_simple3$Int$output"><span class="line" id="L26"> <span class="nc_k">fun</span> <span class="nc_def popupable" title="base_simple3$Int$output" data-title="<a href="base_simple3.html#base_simple3$Int$output">base_simple3$Int$output</a>" data-content="<div><b>fun</b> <span>output<span></span></span><br/></div>" data-toggle="popover"><span class="nc_i">output</span></span> <span class="nc_k">is</span> <span class="nc_i">intern</span>
+</span><span class="nc_cdef foldable" id="base_simple3$Int"><span class="line" id="L25"><span class="nc_k">enum</span> <span class="nc_t nc_def popupable" title="class Int" data-title="<a href="#base_simple3___base_simple3__Int">class Int</a>" data-content="<div><b>class</b> <span>Int</span><br/><div class="dropdown"> <a data-toggle="dropdown" href="#"><b>hier</b> super-classes<span class="caret"></span></a><ul class="dropdown-menu" role="menu" aria-labelledby="dLabel"><li><a href="#base_simple3___base_simple3__Object">base_simple3$Object</a></li></ul></div></div>" data-toggle="popover">Int</span>
+</span><span class="nc_pdef foldable" id="base_simple3$Int$output"><span class="line" id="L26"> <span class="nc_k">fun</span> <span class="nc_def popupable" title="base_simple3$Int$output" data-title="<a href="#base_simple3___base_simple3__Int___output">base_simple3$Int$output</a>" data-content="<div><b>fun</b> <span>output<span></span></span><br/></div>" data-toggle="popover"><span class="nc_i">output</span></span> <span class="nc_k">is</span> <span class="nc_i">intern</span>
</span></span><span class="line" id="L27"><span class="nc_k">end</span>
</span></span><span class="line" id="L28">
-</span><span class="nc_cdef foldable" id="base_simple3$A"><span class="line" id="L29"><span class="nc_k">class</span> <span class="nc_t">A</span>
-</span><span class="nc_pdef foldable" id="base_simple3$A$init"><span class="line" id="L30"> <span class="nc_k">init</span> <span class="nc_k">do</span> <span class="nc_l">5</span><span>.</span><span class="nc_i">output</span>
-</span></span><span class="nc_pdef foldable" id="base_simple3$A$run"><span class="line" id="L31"> <span class="nc_k">fun</span> <span class="nc_def popupable" title="base_simple3$A$run" data-title="<a href="base_simple3.html#base_simple3$A$run">base_simple3$A$run</a>" data-content="<div><b>fun</b> <span>run<span></span></span><br/></div>" data-toggle="popover"><span class="nc_i">run</span></span> <span class="nc_k">do</span> <span class="nc_l">6</span><span>.</span><span class="nc_i">output</span>
+</span><span class="nc_cdef foldable" id="base_simple3$A"><span class="line" id="L29"><span class="nc_k">class</span> <span class="nc_t nc_def popupable" title="class A" data-title="<a href="#base_simple3___base_simple3__A">class A</a>" data-content="<div><b>class</b> <span>A</span><br/><div class="dropdown"> <a data-toggle="dropdown" href="#"><b>hier</b> super-classes<span class="caret"></span></a><ul class="dropdown-menu" role="menu" aria-labelledby="dLabel"><li><a href="#base_simple3___base_simple3__Object">base_simple3$Object</a></li></ul></div></div>" data-toggle="popover">A</span>
+</span><span class="nc_pdef foldable" id="base_simple3$A$init"><span class="line" id="L30"> <span class="nc_k">init</span> <span class="nc_k">do</span> <span class="nc_l popupable" title="Int" data-title="<a href="#base_simple3__Int">Int</a>" data-content="<div><b>class</b> <span><a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">5</span><span class="popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3___base_simple3__Int___output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__Int___output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">.</span><span class="nc_i popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3___base_simple3__Int___output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__Int___output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">output</span>
+</span></span><span class="nc_pdef foldable" id="base_simple3$A$run"><span class="line" id="L31"> <span class="nc_k">fun</span> <span class="nc_def popupable" title="base_simple3$A$run" data-title="<a href="#base_simple3___base_simple3__A___run">base_simple3$A$run</a>" data-content="<div><b>fun</b> <span>run<span></span></span><br/></div>" data-toggle="popover"><span class="nc_i">run</span></span> <span class="nc_k">do</span> <span class="nc_l popupable" title="Int" data-title="<a href="#base_simple3__Int">Int</a>" data-content="<div><b>class</b> <span><a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">6</span><span class="popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3___base_simple3__Int___output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__Int___output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">.</span><span class="nc_i popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3___base_simple3__Int___output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__Int___output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">output</span>
</span></span><span class="line" id="L32"><span class="nc_k">end</span>
</span></span><span class="line" id="L33">
-</span><span class="nc_cdef foldable" id="base_simple3$B"><span class="line" id="L34"><span class="nc_k">class</span> <span class="nc_t">B</span>
-</span><span class="nc_pdef foldable" id="base_simple3$B$_val"><a id="base_simple3$B$val"></a><a id="base_simple3$B$val="></a><span class="line" id="L35"> <span class="nc_k">var</span> <span class="nc_def nc_i">val</span><span>:</span> <span class="nc_t">Int</span>
-</span></span><span class="nc_pdef foldable" id="base_simple3$B$init"><span class="line" id="L36"> <span class="nc_k popupable" style="border-bottom: solid 2px red" title="Messages" data-content="<div><div class="dropdown"> <a data-toggle="dropdown" href="#"><b>1 message(s)</b> <span class="caret"></span></a><ul class="dropdown-menu" role="menu" aria-labelledby="dLabel"><li>Warning: init with signature in base_simple3$B</li></ul></div></div>" data-toggle="popover">init</span><span>(</span><span class="nc_v nc_i">v</span><span>:</span> <span class="nc_t">Int</span><span>)</span>
+</span><span class="nc_cdef foldable" id="base_simple3$B"><span class="line" id="L34"><span class="nc_k">class</span> <span class="nc_t nc_def popupable" title="class B" data-title="<a href="#base_simple3___base_simple3__B">class B</a>" data-content="<div><b>class</b> <span>B</span><br/><div class="dropdown"> <a data-toggle="dropdown" href="#"><b>hier</b> super-classes<span class="caret"></span></a><ul class="dropdown-menu" role="menu" aria-labelledby="dLabel"><li><a href="#base_simple3___base_simple3__Object">base_simple3$Object</a></li></ul></div></div>" data-toggle="popover">B</span>
+</span><span class="nc_pdef foldable" id="base_simple3$B$_val"><a id="base_simple3$B$val"></a><a id="base_simple3$B$val="></a><span class="line" id="L35"> <span class="nc_k">var</span> <span class="nc_i nc_def popupable" title="base_simple3$B$val" data-title="<a href="#base_simple3___base_simple3__B___val">base_simple3$B$val</a>" data-content="<div><b>fun</b> <span>val<span>: <a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span></span><br/></div>" data-toggle="popover">val</span><span>:</span> <span class="nc_t popupable" title="Int" data-title="<a href="#base_simple3__Int">Int</a>" data-content="<div><b>class</b> <span><a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">Int</span>
+</span></span><span class="nc_pdef foldable" id="base_simple3$B$init"><span class="line" id="L36"> <span class="nc_k popupable" style="border-bottom: solid 2px red" title="Messages" data-content="<div><div class="dropdown"> <a data-toggle="dropdown" href="#"><b>1 message(s)</b> <span class="caret"></span></a><ul class="dropdown-menu" role="menu" aria-labelledby="dLabel"><li>Warning: init with signature in base_simple3$B</li></ul></div></div>" data-toggle="popover">init</span><span>(</span><span class="nc_i nc_v popupable" title="v: Int" data-content="<div><b>local var</b> <span>v:<a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">v</span><span>:</span> <span class="nc_t popupable" title="Int" data-title="<a href="#base_simple3__Int">Int</a>" data-content="<div><b>class</b> <span><a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">Int</span><span>)</span>
</span><span class="line" id="L37"> <span class="nc_k">do</span>
-</span><span class="line" id="L38"> <span class="nc_l">7</span><span>.</span><span class="nc_i">output</span>
-</span><span class="line" id="L39"> <span class="nc_k">self</span><span>.</span><span class="nc_i">val</span> <span>=</span> <span class="nc_v nc_i">v</span>
+</span><span class="line" id="L38"> <span class="nc_l popupable" title="Int" data-title="<a href="#base_simple3__Int">Int</a>" data-content="<div><b>class</b> <span><a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">7</span><span class="popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3___base_simple3__Int___output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__Int___output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">.</span><span class="nc_i popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3___base_simple3__Int___output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__Int___output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">output</span>
+</span><span class="line" id="L39"> <span class="nc_k popupable" title="B" data-title="<a href="#base_simple3__B">B</a>" data-content="<div><b>class</b> <span><a href="#base_simple3___base_simple3__B">base_simple3$B</a></span><br/></div>" data-toggle="popover">self</span><span class="popupable" title="call base_simple3$B$val=" data-title="<a href="#base_simple3___base_simple3__B___val_61d">call base_simple3$B$val=</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__B___val_61d">base_simple3$B$val=</a><span>(val: <a href="#base_simple3___base_simple3__Int">base_simple3$Int</a>)</span></span><br/></div>" data-toggle="popover">.</span><span class="nc_i popupable" title="call base_simple3$B$val=" data-title="<a href="#base_simple3___base_simple3__B___val_61d">call base_simple3$B$val=</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__B___val_61d">base_simple3$B$val=</a><span>(val: <a href="#base_simple3___base_simple3__Int">base_simple3$Int</a>)</span></span><br/></div>" data-toggle="popover">val</span> <span class="popupable" title="call base_simple3$B$val=" data-title="<a href="#base_simple3___base_simple3__B___val_61d">call base_simple3$B$val=</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__B___val_61d">base_simple3$B$val=</a><span>(val: <a href="#base_simple3___base_simple3__Int">base_simple3$Int</a>)</span></span><br/></div>" data-toggle="popover">=</span> <span class="nc_i nc_v popupable" title="v: Int" data-content="<div><b>local var</b> <span>v:<a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">v</span>
</span><span class="line" id="L40"> <span class="nc_k">end</span>
-</span></span><span class="nc_pdef foldable" id="base_simple3$B$run"><span class="line" id="L41"> <span class="nc_k">fun</span> <span class="nc_def popupable" title="base_simple3$B$run" data-title="<a href="base_simple3.html#base_simple3$B$run">base_simple3$B$run</a>" data-content="<div><b>fun</b> <span>run<span></span></span><br/></div>" data-toggle="popover"><span class="nc_i">run</span></span> <span class="nc_k">do</span> <span class="nc_i">val</span><span>.</span><span class="nc_i">output</span>
+</span></span><span class="nc_pdef foldable" id="base_simple3$B$run"><span class="line" id="L41"> <span class="nc_k">fun</span> <span class="nc_def popupable" title="base_simple3$B$run" data-title="<a href="#base_simple3___base_simple3__B___run">base_simple3$B$run</a>" data-content="<div><b>fun</b> <span>run<span></span></span><br/></div>" data-toggle="popover"><span class="nc_i">run</span></span> <span class="nc_k">do</span> <span class="nc_i popupable" title="call base_simple3$B$val" data-title="<a href="#base_simple3___base_simple3__B___val">call base_simple3$B$val</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__B___val">base_simple3$B$val</a><span>: <a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span></span><br/></div>" data-toggle="popover">val</span><span class="popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3___base_simple3__Int___output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__Int___output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">.</span><span class="nc_i popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3___base_simple3__Int___output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__Int___output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">output</span>
</span></span><span class="line" id="L42"><span class="nc_k">end</span>
</span></span><span class="line" id="L43">
-</span><span class="nc_cdef foldable" id="base_simple3$C"><span class="line" id="L44"><span class="nc_k">class</span> <span class="nc_t">C</span>
-</span><span class="nc_pdef foldable" id="base_simple3$C$_val1"><a id="base_simple3$C$val1"></a><a id="base_simple3$C$val1="></a><span class="line" id="L45"> <span class="nc_k">var</span> <span class="nc_def nc_i">val1</span><span>:</span> <span class="nc_t">Int</span>
-</span></span><span class="nc_pdef foldable" id="base_simple3$C$_val2"><a id="base_simple3$C$val2"></a><a id="base_simple3$C$val2="></a><span class="line" id="L46"> <span class="nc_k">var</span> <span class="nc_def nc_i">val2</span><span>:</span> <span class="nc_t">Int</span> <span>=</span> <span class="nc_l">10</span>
+</span><span class="nc_cdef foldable" id="base_simple3$C"><span class="line" id="L44"><span class="nc_k">class</span> <span class="nc_t nc_def popupable" title="class C" data-title="<a href="#base_simple3___base_simple3__C">class C</a>" data-content="<div><b>class</b> <span>C</span><br/><div class="dropdown"> <a data-toggle="dropdown" href="#"><b>hier</b> super-classes<span class="caret"></span></a><ul class="dropdown-menu" role="menu" aria-labelledby="dLabel"><li><a href="#base_simple3___base_simple3__Object">base_simple3$Object</a></li></ul></div></div>" data-toggle="popover">C</span>
+</span><span class="nc_pdef foldable" id="base_simple3$C$_val1"><a id="base_simple3$C$val1"></a><a id="base_simple3$C$val1="></a><span class="line" id="L45"> <span class="nc_k">var</span> <span class="nc_i nc_def popupable" title="base_simple3$C$val1" data-title="<a href="#base_simple3___base_simple3__C___val1">base_simple3$C$val1</a>" data-content="<div><b>fun</b> <span>val1<span>: <a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span></span><br/></div>" data-toggle="popover">val1</span><span>:</span> <span class="nc_t popupable" title="Int" data-title="<a href="#base_simple3__Int">Int</a>" data-content="<div><b>class</b> <span><a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">Int</span>
+</span></span><span class="nc_pdef foldable" id="base_simple3$C$_val2"><a id="base_simple3$C$val2"></a><a id="base_simple3$C$val2="></a><span class="line" id="L46"> <span class="nc_k">var</span> <span class="nc_i nc_def popupable" title="base_simple3$C$val2" data-title="<a href="#base_simple3___base_simple3__C___val2">base_simple3$C$val2</a>" data-content="<div><b>fun</b> <span>val2<span>: <a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span></span><br/></div>" data-toggle="popover">val2</span><span>:</span> <span class="nc_t popupable" title="Int" data-title="<a href="#base_simple3__Int">Int</a>" data-content="<div><b>class</b> <span><a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">Int</span> <span>=</span> <span class="nc_l popupable" title="Int" data-title="<a href="#base_simple3__Int">Int</a>" data-content="<div><b>class</b> <span><a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">10</span>
</span></span><span class="line" id="L47"><span class="nc_k">end</span>
</span></span><span class="line" id="L48">
-</span><span class="nc_pdef foldable" id="base_simple3$Sys$foo"><span class="line" id="L49"><span class="nc_k">fun</span> <span class="nc_def popupable" title="base_simple3$Sys$foo" data-title="<a href="base_simple3.html#base_simple3$Sys$foo">base_simple3$Sys$foo</a>" data-content="<div><b>fun</b> <span>foo<span></span></span><br/></div>" data-toggle="popover"><span class="nc_i">foo</span></span> <span class="nc_k">do</span> <span class="nc_l">2</span><span>.</span><span class="nc_i">output</span>
-</span></span><span class="nc_pdef foldable" id="base_simple3$Sys$bar"><span class="line" id="L50"><span class="nc_k">fun</span> <span class="nc_def popupable" title="base_simple3$Sys$bar" data-title="<a href="base_simple3.html#base_simple3$Sys$bar">base_simple3$Sys$bar</a>" data-content="<div><b>fun</b> <span>bar<span>(i: <a href="base_simple3.html#base_simple3$Int">Int</a>)</span></span><br/></div>" data-toggle="popover"><span class="nc_i">bar</span></span><span>(</span><span class="nc_v nc_i">i</span><span>:</span> <span class="nc_t">Int</span><span>)</span> <span class="nc_k">do</span> <span class="nc_v nc_i">i</span><span>.</span><span class="nc_i">output</span>
-</span></span><span class="nc_pdef foldable" id="base_simple3$Sys$baz"><span class="line" id="L51"><span class="nc_k">fun</span> <span class="nc_def popupable" title="base_simple3$Sys$baz" data-title="<a href="base_simple3.html#base_simple3$Sys$baz">base_simple3$Sys$baz</a>" data-content="<div><b>fun</b> <span>baz<span>: <a href="base_simple3.html#base_simple3$Int">Int</a></span></span><br/></div>" data-toggle="popover"><span class="nc_i">baz</span></span><span>:</span> <span class="nc_t">Int</span> <span class="nc_k">do</span> <span class="nc_k">return</span> <span class="nc_l">4</span>
+</span><span class="nc_pdef foldable" id="base_simple3$Sys$foo"><span class="line" id="L49"><span class="nc_k">fun</span> <span class="nc_def popupable" title="base_simple3$Sys$foo" data-title="<a href="#base_simple3___base_simple3__Sys___foo">base_simple3$Sys$foo</a>" data-content="<div><b>fun</b> <span>foo<span></span></span><br/></div>" data-toggle="popover"><span class="nc_i">foo</span></span> <span class="nc_k">do</span> <span class="nc_l popupable" title="Int" data-title="<a href="#base_simple3__Int">Int</a>" data-content="<div><b>class</b> <span><a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">2</span><span class="popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3___base_simple3__Int___output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__Int___output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">.</span><span class="nc_i popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3___base_simple3__Int___output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__Int___output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">output</span>
+</span></span><span class="nc_pdef foldable" id="base_simple3$Sys$bar"><span class="line" id="L50"><span class="nc_k">fun</span> <span class="nc_def popupable" title="base_simple3$Sys$bar" data-title="<a href="#base_simple3___base_simple3__Sys___bar">base_simple3$Sys$bar</a>" data-content="<div><b>fun</b> <span>bar<span>(i: <a href="#base_simple3___base_simple3__Int">base_simple3$Int</a>)</span></span><br/></div>" data-toggle="popover"><span class="nc_i">bar</span></span><span>(</span><span class="nc_i nc_v popupable" title="i: Int" data-content="<div><b>local var</b> <span>i:<a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">i</span><span>:</span> <span class="nc_t popupable" title="Int" data-title="<a href="#base_simple3__Int">Int</a>" data-content="<div><b>class</b> <span><a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">Int</span><span>)</span> <span class="nc_k">do</span> <span class="nc_i nc_v popupable" title="i: Int" data-content="<div><b>local var</b> <span>i:<a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">i</span><span class="popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3___base_simple3__Int___output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__Int___output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">.</span><span class="nc_i popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3___base_simple3__Int___output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__Int___output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">output</span>
+</span></span><span class="nc_pdef foldable" id="base_simple3$Sys$baz"><span class="line" id="L51"><span class="nc_k">fun</span> <span class="nc_def popupable" title="base_simple3$Sys$baz" data-title="<a href="#base_simple3___base_simple3__Sys___baz">base_simple3$Sys$baz</a>" data-content="<div><b>fun</b> <span>baz<span>: <a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span></span><br/></div>" data-toggle="popover"><span class="nc_i">baz</span></span><span>:</span> <span class="nc_t popupable" title="Int" data-title="<a href="#base_simple3__Int">Int</a>" data-content="<div><b>class</b> <span><a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">Int</span> <span class="nc_k">do</span> <span class="nc_k">return</span> <span class="nc_l popupable" title="Int" data-title="<a href="#base_simple3__Int">Int</a>" data-content="<div><b>class</b> <span><a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">4</span>
</span></span><span class="line" id="L52">
-</span><span class="nc_pdef foldable" id="base_simple3$Sys$main"><span class="line" id="L53"><span class="nc_l">1</span><span>.</span><span class="nc_i">output</span>
-</span><span class="line" id="L54"><span class="nc_i">foo</span>
-</span><span class="line" id="L55"><span class="nc_i">bar</span><span>(</span><span class="nc_l">3</span><span>)</span>
-</span><span class="line" id="L56"><span class="nc_i">baz</span><span>.</span><span class="nc_i">output</span>
+</span><span class="nc_pdef foldable" id="base_simple3$Sys$main"><span class="line" id="L53"><span class="nc_l popupable" title="Int" data-title="<a href="#base_simple3__Int">Int</a>" data-content="<div><b>class</b> <span><a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">1</span><span class="popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3___base_simple3__Int___output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__Int___output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">.</span><span class="nc_i popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3___base_simple3__Int___output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__Int___output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">output</span>
+</span><span class="line" id="L54"><span class="nc_i popupable" title="call base_simple3$Sys$foo" data-title="<a href="#base_simple3___base_simple3__Sys___foo">call base_simple3$Sys$foo</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__Sys___foo">base_simple3$Sys$foo</a><span></span></span><br/></div>" data-toggle="popover">foo</span>
+</span><span class="line" id="L55"><span class="nc_i popupable" title="call base_simple3$Sys$bar" data-title="<a href="#base_simple3___base_simple3__Sys___bar">call base_simple3$Sys$bar</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__Sys___bar">base_simple3$Sys$bar</a><span>(i: <a href="#base_simple3___base_simple3__Int">base_simple3$Int</a>)</span></span><br/></div>" data-toggle="popover">bar</span><span>(</span><span class="nc_l popupable" title="Int" data-title="<a href="#base_simple3__Int">Int</a>" data-content="<div><b>class</b> <span><a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">3</span><span>)</span>
+</span><span class="line" id="L56"><span class="nc_i popupable" title="call base_simple3$Sys$baz" data-title="<a href="#base_simple3___base_simple3__Sys___baz">call base_simple3$Sys$baz</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__Sys___baz">base_simple3$Sys$baz</a><span>: <a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span></span><br/></div>" data-toggle="popover">baz</span><span class="popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3___base_simple3__Int___output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__Int___output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">.</span><span class="nc_i popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3___base_simple3__Int___output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__Int___output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">output</span>
</span><span class="line" id="L57">
-</span><span class="line" id="L58"><span class="nc_k">var</span> <span class="nc_v nc_i">a</span> <span>=</span> <span class="nc_k">new</span> <span class="nc_t">A</span>
-</span><span class="line" id="L59"><span class="nc_v nc_i">a</span><span>.</span><span class="nc_i">run</span>
+</span><span class="line" id="L58"><span class="nc_k">var</span> <span class="nc_i nc_v popupable" title="a: A" data-content="<div><b>local var</b> <span>a:<a href="#base_simple3___base_simple3__A">base_simple3$A</a></span><br/></div>" data-toggle="popover">a</span> <span>=</span> <span class="nc_k popupable" title="call base_simple3$A$init" data-title="<a href="#base_simple3___base_simple3__A___Object__init">call base_simple3$A$init</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__A___Object__init">base_simple3$A$init</a><span></span></span><br/><b>intro</b> <span><a href="#base_simple3___base_simple3__Object___init">in base_simple3$Object</a></span><br/></div>" data-toggle="popover">new</span> <span class="nc_t popupable" title="A" data-title="<a href="#base_simple3__A">A</a>" data-content="<div><b>class</b> <span><a href="#base_simple3___base_simple3__A">base_simple3$A</a></span><br/></div>" data-toggle="popover">A</span>
+</span><span class="line" id="L59"><span class="nc_i nc_v popupable" title="a: A" data-content="<div><b>local var</b> <span>a:<a href="#base_simple3___base_simple3__A">base_simple3$A</a></span><br/></div>" data-toggle="popover">a</span><span class="popupable" title="call base_simple3$A$run" data-title="<a href="#base_simple3___base_simple3__A___run">call base_simple3$A$run</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__A___run">base_simple3$A$run</a><span></span></span><br/></div>" data-toggle="popover">.</span><span class="nc_i popupable" title="call base_simple3$A$run" data-title="<a href="#base_simple3___base_simple3__A___run">call base_simple3$A$run</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__A___run">base_simple3$A$run</a><span></span></span><br/></div>" data-toggle="popover">run</span>
</span><span class="line" id="L60">
-</span><span class="line" id="L61"><span class="nc_k">var</span> <span class="nc_v nc_i">b</span> <span>=</span> <span class="nc_k">new</span> <span class="nc_t">B</span><span>(</span><span class="nc_l">8</span><span>)</span>
-</span><span class="line" id="L62"><span class="nc_v nc_i">b</span><span>.</span><span class="nc_i">run</span>
+</span><span class="line" id="L61"><span class="nc_k">var</span> <span class="nc_i nc_v popupable" title="b: B" data-content="<div><b>local var</b> <span>b:<a href="#base_simple3___base_simple3__B">base_simple3$B</a></span><br/></div>" data-toggle="popover">b</span> <span>=</span> <span class="nc_k popupable" title="call base_simple3$B$init" data-title="<a href="#base_simple3___base_simple3__B___init">call base_simple3$B$init</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__B___init">base_simple3$B$init</a><span>(v: <a href="#base_simple3___base_simple3__Int">base_simple3$Int</a>)</span></span><br/></div>" data-toggle="popover">new</span> <span class="nc_t popupable" title="B" data-title="<a href="#base_simple3__B">B</a>" data-content="<div><b>class</b> <span><a href="#base_simple3___base_simple3__B">base_simple3$B</a></span><br/></div>" data-toggle="popover">B</span><span>(</span><span class="nc_l popupable" title="Int" data-title="<a href="#base_simple3__Int">Int</a>" data-content="<div><b>class</b> <span><a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">8</span><span>)</span>
+</span><span class="line" id="L62"><span class="nc_i nc_v popupable" title="b: B" data-content="<div><b>local var</b> <span>b:<a href="#base_simple3___base_simple3__B">base_simple3$B</a></span><br/></div>" data-toggle="popover">b</span><span class="popupable" title="call base_simple3$B$run" data-title="<a href="#base_simple3___base_simple3__B___run">call base_simple3$B$run</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__B___run">base_simple3$B$run</a><span></span></span><br/></div>" data-toggle="popover">.</span><span class="nc_i popupable" title="call base_simple3$B$run" data-title="<a href="#base_simple3___base_simple3__B___run">call base_simple3$B$run</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__B___run">base_simple3$B$run</a><span></span></span><br/></div>" data-toggle="popover">run</span>
</span><span class="line" id="L63">
-</span><span class="line" id="L64"><span class="nc_k">var</span> <span class="nc_v nc_i">c</span> <span>=</span> <span class="nc_k">new</span> <span class="nc_t">C</span><span>(</span><span class="nc_l">9</span><span>)</span>
-</span><span class="line" id="L65"><span class="nc_v nc_i">c</span><span>.</span><span class="nc_i">val1</span><span>.</span><span class="nc_i">output</span>
-</span><span class="line" id="L66"><span class="nc_v nc_i">c</span><span>.</span><span class="nc_i">val2</span><span>.</span><span class="nc_i">output</span></span></span></span></code></pre>
+</span><span class="line" id="L64"><span class="nc_k">var</span> <span class="nc_i nc_v popupable" title="c: C" data-content="<div><b>local var</b> <span>c:<a href="#base_simple3___base_simple3__C">base_simple3$C</a></span><br/></div>" data-toggle="popover">c</span> <span>=</span> <span class="nc_k popupable" title="call base_simple3$C$init" data-title="<a href="#base_simple3___base_simple3__C___Object__init">call base_simple3$C$init</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__C___Object__init">base_simple3$C$init</a><span>(val1: <a href="#base_simple3___base_simple3__Int">base_simple3$Int</a>)</span></span><br/><b>intro</b> <span><a href="#base_simple3___base_simple3__Object___init">in base_simple3$Object</a></span><br/></div>" data-toggle="popover">new</span> <span class="nc_t popupable" title="C" data-title="<a href="#base_simple3__C">C</a>" data-content="<div><b>class</b> <span><a href="#base_simple3___base_simple3__C">base_simple3$C</a></span><br/></div>" data-toggle="popover">C</span><span>(</span><span class="nc_l popupable" title="Int" data-title="<a href="#base_simple3__Int">Int</a>" data-content="<div><b>class</b> <span><a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span><br/></div>" data-toggle="popover">9</span><span>)</span>
+</span><span class="line" id="L65"><span class="nc_i nc_v popupable" title="c: C" data-content="<div><b>local var</b> <span>c:<a href="#base_simple3___base_simple3__C">base_simple3$C</a></span><br/></div>" data-toggle="popover">c</span><span class="popupable" title="call base_simple3$C$val1" data-title="<a href="#base_simple3___base_simple3__C___val1">call base_simple3$C$val1</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__C___val1">base_simple3$C$val1</a><span>: <a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span></span><br/></div>" data-toggle="popover">.</span><span class="nc_i popupable" title="call base_simple3$C$val1" data-title="<a href="#base_simple3___base_simple3__C___val1">call base_simple3$C$val1</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__C___val1">base_simple3$C$val1</a><span>: <a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span></span><br/></div>" data-toggle="popover">val1</span><span class="popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3___base_simple3__Int___output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__Int___output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">.</span><span class="nc_i popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3___base_simple3__Int___output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__Int___output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">output</span>
+</span><span class="line" id="L66"><span class="nc_i nc_v popupable" title="c: C" data-content="<div><b>local var</b> <span>c:<a href="#base_simple3___base_simple3__C">base_simple3$C</a></span><br/></div>" data-toggle="popover">c</span><span class="popupable" title="call base_simple3$C$val2" data-title="<a href="#base_simple3___base_simple3__C___val2">call base_simple3$C$val2</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__C___val2">base_simple3$C$val2</a><span>: <a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span></span><br/></div>" data-toggle="popover">.</span><span class="nc_i popupable" title="call base_simple3$C$val2" data-title="<a href="#base_simple3___base_simple3__C___val2">call base_simple3$C$val2</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__C___val2">base_simple3$C$val2</a><span>: <a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></span></span><br/></div>" data-toggle="popover">val2</span><span class="popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3___base_simple3__Int___output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__Int___output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">.</span><span class="nc_i popupable" title="call base_simple3$Int$output" data-title="<a href="#base_simple3___base_simple3__Int___output">call base_simple3$Int$output</a>" data-content="<div><b>call</b> <span><a href="#base_simple3___base_simple3__Int___output">base_simple3$Int$output</a><span></span></span><br/></div>" data-toggle="popover">output</span></span></span></span></code></pre>
<h2>AST node: ANoImport at base_simple3.nit:17,1--10</h2>
<pre><code><span class="nitcode"><span class="line" id="L17"><span class="nc_k">import</span> <span class="nc_k">end</span></span></span></code></pre>
<h2>AST node: APublicVisibility at base_simple3.nit:17,1</h2>
<h2>AST node: TKwend at base_simple3.nit:17,8--10</h2>
<pre><code><span class="nitcode"><span class="line" id="L17"> <span class="nc_k">end</span></span></span></code></pre>
<h2>AST node: AStdClassdef at base_simple3.nit:19,1--20,3</h2>
-<pre><code><span class="nitcode"><span class="nc_cdef foldable" id="base_simple3$Object"><span class="line" id="L19"><span class="nc_k">interface</span> <span class="nc_t">Object</span>
+<pre><code><span class="nitcode"><span class="nc_cdef foldable" id="base_simple3$Object"><span class="line" id="L19"><span class="nc_k">interface</span> <span class="nc_t nc_def popupable" title="class Object" data-title="<a href="#base_simple3___base_simple3__Object">class Object</a>" data-content="<div><b>class</b> <span>Object</span><br/><div class="dropdown"> <a data-toggle="dropdown" href="#"><b>hier</b> sub-classes<span class="caret"></span></a><ul class="dropdown-menu" role="menu" aria-labelledby="dLabel"><li><a href="#base_simple3___base_simple3__Bool">base_simple3$Bool</a></li><li><a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></li><li><a href="#base_simple3___base_simple3__A">base_simple3$A</a></li><li><a href="#base_simple3___base_simple3__B">base_simple3$B</a></li><li><a href="#base_simple3___base_simple3__C">base_simple3$C</a></li><li><a href="#base_simple3___base_simple3__Sys">base_simple3$Sys</a></li></ul></div></div>" data-toggle="popover">Object</span>
</span><span class="line" id="L20"><span class="nc_k">end</span></span></span></span></code></pre>
<h2>AST node: AInterfaceClasskind at base_simple3.nit:19,1--9</h2>
<pre><code><span class="nitcode"><span class="line" id="L19"><span class="nc_k">interface</span></span></span></code></pre>
<h2>AST node: TKwinterface at base_simple3.nit:19,1--9</h2>
<pre><code><span class="nitcode"><span class="line" id="L19"><span class="nc_k">interface</span></span></span></code></pre>
<h2>AST node: AQclassid at base_simple3.nit:19,11--16</h2>
-<pre><code><span class="nitcode"><span class="line" id="L19"> <span class="nc_t">Object</span></span></span></code></pre>
+<pre><code><span class="nitcode"><span class="line" id="L19"> <span class="nc_t nc_def popupable" title="class Object" data-title="<a href="#base_simple3___base_simple3__Object">class Object</a>" data-content="<div><b>class</b> <span>Object</span><br/><div class="dropdown"> <a data-toggle="dropdown" href="#"><b>hier</b> sub-classes<span class="caret"></span></a><ul class="dropdown-menu" role="menu" aria-labelledby="dLabel"><li><a href="#base_simple3___base_simple3__Bool">base_simple3$Bool</a></li><li><a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></li><li><a href="#base_simple3___base_simple3__A">base_simple3$A</a></li><li><a href="#base_simple3___base_simple3__B">base_simple3$B</a></li><li><a href="#base_simple3___base_simple3__C">base_simple3$C</a></li><li><a href="#base_simple3___base_simple3__Sys">base_simple3$Sys</a></li></ul></div></div>" data-toggle="popover">Object</span></span></span></code></pre>
<h2>AST node: TClassid at base_simple3.nit:19,11--16</h2>
-<pre><code><span class="nitcode"><span class="line" id="L19"> <span class="nc_t">Object</span></span></span></code></pre>
+<pre><code><span class="nitcode"><span class="line" id="L19"> <span class="nc_t nc_def popupable" title="class Object" data-title="<a href="#base_simple3___base_simple3__Object">class Object</a>" data-content="<div><b>class</b> <span>Object</span><br/><div class="dropdown"> <a data-toggle="dropdown" href="#"><b>hier</b> sub-classes<span class="caret"></span></a><ul class="dropdown-menu" role="menu" aria-labelledby="dLabel"><li><a href="#base_simple3___base_simple3__Bool">base_simple3$Bool</a></li><li><a href="#base_simple3___base_simple3__Int">base_simple3$Int</a></li><li><a href="#base_simple3___base_simple3__A">base_simple3$A</a></li><li><a href="#base_simple3___base_simple3__B">base_simple3$B</a></li><li><a href="#base_simple3___base_simple3__C">base_simple3$C</a></li><li><a href="#base_simple3___base_simple3__Sys">base_simple3$Sys</a></li></ul></div></div>" data-toggle="popover">Object</span></span></span></code></pre>
<h2>AST node: AEnumClasskind at base_simple3.nit:22,1--4</h2>
<pre><code><span class="nitcode"><span class="line" id="L22"><span class="nc_k">enum</span></span></span></code></pre>
<h2>AST node: TKwenum at base_simple3.nit:22,1--4</h2>
<pre><code><span class="nitcode"><span class="line" id="L22"><span class="nc_k">enum</span></span></span></code></pre>
<h2>AST node: AMethPropdef at base_simple3.nit:26,2--21</h2>
-<pre><code><span class="nitcode"><span class="nc_pdef foldable" id="base_simple3$Int$output"><span class="line" id="L26"> <span class="nc_k">fun</span> <span class="nc_def popupable" title="base_simple3$Int$output" data-title="<a href="base_simple3.html#base_simple3$Int$output">base_simple3$Int$output</a>" data-content="<div><b>fun</b> <span>output<span></span></span><br/></div>" data-toggle="popover"><span class="nc_i">output</span></span> <span class="nc_k">is</span> <span class="nc_i">intern</span></span></span></span></code></pre>
+<pre><code><span class="nitcode"><span class="nc_pdef foldable" id="base_simple3$Int$output"><span class="line" id="L26"> <span class="nc_k">fun</span> <span class="nc_def popupable" title="base_simple3$Int$output" data-title="<a href="#base_simple3___base_simple3__Int___output">base_simple3$Int$output</a>" data-content="<div><b>fun</b> <span>output<span></span></span><br/></div>" data-toggle="popover"><span class="nc_i">output</span></span> <span class="nc_k">is</span> <span class="nc_i">intern</span></span></span></span></code></pre>
<h2>AST node: TKwmeth at base_simple3.nit:26,2--4</h2>
<pre><code><span class="nc_pdef foldable" id="base_simple3$Int$output"><span class="line" id="L26"> <span class="nc_k">fun</span></span></span></code></pre>
<h2>AST node: AIdMethid at base_simple3.nit:26,6--11</h2>
-<pre><code><span class="nitcode"><span class="nc_def popupable foldable" title="base_simple3$Int$output" data-title="<a href="base_simple3.html#base_simple3$Int$output">base_simple3$Int$output</a>" data-content="<div><b>fun</b> <span>output<span></span></span><br/></div>" data-toggle="popover"><span class="line" id="L26"> <span class="nc_i">output</span></span></span></span></code></pre>
+<pre><code><span class="nitcode"><span class="nc_def popupable foldable" title="base_simple3$Int$output" data-title="<a href="#base_simple3___base_simple3__Int___output">base_simple3$Int$output</a>" data-content="<div><b>fun</b> <span>output<span></span></span><br/></div>" data-toggle="popover"><span class="line" id="L26"> <span class="nc_i">output</span></span></span></span></code></pre>
<h2>AST node: TId at base_simple3.nit:26,6--11</h2>
-<pre><code><span class="nitcode"><span class="nc_def popupable foldable" title="base_simple3$Int$output" data-title="<a href="base_simple3.html#base_simple3$Int$output">base_simple3$Int$output</a>" data-content="<div><b>fun</b> <span>output<span></span></span><br/></div>" data-toggle="popover"><span class="line" id="L26"> <span class="nc_i">output</span></span></span></span></code></pre>
+<pre><code><span class="nitcode"><span class="nc_def popupable foldable" title="base_simple3$Int$output" data-title="<a href="#base_simple3___base_simple3__Int___output">base_simple3$Int$output</a>" data-content="<div><b>fun</b> <span>output<span></span></span><br/></div>" data-toggle="popover"><span class="line" id="L26"> <span class="nc_i">output</span></span></span></span></code></pre>
<h2>AST node: ASignature at base_simple3.nit:26,13</h2>
<pre><code><span class="nitcode"></span></code></pre>
<h2>AST node: AAnnotations at base_simple3.nit:26,13--21</h2>
<pre><code><span class="nitcode"><span class="line" id="L29"><span class="nc_k">class</span></span></span></code></pre>
<h2>AST node: TKwinit at base_simple3.nit:30,2--5</h2>
<pre><code><span class="nc_pdef foldable" id="base_simple3$A$init"><span class="line" id="L30"> <span class="nc_k">init</span></span></span></code></pre>
-<h2>AST node: TKwdo at base_simple3.nit:30,7--8</h2>
-<pre><code><span class="nitcode"><span class="line" id="L30"> <span class="nc_k">do</span></span></span></code></pre>
-<h2>AST node: ACallExpr at base_simple3.nit:30,10--17</h2>
-<pre><code><span class="nitcode"><span class="line" id="L30"> <span class="nc_l">5</span><span>.</span><span class="nc_i">output</span></span></span></code></pre>
-<h2>AST node: AIntegerExpr at base_simple3.nit:30,10</h2>
-<pre><code><span class="nitcode"><span class="line" id="L30"> <span class="nc_l">5</span></span></span></code></pre>
-<h2>AST node: TInteger at base_simple3.nit:30,10</h2>
-<pre><code><span class="nitcode"><span class="line" id="L30"> <span class="nc_l">5</span></span></span></code></pre>
-<h2>AST node: AQid at base_simple3.nit:30,12--17</h2>
-<pre><code><span class="nitcode"><span class="line" id="L30"><span class="nc_i">output</span></span></span></code></pre>
-<h2>AST node: AListExprs at base_simple3.nit:30,17</h2>
-<pre><code><span class="nitcode"></span></code></pre>
-<h2>AST node: AAttrPropdef at base_simple3.nit:35,2--13</h2>
-<pre><code><span class="nitcode"><span class="nc_pdef foldable" id="base_simple3$B$_val"><a id="base_simple3$B$val"></a><a id="base_simple3$B$val="></a><span class="line" id="L35"> <span class="nc_k">var</span> <span class="nc_def nc_i">val</span><span>:</span> <span class="nc_t">Int</span></span></span></span></code></pre>
-<h2>AST node: TKwvar at base_simple3.nit:35,2--4</h2>
-<pre><code><span class="nc_pdef foldable" id="base_simple3$B$_val"><a id="base_simple3$B$val"></a><a id="base_simple3$B$val="></a><span class="line" id="L35"> <span class="nc_k">var</span></span></span></code></pre>
-<h2>AST node: AType at base_simple3.nit:35,11--13</h2>
-<pre><code><span class="nitcode"><span class="line" id="L35"> <span class="nc_t">Int</span></span></span></code></pre>
-<h2>AST node: TOpar at base_simple3.nit:36,6</h2>
-<pre><code><span class="nitcode"><span class="line" id="L36"><span>(</span></span></span></code></pre>
-<h2>AST node: AParam at base_simple3.nit:36,7--12</h2>
-<pre><code><span class="nitcode"><span class="line" id="L36"><span class="nc_v nc_i">v</span><span>:</span> <span class="nc_t">Int</span></span></span></code></pre>
-<h2>AST node: TCpar at base_simple3.nit:36,13</h2>
-<pre><code><span class="nitcode"><span class="line" id="L36"><span>)</span></span></span></code></pre>
-<h2>AST node: ABlockExpr at base_simple3.nit:38,3--40,4</h2>
-<pre><code><span class="nitcode"><span class="line" id="L38"> <span class="nc_l">7</span><span>.</span><span class="nc_i">output</span>
-</span><span class="line" id="L39"> <span class="nc_k">self</span><span>.</span><span class="nc_i">val</span> <span>=</span> <span class="nc_v nc_i">v</span>
-</span><span class="line" id="L40"> <span class="nc_k">end</span></span></span></code></pre>
-<h2>AST node: ACallAssignExpr at base_simple3.nit:39,3--14</h2>
-<pre><code><span class="nitcode"><span class="line" id="L39"> <span class="nc_k">self</span><span>.</span><span class="nc_i">val</span> <span>=</span> <span class="nc_v nc_i">v</span></span></span></code></pre>
-<h2>AST node: ASelfExpr at base_simple3.nit:39,3--6</h2>
-<pre><code><span class="nitcode"><span class="line" id="L39"> <span class="nc_k">self</span></span></span></code></pre>
-<h2>AST node: TKwself at base_simple3.nit:39,3--6</h2>
-<pre><code><span class="nitcode"><span class="line" id="L39"> <span class="nc_k">self</span></span></span></code></pre>
-<h2>AST node: TAssign at base_simple3.nit:39,12</h2>
-<pre><code><span class="nitcode"><span class="line" id="L39"> <span>=</span></span></span></code></pre>
-<h2>AST node: AVarExpr at base_simple3.nit:39,14</h2>
-<pre><code><span class="nitcode"><span class="line" id="L39"> <span class="nc_v nc_i">v</span></span></span></code></pre>
-<h2>AST node: AImplicitSelfExpr at base_simple3.nit:41,13</h2>
-<pre><code><span class="nitcode"></span></code></pre>
-<h2>AST node: ATopClassdef at base_simple3.nit:49,1--19</h2>
-<pre><code><span class="nitcode"><span class="nc_pdef foldable" id="base_simple3$Sys$foo"><span class="line" id="L49"><span class="nc_k">fun</span> <span class="nc_def popupable" title="base_simple3$Sys$foo" data-title="<a href="base_simple3.html#base_simple3$Sys$foo">base_simple3$Sys$foo</a>" data-content="<div><b>fun</b> <span>foo<span></span></span><br/></div>" data-toggle="popover"><span class="nc_i">foo</span></span> <span class="nc_k">do</span> <span class="nc_l">2</span><span>.</span><span class="nc_i">output</span></span></span></span></code></pre>
-<h2>AST node: AReturnExpr at base_simple3.nit:51,17--24</h2>
-<pre><code><span class="nitcode"><span class="line" id="L51"> <span class="nc_k">return</span> <span class="nc_l">4</span></span></span></code></pre>
-<h2>AST node: TKwreturn at base_simple3.nit:51,17--22</h2>
-<pre><code><span class="nitcode"><span class="line" id="L51"> <span class="nc_k">return</span></span></span></code></pre>
-<h2>AST node: AMainClassdef at base_simple3.nit:53,1--66,13</h2>
-<pre><code><span class="nitcode"><span class="nc_pdef foldable" id="base_simple3$Sys$main"><span class="line" id="L53"><span class="nc_l">1</span><span>.</span><span class="nc_i">output</span>
-</span><span class="line" id="L54"><span class="nc_i">foo</span>
-</span><span class="line" id="L55"><span class="nc_i">bar</span><span>(</span><span class="nc_l">3</span><span>)</span>
-</span><span class="line" id="L56"><span class="nc_i">baz</span><span>.</span><span class="nc_i">output</span>
-</span><span class="line" id="L57">
-</span><span class="line" id="L58"><span class="nc_k">var</span> <span class="nc_v nc_i">a</span> <span>=</span> <span class="nc_k">new</span> <span class="nc_t">A</span>
-</span><span class="line" id="L59"><span class="nc_v nc_i">a</span><span>.</span><span class="nc_i">run</span>
-</span><span class="line" id="L60">
-</span><span class="line" id="L61"><span class="nc_k">var</span> <span class="nc_v nc_i">b</span> <span>=</span> <span class="nc_k">new</span> <span class="nc_t">B</span><span>(</span><span class="nc_l">8</span><span>)</span>
-</span><span class="line" id="L62"><span class="nc_v nc_i">b</span><span>.</span><span class="nc_i">run</span>
-</span><span class="line" id="L63">
-</span><span class="line" id="L64"><span class="nc_k">var</span> <span class="nc_v nc_i">c</span> <span>=</span> <span class="nc_k">new</span> <span class="nc_t">C</span><span>(</span><span class="nc_l">9</span><span>)</span>
-</span><span class="line" id="L65"><span class="nc_v nc_i">c</span><span>.</span><span class="nc_i">val1</span><span>.</span><span class="nc_i">output</span>
-</span><span class="line" id="L66"><span class="nc_v nc_i">c</span><span>.</span><span class="nc_i">val2</span><span>.</span><span class="nc_i">output</span></span></span></span></code></pre>
-<h2>AST node: AMainMethPropdef at base_simple3.nit:53,1--66,13</h2>
-<pre><code><span class="nitcode"><span class="nc_pdef foldable" id="base_simple3$Sys$main"><span class="line" id="L53"><span class="nc_l">1</span><span>.</span><span class="nc_i">output</span>
-</span><span class="line" id="L54"><span class="nc_i">foo</span>
-</span><span class="line" id="L55"><span class="nc_i">bar</span><span>(</span><span class="nc_l">3</span><span>)</span>
-</span><span class="line" id="L56"><span class="nc_i">baz</span><span>.</span><span class="nc_i">output</span>
-</span><span class="line" id="L57">
-</span><span class="line" id="L58"><span class="nc_k">var</span> <span class="nc_v nc_i">a</span> <span>=</span> <span class="nc_k">new</span> <span class="nc_t">A</span>
-</span><span class="line" id="L59"><span class="nc_v nc_i">a</span><span>.</span><span class="nc_i">run</span>
-</span><span class="line" id="L60">
-</span><span class="line" id="L61"><span class="nc_k">var</span> <span class="nc_v nc_i">b</span> <span>=</span> <span class="nc_k">new</span> <span class="nc_t">B</span><span>(</span><span class="nc_l">8</span><span>)</span>
-</span><span class="line" id="L62"><span class="nc_v nc_i">b</span><span>.</span><span class="nc_i">run</span>
-</span><span class="line" id="L63">
-</span><span class="line" id="L64"><span class="nc_k">var</span> <span class="nc_v nc_i">c</span> <span>=</span> <span class="nc_k">new</span> <span class="nc_t">C</span><span>(</span><span class="nc_l">9</span><span>)</span>
-</span><span class="line" id="L65"><span class="nc_v nc_i">c</span><span>.</span><span class="nc_i">val1</span><span>.</span><span class="nc_i">output</span>
-</span><span class="line" id="L66"><span class="nc_v nc_i">c</span><span>.</span><span class="nc_i">val2</span><span>.</span><span class="nc_i">output</span></span></span></span></code></pre>
-<h2>AST node: AParExprs at base_simple3.nit:55,4--6</h2>
-<pre><code><span class="nitcode"><span class="line" id="L55"><span>(</span><span class="nc_l">3</span><span>)</span></span></span></code></pre>
-<h2>AST node: AVardeclExpr at base_simple3.nit:58,1--13</h2>
-<pre><code><span class="nitcode"><span class="line" id="L58"><span class="nc_k">var</span> <span class="nc_v nc_i">a</span> <span>=</span> <span class="nc_k">new</span> <span class="nc_t">A</span></span></span></code></pre>
-<h2>AST node: ANewExpr at base_simple3.nit:58,9--13</h2>
-<pre><code><span class="nitcode"><span class="line" id="L58"> <span class="nc_k">new</span> <span class="nc_t">A</span></span></span></code></pre>
-<h2>AST node: TKwnew at base_simple3.nit:58,9--11</h2>
-<pre><code><span class="nitcode"><span class="line" id="L58"> <span class="nc_k">new</span></span></span></code></pre>
-<script src="http://code.jquery.com/jquery-1.11.0.min.js"></script>
-<script src="http://netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script>
-<script>$(".popupable").popover({html:true, placement:'top'})/*initialize bootstrap popover*/</script>
-</body></html>
+<h2>AST node: TKwdo at base***TRUNCATED***
Calls to length, by type:
FlatString = 19
Indexed accesses, by type:
-Calls to bytelen for each type:
+Calls to byte_length for each type:
FlatString = 48
Calls to position for each type:
Calls to bytepos for each type:
print "fooba: " + "fooba".encode_base64
print "foobar: " + "foobar".encode_base64
-print ":" + "".decode_base64
-print "Zg==: " + "Zg==".decode_base64
-print "Zm8=: " + "Zm8=".decode_base64
-print "Zm9v: " + "Zm9v".decode_base64
-print "Zm9vYg==: " + "Zm9vYg==".decode_base64
-print "Zm9vYmE=: " + "Zm9vYmE=".decode_base64
-print "Zm9vYmFy: " + "Zm9vYmFy".decode_base64
+print ":" + "".decode_base64.to_s
+print "Zg==: " + "Zg==".decode_base64.to_s
+print "Zm8=: " + "Zm8=".decode_base64.to_s
+print "Zm9v: " + "Zm9v".decode_base64.to_s
+print "Zm9vYg==: " + "Zm9vYg==".decode_base64.to_s
+print "Zm9vYmE=: " + "Zm9vYmE=".decode_base64.to_s
+print "Zm9vYmFy: " + "Zm9vYmFy".decode_base64.to_s
+
+print "Zm9vYg: " + "Zm9vYg".decode_base64.to_s
+print "Zm9vYmE: " + "Zm9vYmE".decode_base64.to_s
+print "Zm9v*Yg: " + "Zm9v*Yg".decode_base64.to_s
+
+print ":"
+print "Znm=.is_base64? " + "Znm=".is_base64.to_s
+print "Znm===.is_base64? " + "Znm===".is_base64.to_s
+print "Z.sd=.is_base64? " + "Z.sd=".is_base64.to_s
+print "Z==D.is_base64? " + "Z==D".is_base64.to_s
+
+print ":"
+printn "Znm=: "
+print "Znm=".check_base64 or else "No error"
+printn "Znm===: "
+print "Znm===".check_base64 or else "No error"
+printn "Z.sd=: "
+print "Z.sd=".check_base64 or else "No error"
+printn "Z==D: "
+print "Z==D".check_base64 or else "No error"
l -= 1
end
-l = fb.bytelen - 1
+l = fb.byte_length - 1
for i in fb.bytes.reverse_iterator do
print "Byte {l} = {i}"
#alt1 str = new Concat(base_str, base_str)
#alt2 str = new Concat(base_str, base_str.substring_from(2))
-var copy_len = (str.bytelen - 4).min(9)
+var copy_len = (str.byte_length - 4).min(9)
str.copy_to_native(ons, copy_len, 4, 0)
print ons.to_s_with_length(copy_len)
#alt1#builder.options.clear
#alt1#builder.options.add "-Djava.class.path=/tmp/"
var jvm = builder.create_jvm
-var env = builder.jni_env
-assert env != null
+assert jvm != null
-# Test JavaVM::env
-assert not jvm.env.address_is_null
+var env = jvm.env
+assert not env.address_is_null
print "---------------------Test 1----------------------"
# get the class
#alt2 cpstr = new FlatBuffer.from(src_s)
#alt3 cpstr = cpstr.substring(1, 5)
-var ns = new NativeString(cpstr.bytelen)
+var ns = new NativeString(cpstr.byte_length)
ns.fill_from(cpstr)
-print ns.to_s_with_length(cpstr.bytelen)
+print ns.to_s_with_length(cpstr.byte_length)
--- /dev/null
+# This file is part of NIT ( http://www.nitlanguage.org ).
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+module test_bad_comp is test_suite
+
+import test_suite
+
+class TestSuiteBadComp
+ super TestSuite
+
+ fun test_good do
+ assert true
+ end
+
+ fun test_bad do
+ assert bad_method
+ end
+end
--- /dev/null
+# This file is part of NIT ( http://www.nitlanguage.org ).
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+module test_bad_comp2 is test_suite
+
+import test_suite
+
+class TestSuiteBadComp
+ super TestSuite
+
+ fun test_good do
+ assert true
+ end
+
+ fun test_bad(param: Bool) do
+ assert param
+ end
+end