Merge: Fix qualified imports
authorJean Privat <jean@pryen.org>
Fri, 28 Aug 2015 20:36:18 +0000 (16:36 -0400)
committerJean Privat <jean@pryen.org>
Fri, 28 Aug 2015 20:36:18 +0000 (16:36 -0400)
Solve #1265 and the includes with examples/nitcorn/src/xymus_net.nit

Pull-Request: #1667
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>

225 files changed:
contrib/crazy_moles/Makefile
contrib/crazy_moles/check-android.sh [deleted file]
contrib/mnit_test/Makefile [new file with mode: 0644]
contrib/mnit_test/assets/fighter.png [moved from examples/mnit_simple/assets/fighter.png with 100% similarity]
contrib/mnit_test/assets/hello.txt [moved from examples/mnit_simple/assets/hello.txt with 100% similarity]
contrib/mnit_test/assets/testsound.ogg [moved from examples/mnit_simple/assets/testsound.ogg with 100% similarity]
contrib/mnit_test/assets/xylofon.ogg [moved from examples/mnit_simple/assets/xylofon.ogg with 100% similarity]
contrib/mnit_test/org.nitlanguage.test_all.txt [moved from examples/mnit_simple/org.nitlanguage.test_all.txt with 50% similarity]
contrib/mnit_test/res/drawable-hdpi/icon.png [new file with mode: 0644]
contrib/mnit_test/res/drawable-ldpi/icon.png [new file with mode: 0644]
contrib/mnit_test/res/drawable-mdpi/icon.png [new file with mode: 0644]
contrib/mnit_test/res/drawable-xhdpi/icon.png [new file with mode: 0644]
contrib/mnit_test/res/drawable-xxhdpi/icon.png [new file with mode: 0644]
contrib/mnit_test/res/drawable-xxxhdpi/icon.png [new file with mode: 0644]
contrib/mnit_test/res/drawable/fighter.png [moved from examples/mnit_simple/res/drawable/fighter.png with 100% similarity]
contrib/mnit_test/res/raw/testsound.ogg [moved from examples/mnit_simple/res/raw/testsound.ogg with 100% similarity]
contrib/mnit_test/res/raw/xylofon.ogg [moved from examples/mnit_simple/res/raw/xylofon.ogg with 100% similarity]
contrib/mnit_test/res/values/bools.xml [moved from examples/mnit_simple/res/values/bools.xml with 100% similarity]
contrib/mnit_test/res/values/dimens.xml [moved from examples/mnit_simple/res/values/dimens.xml with 100% similarity]
contrib/mnit_test/src/complete_simple_android.nit [moved from examples/mnit_simple/src/complete_simple_android.nit with 91% similarity]
contrib/mnit_test/src/simple.nit [moved from examples/mnit_simple/src/simple.nit with 93% similarity]
contrib/mnit_test/src/simple_android.nit [moved from examples/mnit_simple/src/simple_android.nit with 91% similarity]
contrib/mnit_test/src/simple_linux.nit [moved from examples/mnit_simple/src/simple_linux.nit with 100% similarity]
contrib/mnit_test/src/test_assets_and_resources.nit [moved from examples/mnit_simple/src/test_assets_and_resources.nit with 85% similarity]
contrib/mnit_test/src/test_audio.nit [moved from examples/mnit_simple/src/test_audio.nit with 92% similarity]
contrib/mnit_test/src/test_bundle.nit [moved from examples/mnit_simple/src/test_bundle.nit with 99% similarity]
contrib/mnit_test/src/test_data_store.nit [moved from examples/mnit_simple/src/test_data_store.nit with 100% similarity]
contrib/mnit_test/src/test_intent.nit [moved from examples/mnit_simple/src/test_intent.nit with 100% similarity]
contrib/mnit_test/src/test_shared_preferences.nit [moved from examples/mnit_simple/src/test_shared_preferences.nit with 91% similarity]
contrib/mnit_test/src/test_target_api.nit [moved from examples/mnit_simple/src/test_target_api.nit with 96% similarity]
contrib/objcwrapper/.gitignore
contrib/objcwrapper/Makefile
contrib/objcwrapper/README.md [new file with mode: 0644]
contrib/objcwrapper/grammar/objc.sablecc
contrib/objcwrapper/src/header_static.nit
contrib/objcwrapper/src/objc_generator.nit
contrib/objcwrapper/src/objc_model.nit
contrib/objcwrapper/src/objc_visitor.nit
contrib/objcwrapper/src/objcwrapper.nit
contrib/online_ide/sources/nit/pnacl_nit.nit
contrib/pep8analysis/src/pep8analysis_web.nit
examples/int_stack.nit
examples/languages/langannot.pot [deleted file]
examples/mnit_dino/src/game_logic.nit
examples/mnit_simple/Makefile [deleted file]
examples/mnit_simple/res/values/strings.xml [deleted file]
lib/android/audio.nit
lib/android/bundle/bundle.nit
lib/android/notification/notification.nit
lib/app/audio.nit
lib/buffered_ropes.nit
lib/c.nit
lib/cocoa/examples/cocoa_message_box.nit
lib/core/README.md [moved from lib/standard/README.md with 100% similarity]
lib/core/bitset.nit [moved from lib/standard/bitset.nit with 100% similarity]
lib/core/bytes.nit [moved from lib/standard/bytes.nit with 100% similarity]
lib/core/codecs/codec_base.nit [moved from lib/standard/codecs/codec_base.nit with 100% similarity]
lib/core/codecs/codecs.nit [moved from lib/standard/codecs/codecs.nit with 100% similarity]
lib/core/codecs/utf8.nit [moved from lib/standard/codecs/utf8.nit with 100% similarity]
lib/core/collection/abstract_collection.nit [moved from lib/standard/collection/abstract_collection.nit with 100% similarity]
lib/core/collection/array.nit [moved from lib/standard/collection/array.nit with 100% similarity]
lib/core/collection/collection.nit [moved from lib/standard/collection/collection.nit with 100% similarity]
lib/core/collection/hash_collection.nit [moved from lib/standard/collection/hash_collection.nit with 99% similarity]
lib/core/collection/list.nit [moved from lib/standard/collection/list.nit with 99% similarity]
lib/core/collection/m.dot [moved from lib/standard/collection/m.dot with 100% similarity]
lib/core/collection/range [moved from lib/standard/collection/range with 100% similarity]
lib/core/collection/range.nit [moved from lib/standard/collection/range.nit with 100% similarity]
lib/core/collection/sorter.nit [moved from lib/standard/collection/sorter.nit with 100% similarity]
lib/core/collection/union_find.nit [moved from lib/standard/collection/union_find.nit with 100% similarity]
lib/core/core.nit [moved from lib/standard/standard.nit with 95% similarity]
lib/core/environ.nit [moved from lib/standard/environ.nit with 99% similarity]
lib/core/error.nit [moved from lib/standard/error.nit with 100% similarity]
lib/core/exec.nit [moved from lib/standard/exec.nit with 99% similarity]
lib/core/file.nit [moved from lib/standard/file.nit with 100% similarity]
lib/core/fixed_ints.nit [moved from lib/standard/fixed_ints.nit with 99% similarity]
lib/core/gc.nit [moved from lib/standard/gc.nit with 100% similarity]
lib/core/kernel.nit [moved from lib/standard/kernel.nit with 100% similarity]
lib/core/math.nit [moved from lib/standard/math.nit with 100% similarity]
lib/core/numeric.nit [moved from lib/standard/numeric.nit with 100% similarity]
lib/core/posix.nit [moved from lib/standard/posix.nit with 100% similarity]
lib/core/queue.nit [moved from lib/standard/queue.nit with 100% similarity]
lib/core/re.nit [moved from lib/standard/re.nit with 96% similarity]
lib/core/stream.nit [moved from lib/standard/stream.nit with 100% similarity]
lib/core/text/abstract_text.nit [moved from lib/standard/text/abstract_text.nit with 99% similarity]
lib/core/text/flat.nit [moved from lib/standard/text/flat.nit with 96% similarity]
lib/core/text/native.nit [moved from lib/standard/text/native.nit with 89% similarity]
lib/core/text/ropes.nit [moved from lib/standard/text/ropes.nit with 100% similarity]
lib/core/text/string_search.nit [moved from lib/standard/text/string_search.nit with 89% similarity]
lib/core/text/text.nit [moved from lib/standard/text/text.nit with 100% similarity]
lib/core/time.nit [moved from lib/standard/time.nit with 100% similarity]
lib/curl/native_curl.nit
lib/emscripten/emscripten.nit [moved from lib/emscripten.nit with 100% similarity]
lib/emscripten/examples/README.md [moved from examples/emscripten/README.md with 100% similarity]
lib/emscripten/examples/fibonacci/Makefile [moved from examples/emscripten/fibonacci/Makefile with 100% similarity]
lib/emscripten/examples/fibonacci/www/index.html [moved from examples/emscripten/fibonacci/www/index.html with 96% similarity]
lib/emscripten/examples/hello_world/Makefile [moved from examples/emscripten/hello_world/Makefile with 100% similarity]
lib/emscripten/examples/hello_world/www/index.html [moved from examples/emscripten/hello_world/www/index.html with 97% similarity]
lib/gettext/examples/.gitignore [new file with mode: 0644]
lib/gettext/examples/langannot.nit [moved from examples/langannot.nit with 100% similarity]
lib/gettext/examples/languages/en/LC_MESSAGES/langannot.po [moved from examples/languages/en/LC_MESSAGES/langannot.po with 100% similarity]
lib/gettext/examples/languages/fr/LC_MESSAGES/langannot.po [moved from examples/languages/fr/LC_MESSAGES/langannot.po with 100% similarity]
lib/gettext/examples/languages/ja/LC_MESSAGES/langannot.po [moved from examples/languages/ja/LC_MESSAGES/langannot.po with 100% similarity]
lib/gettext/gettext.nit [moved from lib/gettext.nit with 100% similarity]
lib/hash_debug.nit
lib/html/html.nit
lib/mpi/examples/Makefile [moved from examples/mpi/Makefile with 100% similarity]
lib/mpi/examples/README.md [moved from examples/mpi/README.md with 100% similarity]
lib/mpi/examples/hosts.example [moved from examples/mpi/hosts.example with 100% similarity]
lib/mpi/examples/src/mpi_simple.nit [moved from examples/mpi/src/mpi_simple.nit with 100% similarity]
lib/mpi/mpi.nit [moved from lib/mpi.nit with 99% similarity]
lib/nitcorn/http_request.nit
lib/pnacl/examples/converter/Makefile [moved from examples/pnacl/converter/Makefile with 93% similarity]
lib/pnacl/examples/converter/README.md [moved from examples/pnacl/converter/README.md with 100% similarity]
lib/pnacl/examples/converter/converter.nit [moved from examples/pnacl/converter/converter.nit with 100% similarity]
lib/pnacl/examples/converter/converter/index.html [moved from examples/pnacl/converter/converter/index.html with 89% similarity]
lib/pnacl/examples/converter/converter/js/functions.js [moved from examples/pnacl/converter/converter/js/functions.js with 66% similarity]
lib/pnacl/examples/converter/converter/js/pnacl_js.js [moved from examples/pnacl/converter/converter/js/pnacl_js.js with 100% similarity]
lib/pnacl/pnacl.nit [moved from lib/pnacl.nit with 99% similarity]
lib/ropes_debug.nit
lib/saxophonit/saxophonit.nit
lib/serialization/engine_tools.nit
lib/socket/socket.nit
lib/sqlite3/sqlite3.nit
lib/standard.nit [new file with mode: 0644]
lib/websocket/websocket.nit
misc/jenkins/check_android.sh [new file with mode: 0755]
src/README.md [new file with mode: 0644]
src/doc/doc_phases/doc_console.nit
src/interpreter/primitive_types.nit
src/loader.nit
src/metrics/metrics_base.nit
src/model/model.nit
src/platform/ios.nit
src/project.ini
src/testing/testing_doc.nit
tests/Darwin.skip
tests/base_adaptive_loop.nit
tests/base_adaptive_loop2.nit
tests/base_adaptive_loop3.nit
tests/base_adaptive_loop_array.nit
tests/base_adaptive_loop_call.nit
tests/base_adaptive_loop_isa.nit
tests/base_adaptive_loop_null.nit
tests/base_adaptive_loop_null2.nit
tests/base_arg_default.nit
tests/base_arg_default_autoinit.nit
tests/base_arg_order.nit
tests/base_attr_abstract2.nit
tests/base_attr_abstract3.nit
tests/base_attr_abstract4.nit
tests/base_attr_annot.nit
tests/base_autocast_array.nit
tests/base_error_literal.nit
tests/base_init_setter.nit
tests/base_native_array.nit
tests/base_notnull.nit
tests/base_operators.nit
tests/base_primitive_recv.nit
tests/base_test_bases.nit
tests/bench_string_append.nit
tests/error_virtual_type.nit
tests/error_virtual_type2.nit
tests/example_exec_ls.nit
tests/example_objet.nit
tests/example_procedural_string.nit
tests/example_string.nit
tests/listfull.sh
tests/niti.skip
tests/nituml.args
tests/nitvm.skip
tests/sav/base_arg_default_autoinit_alt1.res
tests/sav/base_attr_annot_1alt1.res
tests/sav/base_attr_annot_alt1.res
tests/sav/base_import_alt3.res
tests/sav/base_import_alt5.res
tests/sav/base_import_alt6.res
tests/sav/base_init_basic_alt5.res
tests/sav/base_init_noinit_alt4.res
tests/sav/base_module_conditional_alt1.res
tests/sav/error_class_glob.res
tests/sav/error_init_auto.res
tests/sav/error_init_auto_alt1.res
tests/sav/error_init_auto_alt2.res
tests/sav/error_init_auto_alt4.res
tests/sav/error_mod_unk.res
tests/sav/nitce/fixme/base_gen_reassign_alt4.res
tests/sav/nitce/fixme/base_gen_reassign_alt5.res
tests/sav/nitce/fixme/base_gen_reassign_alt6.res
tests/sav/nitcg/fixme/complete_simple_android.res [deleted file]
tests/sav/nitcsg/fixme/complete_simple_android.res [deleted file]
tests/sav/niti/complete_simple_android.res [deleted file]
tests/sav/niti/simple_android.res [deleted file]
tests/sav/nitj/fixme/base_gen_reassign_alt4.res
tests/sav/nitj/fixme/base_gen_reassign_alt5.res
tests/sav/nitj/fixme/base_gen_reassign_alt6.res
tests/sav/nitpretty_args2.res
tests/sav/nitpretty_args21.res
tests/sav/nitpretty_args33.res
tests/sav/nitpretty_args52.res
tests/sav/nitserial_args1.res
tests/sav/nitunit_args4.res
tests/sav/nitunit_args5.res
tests/sav/nitunit_args8.res
tests/sav/simple_linux.res [deleted file]
tests/sav/test_new_native_alt1.res
tests/sav/test_regex_check.res
tests/string_trim.nit
tests/test_arr_tos_ropes.nit
tests/test_ffi_c_module_blocks.nit
tests/test_ffi_c_new_extern.nit
tests/test_flatrope.nit
tests/test_linex_int.nit
tests/test_pretty/test_extern1.nit
tests/test_pretty/test_mod2.nit
tests/test_regex_check.nit
tests/test_ropes.nit
tests/test_ropes_buffer_add_overflow.nit
tests/test_ropes_buffer_clear.nit
tests/test_ropes_buffer_reverse.nit
tests/test_ropes_buffer_to_s.nit
tests/test_string_long.nit
tests/test_text.nit
tests/test_to_upper_lower_buffer.nit
tests/test_unicode_4bytes.nit
tests/tests.sh

index 06751d0..3fc90f7 100644 (file)
@@ -4,10 +4,12 @@ bin/moles: $(shell ../../bin/nitls -M src/moles_linux.nit) assets/images/drawing
        mkdir -p bin
        ../../bin/nitc -o bin/moles src/moles_linux.nit
 
-android: android-icons $(shell ../../bin/nitls -M src/moles_android.nit) assets/images/drawing.png
+bin/moles.apk: android-icons $(shell ../../bin/nitls -M src/moles_android.nit) assets/images/drawing.png
        mkdir -p bin
        ../../bin/nitc -o bin/moles.apk src/moles_android.nit
 
+android: bin/moles.apk
+
 ../inkscape_tools/bin/svg_to_icons:
        $(MAKE) -C ../inkscape_tools
 
@@ -15,15 +17,15 @@ android-icons: ../../contrib/inkscape_tools/bin/svg_to_icons art/icon.svg
        mkdir -p res
        ../inkscape_tools/bin/svg_to_icons art/icon.svg --android --out res/
 
-android-install: android
+android-install: bin/moles.apk
        adb install -rf bin/moles.apk
 
 assets/images/drawing.png: art/drawing.svg ../../contrib/inkscape_tools/bin/svg_to_icons
        mkdir -p assets/images
        ../inkscape_tools/bin/svg_to_png_and_nit --src src/ --scale 2.0 art/drawing.svg
 
-check-android:
-       ./check-android.sh
+check-android: bin/moles.apk
+       ../../misc/jenkins/check_android.sh bin/moles.apk
 
 clean:
        rm -rf bin res
diff --git a/contrib/crazy_moles/check-android.sh b/contrib/crazy_moles/check-android.sh
deleted file mode 100755 (executable)
index 8596eef..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-#!/bin/bash
-# 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.
-
-set -x
-
-avd=android4.0
-sleep=20
-
-android list avd | grep $avd
-
-if [ $? -eq 1 ]; then
-       echo no | android create avd -n $avd --snapshot -t android-15 --abi x86 || true
-       sleep=120
-fi
-
-#-no-window
-emulator -avd android4.0 -no-window -qemu -m 512 -enable-kvm &
-
-sleep $sleep
-
-dev=`adb devices | grep emulator | sed "s/\(.*\)\s*device/\1/"`
-
-adb -s $dev install -r bin/moles.apk
-
-# Unlock screen
-adb -s $dev shell input keyevent 82
-
-adb -s $dev shell monkey -p org.nitlanguage.moles_android_debug \
-       --monitor-native-crashes --throttle 5 --pct-touch 50 --pct-motion 50 1000
-
-adb -s $dev emu kill
diff --git a/contrib/mnit_test/Makefile b/contrib/mnit_test/Makefile
new file mode 100644 (file)
index 0000000..73ed663
--- /dev/null
@@ -0,0 +1,13 @@
+default: linux
+
+linux:
+       mkdir -p bin
+       ../../bin/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
+
+clean:
+       rm -rf bin
@@ -1,10 +1,10 @@
 Categories:Nit
 License:Apache2
 Web Site:http://nitlanguage.org
-Source Code:http://nitlanguage.org/nit.git/tree/HEAD:/examples/mnit_simple
+Source Code:http://nitlanguage.org/nit.git/tree/HEAD:/contrib/mnit_test
 Issue Tracker:https://github.com/nitlang/nit/issues
 
 Summary:Simple Demo for MNit
 Description:
-A useless application that shows various API usage of the MNit+Android framework.
+A useless application that test various API usage of the mnit framework on Android.
 .
diff --git a/contrib/mnit_test/res/drawable-hdpi/icon.png b/contrib/mnit_test/res/drawable-hdpi/icon.png
new file mode 100644 (file)
index 0000000..bad7e3d
Binary files /dev/null and b/contrib/mnit_test/res/drawable-hdpi/icon.png differ
diff --git a/contrib/mnit_test/res/drawable-ldpi/icon.png b/contrib/mnit_test/res/drawable-ldpi/icon.png
new file mode 100644 (file)
index 0000000..a3b27f8
Binary files /dev/null and b/contrib/mnit_test/res/drawable-ldpi/icon.png differ
diff --git a/contrib/mnit_test/res/drawable-mdpi/icon.png b/contrib/mnit_test/res/drawable-mdpi/icon.png
new file mode 100644 (file)
index 0000000..fbe3f94
Binary files /dev/null and b/contrib/mnit_test/res/drawable-mdpi/icon.png differ
diff --git a/contrib/mnit_test/res/drawable-xhdpi/icon.png b/contrib/mnit_test/res/drawable-xhdpi/icon.png
new file mode 100644 (file)
index 0000000..06ea6ff
Binary files /dev/null and b/contrib/mnit_test/res/drawable-xhdpi/icon.png differ
diff --git a/contrib/mnit_test/res/drawable-xxhdpi/icon.png b/contrib/mnit_test/res/drawable-xxhdpi/icon.png
new file mode 100644 (file)
index 0000000..eedddef
Binary files /dev/null and b/contrib/mnit_test/res/drawable-xxhdpi/icon.png differ
diff --git a/contrib/mnit_test/res/drawable-xxxhdpi/icon.png b/contrib/mnit_test/res/drawable-xxxhdpi/icon.png
new file mode 100644 (file)
index 0000000..08287da
Binary files /dev/null and b/contrib/mnit_test/res/drawable-xxxhdpi/icon.png differ
@@ -14,7 +14,9 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
+# Entrypoint of an app with all the mnit tests for Android
 module complete_simple_android is
+       app_name "mnit Complete"
        app_namespace "org.nitlanguage.test_all"
        android_api_target 19
 end
similarity index 93%
rename from examples/mnit_simple/src/simple.nit
rename to contrib/mnit_test/src/simple.nit
index b89f8af..07dd3a3 100644 (file)
@@ -16,7 +16,7 @@
 
 # Very simple application
 module simple is
-       app_name("mnit Simple example") # On Android, this name is hidden by the value in `res/values/strings.xml`
+       app_name "mnit Minimal"
        app_version(0, 2, git_revision)
 end
 
similarity index 91%
rename from examples/mnit_simple/src/simple_android.nit
rename to contrib/mnit_test/src/simple_android.nit
index a451597..bc5e69d 100644 (file)
@@ -15,7 +15,8 @@
 # limitations under the License.
 
 module simple_android is
-       android_manifest("""<uses-permission android:name="android.permission.VIBRATE" />""")
+       app_namespace "org.nitlanguage.test_minimal"
+       android_manifest """<uses-permission android:name="android.permission.VIBRATE" />"""
 end
 
 import mnit_android
@@ -32,7 +33,7 @@ in "Java" `{
 redef class App
        redef fun input( ie )
        do
-               if ie isa PointerEvent and ie.depressed then 
+               if ie isa PointerEvent and ie.depressed then
                        test_java_ffi
                end
                return super
@@ -23,7 +23,7 @@ intrude import android::assets_and_resources
 redef class App
        redef fun input( ie )
        do
-               if ie isa PointerEvent and ie.depressed then 
+               if ie isa PointerEvent and ie.depressed then
                        test_assets
                        test_resources
                end
@@ -38,7 +38,10 @@ redef class App
 
        # Testing the resources manager
        fun test_resources do
-               assert resource_manager.string("string_test") == "string test"
+               # FIXME test deactivated to use app_name which is incompatible
+               # with a custom res/values/strings.xml
+               #assert resource_manager.string("string_test") == "string test"
+
                assert resource_manager.boolean("test_bool") == true
                assert resource_manager.dimension("test_dimen_1") == 25
                assert resource_manager.dimension("test_dimen_2") == 150
similarity index 92%
rename from examples/mnit_simple/src/test_audio.nit
rename to contrib/mnit_test/src/test_audio.nit
index 2a3a77b..9ef5d92 100644 (file)
@@ -23,17 +23,23 @@ import android::audio
 redef class App
        # Sound
        var soundsp: Sound
+
        # Music
        var soundmp: Music
+
        # Sound
        var easy_soundsp = new Sound("testsound")
+
        # Music
        var easy_soundmp = new Music("xylofon")
-       # testing from assets ?
+
+       # Read sounds from the assets folder?
        var test_assets = false
-       # testinf from resources ?
+
+       # Read sounds from the resources folder?
        var test_ressources = true
-       # testing the automatic way ?
+
+       # Test the automatic way with `PlayableAudio::load`?
        var test_easy_sounds = false
 
        redef fun on_create
similarity index 99%
rename from examples/mnit_simple/src/test_bundle.nit
rename to contrib/mnit_test/src/test_bundle.nit
index 37c79bb..a821dce 100644 (file)
@@ -108,4 +108,3 @@ redef class App
                assert bundle.is_empty
        end
 end
-
@@ -55,7 +55,11 @@ redef class App
                assert sp.float("wrong_float", 0.0) == 0.0
                assert sp.int("an_int", 0) == 666
                assert sp.int("a_second_int", 0) == 0
-               assert sp.long("a_long", 0) == 6666666666
+
+               # FIXME getting long from Java on Android is broken
+               # The C FFI (underlying the Java FFI) version of Int is a `long` which is on 32 bits on Android.
+               #assert sp.long("a_long", 0) == 6666666666
+
                assert sp.long("wrong_long", 0) == 0
                assert sp.string("a_string", "ERROR!") == "A string"
                assert sp.string("wrong_string", "ERROR!") == "ERROR!"
similarity index 96%
rename from examples/mnit_simple/src/test_target_api.nit
rename to contrib/mnit_test/src/test_target_api.nit
index 3992c09..f092da3 100644 (file)
@@ -27,7 +27,7 @@ import android::shared_preferences::shared_preferences_api11
 redef class App
        redef fun input( ie )
        do
-               if ie isa PointerEvent and ie.depressed then 
+               if ie isa PointerEvent and ie.depressed then
                        test_target_api
                end
                return super
index 0d0b14f..36673f1 100644 (file)
@@ -2,4 +2,6 @@ src/objc_lexer.nit
 src/objc_parser.nit
 src/objc_test_parser.nit
 tests/MyClass.nit
+tests/nsarray.nit
+tests/nsalert.nit
 objc.ast.dot
index 3f39029..4fcfa3b 100644 (file)
@@ -1,4 +1,4 @@
-all: bin/objcwrapper
+all: bin/objcwrapper bin/header_static
 
 ../nitcc/src/nitcc:
        make -C ../nitcc
@@ -23,20 +23,26 @@ check: bin/objc_test_parser bin/objcwrapper
        ../../bin/nitpick tests/MyClass.nit
 
 # Test on classes of libgnustep-base-dev
-check-gnustep:
+check-gnustep: bin/objcwrapper bin/header_static
        gcc -E /usr/include/GNUstep/Foundation/NSArray.h -I /usr/include/GNUstep/ -Wno-deprecated \
        | ../header_keeper/bin/header_keeper /usr/include/GNUstep/Foundation/NSArray.h \
        | bin/header_static > tests/NSArray.pre.h
-       bin/objcwrapper tests/NSArray.pre.h
-       ../../bin/nitpick NSArray.nit
+       bin/objcwrapper tests/NSArray.pre.h -o tests/nsarray.nit
+       ../../bin/nitpick tests/nsarray.nit
 
 # Test on classes of the Apple Foundation framework
-check-apple:
+check-apple: bin/objcwrapper bin/header_static
        gcc -E /System/Library/Frameworks/Foundation.framework/Versions/C/Headers/NSArray.h \
        | ../header_keeper/bin/header_keeper /System/Library/Frameworks/Foundation.framework/Versions/C/Headers/NSArray.h \
        | bin/header_static > tests/NSArray.pre.h
-       bin/objcwrapper tests/NSArray.pre.h
-       ../../bin/nitpick NSArray.nit
+       bin/objcwrapper tests/NSArray.pre.h -o tests/nsarray.nit
+       ../../bin/nitpick tests/nsarray.nit
 
-bin/header_static:
+       gcc -E /System/Library/Frameworks/AppKit.framework/Headers/NSAlert.h \
+       | ../header_keeper/bin/header_keeper NSAlert.h \
+       | bin/header_static > tests/NSAlert.pre.h
+       bin/objcwrapper tests/NSAlert.pre.h -o tests/nsalert.nit
+       ../../bin/nitpick tests/nsalert.nit
+
+bin/header_static: $(shell ../../bin/nitls -M src/header_static.nit)
        ../../bin/nitc --dir bin src/header_static.nit
diff --git a/contrib/objcwrapper/README.md b/contrib/objcwrapper/README.md
new file mode 100644 (file)
index 0000000..b33a682
--- /dev/null
@@ -0,0 +1,31 @@
+Generator of Nit extern classes to wrap Objective-C services.
+
+# Description
+
+_objcwrapper_ is a tool to help access Objective-C classes and methods from Nit.
+It generates Nit code composed of extern classes and extern methods from the Objective-C FFI.
+The code should be valid Nit, but it may need some tweaking by hand before use.
+
+_objcwrapper_ takes as input preprocessed Objective-C header files.
+This preprocessing is usually done by combinig (or piping) calls to:
+`gcc -E`, `header_keeper` and `header_static`.
+See the check rules in the Makefile for example preprocessing.
+
+# Usage
+
+1. Compile _objcwrapper_ with: `make`
+
+2. Compile the wrapper `NSArray.nit` from the preprocessed header `NSArray.h` with:
+
+       ~~~
+       bin/objcwrapper -o NSArray.h NSArray.h
+       ~~~
+
+3. Import the generated module as usual from any Nit program.
+   It is not recommended to modify the generated file directly,
+   but you can redef the generated classes from other modules.
+
+# See also
+
+_jwrapper_ is the inspiration for this tool.
+It generate wrappers to access Java services from Nit.
index b997614..0a4bb52 100644 (file)
@@ -121,11 +121,13 @@ Parser
         {instance:} '-';
 
     parameter =
-        {named:} [left:]term ':' lpar parameter_type rpar attribute? [right:]term |
+        {named:} [left:]term ':' parameter_type_in_par? attribute? [right:]term |
         {single:} term |
         {comma:} comma '...' |
         {macro:} macro_name;
 
+    parameter_type_in_par = lpar parameter_type rpar;
+
     parameter_type =
         {normal:} type |
         {anonymous:} type anonymous |
@@ -195,7 +197,8 @@ Parser
         'long long int' |
         'float' |
         'double' |
-        'long double';
+        'long double' |
+        'size_t';
 
     classe =
         {class:} class |
index c43fe2a..19ffd72 100644 (file)
@@ -49,7 +49,10 @@ fun header_static(input: Reader, output: Writer) do
 
        while not input.eof do
                var line = input.read_line
-               if line.to_s.has("static") then static_target = true
+
+               if line.has("typedef struct") then continue
+
+               if line.has("static") then static_target = true
 
                if static_target then
                        if line.to_s.has("__attribute__") then static_attribute_target = true
index 25bd84f..845a3b1 100644 (file)
@@ -20,29 +20,69 @@ import opts
 import objc_model
 
 redef class Sys
+
        # Path to the output file
        var opt_output = new OptionString("Output file", "-o")
-end
 
-class CodeGenerator
-       # Merge the calls to `alloc` and `init...` in a single constructor?
+       # Shall `init` methods/constructors be wrapped as methods?
        #
-       # If `true`, also the default behavior, initializing an extern Objective-C object looks like:
+       # By default, these methods/constructors are wrapped as extern constructors.
+       # So initializing an extern Objective-C object looks like:
        # ~~~nitish
        # var o = new NSArray.init_with_array(some_other_array)
        # ~~~
        #
-       # If `false`, the object must first be allocated and then initialized.
+       # If this option is set, the object must first be allocated and then initialized.
        # This is closer to the Objective-C behavior:
        # ~~~nitish
        # var o = new NSArray
        # o.init_with_array(some_other_array)
        # ~~~
-       var init_with_alloc = true is writable
+       var opt_init_as_methods = new OptionBool(
+               "Wrap `init...` constructors as Nit methods instead of Nit constructors",
+               "--init-as-methods")
+
+       private var objc_to_nit_types: Map[String, String] is lazy do
+               var types = new HashMap[String, String]
+               types["char"] = "Byte"
+               types["short"] = "Int"
+               types["short int"] = "Int"
+               types["int"] = "Int"
+               types["long"] = "Int"
+               types["long int"] = "Int"
+               types["long long"] = "Int"
+               types["long long int"] = "Int"
+               types["float"] = "Float"
+               types["double"] = "Float"
+               types["long double"] = "Float"
+
+               types["NSUInteger"] = "Int"
+               types["BOOL"] = "Bool"
+               types["id"] = "NSObject"
+               types["constid"] = "NSObject"
+               types["SEL"] = "NSObject"
+               types["void"] = "Pointer"
+
+               return types
+       end
+end
+
+redef class ObjcModel
+       redef fun knows_type(objc_type) do return super or
+               objc_to_nit_types.keys.has(objc_type)
+end
+
+# Wrapper generator
+class CodeGenerator
+
+       # `ObjcModel` to wrap
+       var model: ObjcModel
 
        # Generate Nit code to wrap `classes`
-       fun generate(classes: Array[ObjcClass])
+       fun generate
        do
+               var classes = model.classes
+
                # Open specified path or stdin
                var file
                var path = opt_output.value
@@ -65,169 +105,210 @@ class CodeGenerator
                if path != null then file.close
        end
 
-       private fun type_convertor(type_word: String): String
+       private fun write_class(classe: ObjcClass, file: Writer)
        do
-               var types = new HashMap[String, String]
-               types["char"] = "Byte"
-               types["short"] = "Int"
-               types["short int"] = "Int"
-               types["int"] = "Int"
-               types["long"] = "Int"
-               types["long int"] = "Int"
-               types["long long"] = "Int"
-               types["long long int"] = "Int"
-               types["float"] = "Float"
-               types["double"] = "Float"
-               types["long double"] = "Float"
+               # Class header
+               file.write """
 
-               types["NSUInteger"] = "Int"
-               types["BOOL"] = "Bool"
-               types["id"] = "NSObject"
+extern class {{{classe.name}}} in "ObjC" `{ {{{classe.name}}} * `}
+"""
 
-               if types.has_key(type_word) then
-                       return types[type_word]
-               else
-                       return type_word
-               end
-       end
+               # Supers
+               for super_name in classe.super_names do file.write """
+       super {{{super_name}}}
+"""
+               if classe.super_names.is_empty then file.write """
+       super NSObject
+"""
 
-       private fun write_class(classe: ObjcClass, file: Writer)
-       do
-               var commented_methods = new Array[ObjcMethod]
-               file.write "extern class " + classe.name + """ in "ObjC" `{ """ + classe.name  + """ * `}\n"""
-               for super_name in classe.super_names do
-                       file.write """  super """ + super_name + "\n"
-               end
-               if classe.super_names.is_empty then file.write """      super NSObject\n"""
-               write_constructor(classe, file)
                file.write "\n"
+
+               # Constructor or constructors
+               write_constructors(classe, file)
+
+               # Attributes
                for attribute in classe.attributes do
                        write_attribute(attribute, file)
                end
+
+               # Methods
                for method in classe.methods do
-                       if method.is_commented then
-                               commented_methods.add(method)
-                       else
-                               if init_with_alloc and method.params.first.name.has("init") then continue
-                               file.write """  """
-                               write_method(method, file)
-                               file.write """ in "ObjC" `{\n           """
-                               write_objc_method_call(method, file)
-                               file.write """  `}"""
-                               if method != classe.methods.last then file.write "\n\n"
-                       end
-               end
-               for commented_method in commented_methods do
-                       if commented_method == commented_methods.first then file.write "\n"
-                       file.write """  #"""
-                       write_method(commented_method, file)
-                       if commented_method != commented_methods.last then file.write "\n"
+                       if not model.knows_all_types(method) then method.is_commented = true
+
+                       if not opt_init_as_methods.value and method.is_init then continue
+
+                       write_method_signature(method, file)
+                       write_objc_method_call(method, file)
                end
-               file.write "\nend\n"
+
+               file.write """
+end
+"""
        end
 
-       private fun write_constructor(classe: ObjcClass, file: Writer)
+       private fun write_constructors(classe: ObjcClass, file: Writer)
        do
-               if init_with_alloc then
-                       for method in classe.methods do
-                               if method.params.first.name.has("init") and not method.is_commented then
-                                       file.write """\n        """
-                                       if method.params.first.name == "init" then
-                                               file.write "new"
-                                       else
-                                               write_method(method, file)
-                                       end
-                                       file.write """ in "ObjC" `{\n"""
-                                       write_objc_init_call(classe.name, method, file)
-                                       file.write """  `}\n"""
-                               end
-                       end
-               else
-                       file.write """\n        new in "ObjC"`{\n"""
-                       file.write """          return [""" + classe.name + " alloc];\n"
-                       file.write """  `}\n"""
+               if opt_init_as_methods.value then
+                       # A single constructor for `alloc`
+                       file.write """
+       new in "ObjC" `{
+               return [{{{classe.name}}} alloc];
+       `}
+
+"""
+                       return
+               end
+
+               # A constructor per `init...` method
+               for method in classe.methods do
+                       if not method.is_init then continue
+
+                       if not model.knows_all_types(method) then method.is_commented = true
+
+                       write_method_signature(method, file)
+
+                               write_objc_init_call(classe.name, method, file)
                end
        end
 
        private fun write_attribute(attribute: ObjcAttribute, file: Writer)
        do
+               if not model.knows_type(attribute.return_type) then attribute.is_commented = true
+
                write_attribute_getter(attribute, file)
                # TODO write_attribute_setter if there is no `readonly` annotation
-               file.write "\n"
        end
 
        private fun write_attribute_getter(attribute: ObjcAttribute, file: Writer)
        do
-               file.write """  fun """ + attribute.name.to_snake_case + ": " + type_convertor(attribute.return_type)
-               file.write """ in "ObjC" `{\n"""
-               file.write """          return [self """ + attribute.name + "];\n"
-               file.write """  `}\n"""
+               var nit_attr_name = attribute.name.to_snake_case
+               var nit_attr_type = attribute.return_type.objc_to_nit_type
+
+               var c = attribute.comment_str
+
+               file.write """
+{{{c}}}        fun {{{nit_attr_name}}}: {{{nit_attr_type}}} in "ObjC" `{
+{{{c}}}                return [self {{{attribute.name}}}];
+{{{c}}}        `}
+
+"""
        end
 
        private fun write_attribute_setter(attribute: ObjcAttribute, file: Writer)
        do
-               file.write """  fun """ + attribute.name.to_snake_case + "=(value: " + type_convertor(attribute.return_type) + ")"
-               file.write " in \"ObjC\" `\{\n"
-               file.write """          self.""" + attribute.name + " = value;\n"
-               file.write """  `}\n"""
+               var nit_attr_name = attribute.name.to_snake_case
+               var nit_attr_type = attribute.return_type.objc_to_nit_type
+
+               var c = attribute.comment_str
+
+               file.write """
+{{{c}}}        fun {{{nit_attr_name}}}=(value: {{{nit_attr_type}}}) in "ObjC" `{
+{{{c}}}                return self.{{{attribute.name}}} = value;
+{{{c}}}        `}
+
+"""
        end
 
-       private fun write_method(method: ObjcMethod, file: Writer)
+       private fun write_method_signature(method: ObjcMethod, file: Writer)
        do
+               var c = method.comment_str
+
+               # Build Nit method name
                var name = ""
                for param in method.params do
                        name += param.name[0].to_upper.to_s + param.name.substring_from(1)
-                       name = name.to_snake_case
                end
-               if name.has("init") and init_with_alloc then
-                       file.write "new "
-               else
-                       if not init_with_alloc and name == "init" then name = "init_0"
-                       file.write "fun "
+               name = name.to_snake_case
+
+               if name == "init" then name = ""
+
+               # Kind of method
+               var fun_keyword = "fun"
+               if not opt_init_as_methods.value and method.is_init then
+                       fun_keyword = "new"
                end
-               file.write name
+
+               # Params
+               var params = new Array[String]
                for param in method.params do
-                       if param == method.params.first and not param.is_single then
-                               file.write "(" + param.variable_name + ": " + type_convertor(param.return_type)
-                       end
-                       if param != method.params.first and not param.is_single then
-                               file.write ", " + param.variable_name + ": " + type_convertor(param.return_type)
-                       end
-                       if param == method.params.last and not param.is_single then
-                               file.write ")"
-                       end
+                       if param.is_single then break
+                       params.add "{param.variable_name}: {param.return_type.objc_to_nit_type}"
                end
-               if method.return_type != "void" and not method.params.first.name.has("init") then
-                       file.write ": " + type_convertor(method.return_type)
+
+               var params_with_par = ""
+               if params.not_empty then params_with_par = "({params.join(", ")})"
+
+               # Return
+               var ret = ""
+               if method.return_type != "void" and fun_keyword != "new" then
+                       ret = ": {method.return_type.objc_to_nit_type}"
                end
+
+               file.write """
+{{{c}}}        {{{fun_keyword}}} {{{name}}}{{{params_with_par}}}{{{ret}}} in "ObjC" `{
+"""
        end
 
-       private fun write_objc_init_call(classe_name: String, method: ObjcMethod, file: Writer)
+       # Write a combined call to alloc and to a constructor/method
+       private fun write_objc_init_call(class_name: String, method: ObjcMethod, file: Writer)
        do
-               file.write """          return [[""" + classe_name + " alloc] "
+               # Method name and other params
+               var params = new Array[String]
                for param in method.params do
                        if not param.is_single then
-                               file.write param.name + ":" + param.variable_name
-                               if not param == method.params.last then file.write " "
-                       else
-                               file.write param.name
-                       end
+                               params.add "{param.name}: {param.variable_name}"
+                       else params.add param.name
                end
-               file.write "];\n"
+
+               var c = method.comment_str
+
+               file.write """
+{{{c}}}                return [[{{{class_name}}} alloc] {{{params.join(" ")}}}];
+{{{c}}}        `}
+
+"""
        end
 
        private fun write_objc_method_call(method: ObjcMethod, file: Writer)
        do
-               if method.return_type != "void" then file.write "return "
-               file.write "[self "
+               # Is there a value to return?
+               var ret = ""
+               if method.return_type != "void" then ret = "return "
+
+               # Method name and other params
+               var params = new Array[String]
                for param in method.params do
                        if not param.is_single then
-                               file.write param.name + ":" + param.variable_name
-                               if not param == method.params.last then file.write " "
-                       else
-                               file.write param.name
-                       end
+                               params.add "{param.name}: {param.variable_name}"
+                       else params.add param.name
                end
-               file.write "];\n"
+
+               var c = method.comment_str
+
+               file.write """
+{{{c}}}                {{{ret}}}[self {{{params.join(" ")}}}];
+{{{c}}}        `}
+
+"""
        end
 end
+
+redef class Text
+       # Nit equivalent to this type
+       private fun objc_to_nit_type: String
+       do
+               var types = sys.objc_to_nit_types
+
+               if types.has_key(self) then
+                       return types[self]
+               else
+                       return to_s
+               end
+       end
+end
+
+redef class Property
+       private fun comment_str: String do if is_commented then
+               return "#"
+       else return ""
+end
index b2465c5..a082d22 100644 (file)
@@ -19,6 +19,33 @@ module objc_model
 class ObjcModel
        # All analyzed classes
        var classes = new Array[ObjcClass]
+
+       # Is `objc_type` known by this model?
+       fun knows_type(objc_type: Text): Bool
+       do
+               for c in classes do
+                       if c.name == objc_type then return true
+               end
+
+               return imported_types.has(objc_type)
+       end
+
+       # Are all types in the signature or `method` known by this model?
+       fun knows_all_types(method: ObjcMethod): Bool
+       do
+               for param in method.params do
+                       if param.is_single then break
+                       if not knows_type(param.return_type) then return false
+               end
+
+               var r = method.return_type
+               return r == "void" or r == "id" or knows_type(r)
+       end
+
+       # Objective-C types available in imported modules
+       #
+       # TODO seach in existing wrappers
+       private var imported_types: Array[String] = ["NSObject", "NSString"]
 end
 
 # Objective-C class
@@ -48,6 +75,9 @@ class ObjcMethod
 
        # Return type as a `String`
        var return_type: String is noinit, writable
+
+       # Does this method look like a constructor/method?
+       fun is_init: Bool do return params.first.name.has_prefix("init")
 end
 
 # Attribute of an `ObjcClass`
index 3d51935..487713d 100644 (file)
@@ -167,7 +167,12 @@ redef class Nparameter_named
                var param = new Param
                param.variable_name = n_right.collect_text
                param.name = n_left.collect_text
-               param.return_type = n_parameter_type.to_type
+
+               var n_type = n_parameter_type_in_par
+               param.return_type = if n_type != null then
+                       n_type.n_parameter_type.to_type
+               else  "NSObject"
+
                return param
        end
 end
index b1abbc6..0e3cb18 100644 (file)
@@ -27,7 +27,7 @@ import objc_parser
 var opt_help = new OptionBool("Show this help message", "-h", "--help")
 
 var opts = new OptionContext
-opts.add_option(opt_help, opt_output)
+opts.add_option(opt_help, opt_output, opt_init_as_methods)
 opts.parse(args)
 
 if opts.errors.not_empty or opts.rest.is_empty or opt_help.value then
@@ -41,7 +41,6 @@ Options:"""
 end
 
 var v = new ObjcVisitor
-var g = new CodeGenerator
 
 for arg in opts.rest do
        # Read input
@@ -64,4 +63,5 @@ for arg in opts.rest do
        v.enter_visit root
 end
 
-g.generate v.model.classes
+var g = new CodeGenerator(v.model)
+g.generate
index 2017a0b..ed8151d 100644 (file)
@@ -22,7 +22,7 @@ import interpreter::debugger
 import pnacl
 intrude import toolcontext
 intrude import loader
-intrude import standard::file
+intrude import core::file
 
 # We redefine exit to start a new thread before killing the one that called exit.
 redef fun exit(exit_value: Int)
index 4d9d0aa..8f5c97a 100644 (file)
@@ -31,7 +31,7 @@ import ast
 import model
 import cfg
 import flow_analysis
-intrude import standard::stream
+intrude import core::stream
 import cpp
 
 in "C++" `{
index 1109bbb..eb2d9b3 100644 (file)
@@ -19,7 +19,7 @@ module int_stack
 
 # A stack of integer implemented by a simple linked list.
 # Note that this is only a toy class since a real linked list will gain to use
-# generics and extends interfaces, like Collection, from the standard library.
+# generics and extends interfaces, like `Collection`, from the `core` library.
 class IntStack
        # The head node of the list.
        # Null means that the stack is empty.
diff --git a/examples/languages/langannot.pot b/examples/languages/langannot.pot
deleted file mode 100644 (file)
index 9c86286..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-#: langannot::langannot 22--10:32, langannot::langannot 29--7:29
-msgid "This String is a test"
-msgstr ""
-
-#: langannot::langannot 31--7:3
-msgid "Multiline string\n\nexample\n\n\nof the language annotation capacities\n"
-msgstr ""
-
-#: langannot::langannot 39--9:17
-msgid "example"
-msgstr ""
-
-#: langannot::langannot 41--7:34, langannot::langannot 43--7:33
-msgid "This superstring %1 rocks"
-msgstr ""
-
-# Generated file, do not modify
index 29712de..6fa0d3f 100644 (file)
@@ -15,7 +15,7 @@
 # limitations under the License.
 
 # Entire game logic for the Dino game
-# Depends only on Nit standard library
+# Depends only on Nit `core` library
 module game_logic
 
 interface Turnable
diff --git a/examples/mnit_simple/Makefile b/examples/mnit_simple/Makefile
deleted file mode 100644 (file)
index 01189c9..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-default: linux
-
-linux:
-       mkdir -p bin
-       ../../bin/nitc -o bin/simple src/simple_linux.nit
-
-android:
-       mkdir -p bin
-       ../../bin/nitc -o bin/simple.apk src/complete_simple_android.nit
-
-clean:
-       rm -rf bin
diff --git a/examples/mnit_simple/res/values/strings.xml b/examples/mnit_simple/res/values/strings.xml
deleted file mode 100644 (file)
index 6ef469c..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<resources>
-    <string name="app_name"> mnit Simple</string>
-    <string name="nit_string">Test Resources</string>
-    <string name="string_test">string test</string>
-</resources>
index 6cec4e1..c70dd40 100644 (file)
@@ -48,7 +48,7 @@ module audio
 import java
 import java::io
 intrude import assets_and_resources
-import native_app_glue # FIXME update this module to use nit_activity
+import activities
 import app::audio
 
 in "Java" `{
@@ -638,7 +638,7 @@ redef class App
 
        # Sets the stream of the app to STREAM_MUSIC.
        # STREAM_MUSIC is the default stream used by android apps.
-       private fun manage_audio_stream import native_activity, native_app_glue in "Java" `{
+       private fun manage_audio_stream import native_activity in "Java" `{
                App_native_activity(self).setVolumeControlStream(AudioManager.STREAM_MUSIC);
        `}
 
@@ -682,19 +682,19 @@ redef class App
                return sound
        end
 
-       redef fun pause do
+       redef fun on_pause do
                super
                for s in sounds do s.pause
                audio_manager.abandon_audio_focus
        end
 
-       redef fun init_window do
+       redef fun on_create do
                super
                audio_manager.request_audio_focus
                manage_audio_stream
        end
 
-       redef fun resume do
+       redef fun on_resume do
                super
                audio_manager.request_audio_focus
                for s in sounds do s.resume
index 76babb4..82acbec 100644 (file)
@@ -425,7 +425,7 @@ end
 
 # A class mapping `String` keys to various value types
 class Bundle
-       private var native_bundle: NativeBundle = new NativeBundle is lazy
+       private var native_bundle: NativeBundle = (new NativeBundle).new_global_ref is lazy
 
        # Get a new `Bundle` wrapping `native_bundle`
        init from(native_bundle: NativeBundle) do self.native_bundle = native_bundle
@@ -543,13 +543,15 @@ class Bundle
        # Returns `null` if none or if it's the wrong value type
        fun string(key: String): nullable String
        do
-               sys.jni_env.push_local_frame(1)
-               var return_value = native_bundle.get_string(key.to_java_string).to_s
-               sys.jni_env.pop_local_frame
+               sys.jni_env.push_local_frame(2)
 
-               if return_value == "" then return null
+               var jstr = native_bundle.get_string(key.to_java_string)
+               var str = null
+               if not jstr.is_java_null then str = jstr.to_s
 
-               return return_value
+               sys.jni_env.pop_local_frame
+
+               return str
        end
 
        # Retrieves the `Bool` value corresponding to the given key
index a4d34d4..efd7c5f 100644 (file)
@@ -35,7 +35,7 @@
 # http://developer.android.com/guide/topics/ui/notifiers/notifications.html
 module notification
 
-import standard
+import core
 private import native_notification
 
 # An Android notification, shown at the top of the screen
index 759ed81..42d90ae 100644 (file)
@@ -24,7 +24,7 @@
 module audio
 
 import app_base
-import standard::error
+import core::error
 
 # Platform variations
 # TODO: move on the platform once qualified names are understand in the condition
index 1f92337..8ed1f6b 100644 (file)
@@ -22,7 +22,7 @@
 # and reallocations when concatenating `String` objects.
 module buffered_ropes
 
-intrude import standard::text::ropes
+intrude import core::text::ropes
 
 # Hidden buffer, used to simulate a `FlatBuffer` on a short string.
 #
index 04f7b20..a4a8e01 100644 (file)
--- a/lib/c.nit
+++ b/lib/c.nit
@@ -16,8 +16,8 @@
 
 # Utilities and performant structure for the FFI with C
 module c
-import standard
-intrude import standard::collection::array
+import core
+intrude import core::collection::array
 
 # A thin wrapper around a `NativeCArray` adding length information
 abstract class CArray[E]
index 224c7ab..4e96768 100644 (file)
@@ -19,7 +19,11 @@ module cocoa_message_box
 
 import cocoa
 
-fun dialog in "ObjC" `{
+in "ObjC" `{
+       #import <AppKit/AppKit.h>
+`}
+
+private fun dialog in "ObjC" `{
        NSAlert *alert = [[[NSAlert alloc] init] autorelease];
        [alert setMessageText:@"Hello world!"];
        [alert runModal];
similarity index 100%
rename from lib/standard/README.md
rename to lib/core/README.md
similarity index 100%
rename from lib/standard/bitset.nit
rename to lib/core/bitset.nit
similarity index 100%
rename from lib/standard/bytes.nit
rename to lib/core/bytes.nit
similarity index 99%
rename from lib/standard/collection/hash_collection.nit
rename to lib/core/collection/hash_collection.nit
index 961e560..1c9c17c 100644 (file)
@@ -505,4 +505,3 @@ private class HashSetIterator[E]
                _node = _set._first_item
        end
 end
-
similarity index 99%
rename from lib/standard/collection/list.nit
rename to lib/core/collection/list.nit
index 021a80c..4aa3242 100644 (file)
@@ -4,7 +4,7 @@
 #
 # This file is free software, which comes along with NIT.  This software is
 # distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
-# without  even  the implied warranty of  MERCHANTABILITY or  FITNESS FOR A 
+# without  even  the implied warranty of  MERCHANTABILITY or  FITNESS FOR A
 # PARTICULAR PURPOSE.  You can modify it is you want,  provided this header
 # is kept unaltered, and a notification of the changes is added.
 # You  are  allowed  to  redistribute it and sell it, alone or is a part of
@@ -49,9 +49,9 @@ class List[E]
                var t = _head
                while t != null do
                        l += 1
-                       t = t.next 
+                       t = t.next
                end
-               return l      
+               return l
        end
 
        # O(n)
@@ -198,7 +198,7 @@ class List[E]
 
        # Build an empty list.
        init do end
-       
+
        # Build a list filled with the items of `coll`.
        init from(coll: Collection[E]) do append(coll)
 
@@ -219,7 +219,7 @@ class List[E]
                        n = n.next
                        i -= 1
                end
-               return n 
+               return n
        end
 
        # get the first node that contains `e` after 'after', null otherwise
similarity index 95%
rename from lib/standard/standard.nit
rename to lib/core/core.nit
index 2251bc3..97a4271 100644 (file)
@@ -5,7 +5,7 @@
 #
 # This file is free software, which comes along with NIT.  This software is
 # distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
-# without  even  the implied warranty of  MERCHANTABILITY or  FITNESS FOR A 
+# without  even  the implied warranty of  MERCHANTABILITY or  FITNESS FOR A
 # PARTICULAR PURPOSE.  You can modify it is you want,  provided this header
 # is kept unaltered, and a notification of the changes is added.
 # You  are  allowed  to  redistribute it and sell it, alone or is a part of
 
 # Standard classes and methods used by default by Nit programs and libraries.
 # This module is implicitly imported by every module.
-module standard
+module core
 
 import posix
-import environ 
+import environ
 import time
 import file
 import exec
similarity index 99%
rename from lib/standard/environ.nit
rename to lib/core/environ.nit
index adfbedd..4774878 100644 (file)
@@ -5,7 +5,7 @@
 #
 # This file is free software, which comes along with NIT.  This software is
 # distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
-# without  even  the implied warranty of  MERCHANTABILITY or  FITNESS FOR A 
+# without  even  the implied warranty of  MERCHANTABILITY or  FITNESS FOR A
 # PARTICULAR PURPOSE.  You can modify it is you want,  provided this header
 # is kept unaltered, and a notification of the changes is added.
 # You  are  allowed  to  redistribute it and sell it, alone or is a part of
similarity index 100%
rename from lib/standard/error.nit
rename to lib/core/error.nit
similarity index 99%
rename from lib/standard/exec.nit
rename to lib/core/exec.nit
index 3e0d97a..10c5374 100644 (file)
@@ -375,4 +375,3 @@ private extern class NativeProcess `{ se_exec_data_t* `}
                }
        `}
 end
-
similarity index 100%
rename from lib/standard/file.nit
rename to lib/core/file.nit
similarity index 99%
rename from lib/standard/fixed_ints.nit
rename to lib/core/fixed_ints.nit
index daad211..17ef576 100644 (file)
@@ -818,7 +818,7 @@ redef class Text
 
        # Removes the numeric head of `self` if present
        #
-       #     intrude import standard::fixed_ints
+       #     intrude import core::fixed_ints
        #     assert "0xFFEF".strip_numhead  == "FFEF"
        #     assert "0o7364".strip_numhead  == "7364"
        #     assert "0b01001".strip_numhead == "01001"
@@ -831,7 +831,7 @@ redef class Text
        # Gets the numeric head of `self` if present
        # Returns "" otherwise
        #
-       #     intrude import standard::fixed_ints
+       #     intrude import core::fixed_ints
        #     assert "0xFEFF".get_numhead  == "0x"
        #     assert "0b01001".get_numhead == "0b"
        #     assert "0o872".get_numhead   == "0o"
@@ -848,7 +848,7 @@ redef class Text
 
        # Removes the numeric extension if present
        #
-       #     intrude import standard::fixed_ints
+       #     intrude import core::fixed_ints
        #     assert "0xFEFFu8".strip_numext  == "0xFEFF"
        #     assert "0b01001u8".strip_numext == "0b01001"
        #     assert "0o872u8".strip_numext   == "0o872"
@@ -862,7 +862,7 @@ redef class Text
        # Gets the numeric extension (i/u 8/16/32) in `self` is present
        # Returns "" otherwise
        #
-       #     intrude import standard::fixed_ints
+       #     intrude import core::fixed_ints
        #     assert "0xFEFFu8".get_numext  == "u8"
        #     assert "0b01001u8".get_numext == "u8"
        #     assert "0o872u8".get_numext   == "u8"
similarity index 100%
rename from lib/standard/gc.nit
rename to lib/core/gc.nit
similarity index 100%
rename from lib/standard/kernel.nit
rename to lib/core/kernel.nit
similarity index 100%
rename from lib/standard/math.nit
rename to lib/core/math.nit
similarity index 100%
rename from lib/standard/posix.nit
rename to lib/core/posix.nit
similarity index 100%
rename from lib/standard/queue.nit
rename to lib/core/queue.nit
similarity index 96%
rename from lib/standard/re.nit
rename to lib/core/re.nit
index 7d588ca..02e0b4f 100644 (file)
@@ -22,6 +22,7 @@
 module re
 
 import text
+intrude import text::flat
 import gc
 import error
 
@@ -35,7 +36,7 @@ in "C Header" `{
 # It is recommanded to use the higher level API offered by the class `Regex`,
 # but it can still be used for advanced purpose or in optimized code.
 #
-# To use this class and other `private` entities of this module, use `intrude import standard::re`
+# To use this class and other `private` entities of this module, use `intrude import core::re`
 private extern class NativeRegex `{ regex_t* `}
        # Allocate a new `NativeRegex`, it must then be compiled using `regcomp` before calling `regexec`
        new malloc `{ return malloc(sizeof(regex_t)); `}
@@ -354,7 +355,9 @@ class Regex
 
                # Actually execute
                text = text.to_s
-               var cstr = text.substring_from(from).to_cstring
+               var sub = text.substring_from(from)
+               var cstr = sub.to_cstring
+               var bstr = new FlatString.full(cstr, sub.bytelen, 0, sub.bytelen - 1, text.length - from)
                var eflags = gather_eflags
                var native_match = self.native_match
 
@@ -363,15 +366,19 @@ class Regex
 
                # Found one?
                if res == 0 then
+                       var bso = bstr.byte_to_char_index(native_match.rm_so)
+                       var ln = bstr.byte_to_char_index(native_match.rm_eo - native_match.rm_so - 1)
                        var match = new Match(text,
-                               from + native_match.rm_so,
-                               native_match.rm_eo - native_match.rm_so)
+                               from + bso,
+                               ln + 1)
 
                        # Add sub expressions
-                       for i in [1..nsub] do
+                       for i in [1 .. nsub] do
+                               bso = bstr.byte_to_char_index(native_match[i].rm_so)
+                               ln = bstr.byte_to_char_index(native_match[i].rm_eo - native_match[i].rm_so - 1)
                                match.subs.add new Match( text,
-                                       native_match[i].rm_so,
-                                       native_match[i].rm_eo - native_match[i].rm_so)
+                                       bso ,
+                                       ln + 1)
                        end
 
                        return match
similarity index 100%
rename from lib/standard/stream.nit
rename to lib/core/stream.nit
similarity index 99%
rename from lib/standard/text/abstract_text.nit
rename to lib/core/text/abstract_text.nit
index 1faaad3..9a88cc1 100644 (file)
@@ -231,15 +231,6 @@ abstract class Text
        #     assert "abcd".has_suffix("bcd")        ==  true
        fun has_suffix(suffix: String): Bool do return has_substring(suffix, length - suffix.length)
 
-       # Returns a copy of `self` minus all occurences of `c`
-       #
-       #     assert "__init__".remove_all('_') == "init"
-       fun remove_all(c: Char): String do
-               var b = new Buffer
-               for i in chars do if i != c then b.add i
-               return b.to_s
-       end
-
        # Returns `self` as the corresponding integer
        #
        #     assert "123".to_i        == 123
similarity index 96%
rename from lib/standard/text/flat.nit
rename to lib/core/text/flat.nit
index 917b0e5..75cf729 100644 (file)
@@ -84,6 +84,43 @@ redef class FlatText
                return ns_i
        end
 
+       private fun byte_to_char_index(index: Int): Int do
+               var ln = bytelen
+               assert index >= 0
+               assert index < bytelen
+
+               # Find best insertion point
+               var delta_begin = index
+               var delta_end = (ln - 1) - index
+               var delta_cache = (bytepos - index).abs
+               var min = delta_begin
+               var its = items
+
+               if delta_cache < min then min = delta_cache
+               if delta_end < min then min = delta_end
+
+               var ns_i: Int
+               var my_i: Int
+
+               if min == delta_begin then
+                       ns_i = first_byte
+                       my_i = 0
+               else if min == delta_cache then
+                       ns_i = bytepos
+                       my_i = position
+               else
+                       ns_i = its.find_beginning_of_char_at(last_byte)
+                       my_i = length - 1
+               end
+
+               my_i = its.byte_to_char_index_cached(index, my_i, ns_i)
+
+               position = my_i
+               bytepos = index
+
+               return my_i
+       end
+
        redef fun [](index) do return items.char_at(char_to_byte_index(index))
 end
 
similarity index 89%
rename from lib/standard/text/native.nit
rename to lib/core/text/native.nit
index 170b196..11c8d34 100644 (file)
@@ -130,6 +130,29 @@ extern class NativeString `{ char* `}
                return ns_i
        end
 
+       # Gets the byte index of char at position `n` in UTF-8 String
+       #
+       # `char_from` and `byte_from` are cached values to seek from.
+       #
+       # NOTE: char_from and byte_from are not guaranteed to be valid cache values
+       # It it up to the client to ensure the validity of the information
+       fun byte_to_char_index_cached(n, char_from, byte_from: Int): Int do
+               var ns_i = byte_from
+               var my_i = char_from
+
+               while ns_i < n do
+                       ns_i += length_of_char_at(ns_i)
+                       my_i += 1
+               end
+
+               while ns_i > n do
+                       ns_i = find_beginning_of_char_at(ns_i - 1)
+                       my_i -= 1
+               end
+
+               return my_i
+       end
+
        # Returns the beginning position of the char at position `pos`
        #
        # If the char is invalid UTF-8, `pos` is returned as-is
similarity index 89%
rename from lib/standard/text/string_search.nit
rename to lib/core/text/string_search.nit
index 22d8af3..deb4478 100644 (file)
@@ -312,20 +312,20 @@ redef class Text
                end
        end
 
-       # Search the first occurence of the pattern `p`.
+       # Search the first occurence of `pattern`.
        # Return null if not found.
        #
        #     assert "I say hello to the world!".search("hello").from  == 6
        #     assert "I say goodbye to the world!".search("hello")     == null
-       fun search(p: Pattern): nullable Match do return p.search_in(self, 0)
+       fun search(pattern: Pattern): nullable Match do return pattern.search_in(self, 0)
 
-       # Search the first occurence of the pattern `p` after `from`.
+       # Search the first occurence of `pattern` after `from`.
        # The search starts at `from`.
        # Return null if not found.
        #
        #     assert "I say hello to the world!".search_from("hello",4).from  == 6
        #     assert "I say hello to the world!".search_from("hello",7)       == null
-       fun search_from(p: Pattern, from: Int): nullable Match do return p.search_in(self, from)
+       fun search_from(pattern: Pattern, from: Int): nullable Match do return pattern.search_in(self, from)
 
        # Search the last occurence of the text `t`.
        #
@@ -358,36 +358,36 @@ redef class Text
                return null
        end
 
-       # Search all occurrences of p into self.
+       # Search all occurrences of `pattern` into self.
        #
        #     var a = new Array[Int]
        #     for i in "hello world".search_all('o') do
        #         a.add(i.from)
        #     end
        #     assert a         ==  [4, 7]
-       fun search_all(p: Pattern): Array[Match] do return p.search_all_in(self)
+       fun search_all(pattern: Pattern): Array[Match] do return pattern.search_all_in(self)
 
-       # Split `self` using `p` as separator.
+       # Split `self` using `pattern` as separator.
        #
        #     assert "hello world".split('o')          ==  ["hell", " w", "rld"]
-       fun split(p: Pattern): Array[String]
+       fun split(pattern: Pattern): Array[String]
        do
-               var matches = p.split_in(self)
+               var matches = pattern.split_in(self)
                var res = new Array[String].with_capacity(matches.length)
                for m in matches do res.add(m.to_s)
                return res
        end
 
        # @deprecated alias for `split`
-       fun split_with(p: Pattern): Array[String] do return self.split(p)
+       fun split_with(pattern: Pattern): Array[String] do return self.split(pattern)
 
-       # Split `self` on the first `=`
+       # Split `self` on the first occurence of `pattern`
        #
        #     assert "hello".split_once_on('l') == ["he", "lo"]
        #     assert "a, b, c, d, e".split_once_on(", ") == ["a", "b, c, d, e"]
-       fun split_once_on(p: Pattern): Array[SELFTYPE]
+       fun split_once_on(pattern: Pattern): Array[SELFTYPE]
        do
-               var m = p.search_in(self, 0)
+               var m = pattern.search_in(self, 0)
                var res = new Array[SELFTYPE]
                if m == null then
                        res.add self
@@ -398,13 +398,13 @@ redef class Text
                return res
        end
 
-       # Replace all occurences of a pattern with a string
+       # Replace all occurences of `pattern` with `string`
        #
        #     assert "hlelo".replace("le", "el")             ==  "hello"
        #     assert "hello".replace('l', "")        ==  "heo"
-       fun replace(p: Pattern, string: SELFTYPE): String
+       fun replace(pattern: Pattern, string: SELFTYPE): String
        do
-               return self.split_with(p).join(string)
+               return self.split_with(pattern).join(string)
        end
 
        # Does `self` contains at least one instance of `pattern`?
@@ -413,4 +413,11 @@ redef class Text
        #     assert "hello".has("ll")
        #     assert not "hello".has("lll")
        fun has(pattern: Pattern): Bool do return pattern.is_in(self)
+
+       # Returns a copy of `self` minus all occurences of `pattern`
+       #
+       #     assert "__init__".remove_all('_') == "init"
+       #     assert "abcd".remove_all("bc") == "ad"
+       #     assert "abcd".remove_all("[ad]".to_re) == "bc"
+       fun remove_all(pattern: Pattern): String do return split(pattern).join
 end
similarity index 100%
rename from lib/standard/time.nit
rename to lib/core/time.nit
index dab58bf..8fc9ccb 100644 (file)
@@ -17,8 +17,8 @@
 # Binding of C libCurl which allow us to interact with network.
 module native_curl is pkgconfig "libcurl"
 
-intrude import standard::file
-import standard
+intrude import core::file
+import core
 
 in "C header" `{
        #include <curl/curl.h>
@@ -13,7 +13,7 @@
  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. 
+ limitations under the License.
 -->
 <html>
 <head>
@@ -46,7 +46,7 @@
                        var input = $("#in").val();
 
                        // Invoke the full Nit program
-               ret = Module['callMain']([input]);
+                       ret = Module['callMain']([input]);
                }
        </script>
 </head>
@@ -65,7 +65,7 @@
 
        <h2>Program Output</h2>
        <samp id="console"></samp>
-       
+
        <script src="fibonacci.js"></script>
 </div>
 
@@ -13,7 +13,7 @@
  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. 
+ limitations under the License.
 -->
 <html>
 <head>
@@ -41,7 +41,7 @@
 
        <h1>Program output</h1>
        <samp id="console"></samp>
-       
+
        <script src="hello_world.js"></script>
 
 </body>
diff --git a/lib/gettext/examples/.gitignore b/lib/gettext/examples/.gitignore
new file mode 100644 (file)
index 0000000..a05dd58
--- /dev/null
@@ -0,0 +1 @@
+langannot.pot
similarity index 100%
rename from lib/gettext.nit
rename to lib/gettext/gettext.nit
index 1626437..75d4160 100644 (file)
@@ -29,8 +29,8 @@
 # at callers of `HashCollection::gt_collide` and `HashCollection::st_collide`.
 module hash_debug
 
-intrude import standard::collection::hash_collection
-import standard
+intrude import core::collection::hash_collection
+import core
 
 redef class Sys
        # Number of calls of `HashCollection::node_at_idx`
index 6a24c07..d3a92eb 100644 (file)
@@ -246,7 +246,7 @@ class HTMLTag
        #     var p = new HTMLTag("p")
        #     p.text("Hello World!")
        #     assert p.write_to_string      ==  "<p>Hello World!</p>"
-       # Text is escaped see: `standard::String::html_escape`
+       # Text is escaped see: `core::String::html_escape`
        fun text(txt: String): HTMLTag do
 
                children.clear
@@ -261,7 +261,7 @@ class HTMLTag
        #     p.add(new HTMLTag("br"))
        #     p.append("World!")
        #     assert p.write_to_string      ==  "<p>Hello<br/>World!</p>"
-       # Text is escaped see: standard::String::html_escape
+       # Text is escaped see: core::String::html_escape
        fun append(txt: String): HTMLTag do
                add(new HTMLRaw("", txt.html_escape))
                return self
similarity index 99%
rename from lib/mpi.nit
rename to lib/mpi/mpi.nit
index 68e5873..a9e22d8 100644 (file)
@@ -31,7 +31,7 @@ module mpi is
 end
 
 import c
-intrude import standard::text::flat
+intrude import core::text::flat
 import serialization
 private import json::serialization
 
index f580b54..e99237a 100644 (file)
@@ -20,7 +20,7 @@
 # Provides the `HttpRequest` class and services to create it
 module http_request
 
-import standard
+import core
 
 # A request received over HTTP, is build by `HttpRequestParser`
 class HttpRequest
similarity index 93%
rename from examples/pnacl/converter/Makefile
rename to lib/pnacl/examples/converter/Makefile
index 1ef5995..8c9dbd7 100644 (file)
@@ -1,4 +1,4 @@
-default: 
+default:
        ../../../bin/nitc --semi-global converter.nit
 
 HTTPD_PY := python $(NACL_SDK_ROOT)/tools/httpd.py
@@ -12,7 +12,7 @@
 # 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. 
+# limitations under the License.
 -->
 <!DOCTYPE html>
 <html>
          <div class="form-group">
            <label for="inputConvert" class="col-sm-2 control-label">Convert</label>
            <div class="col-sm-9">
-               <div class="row">
+               <div class="row">
                  <div id="pre-input" class="col-xs-2">
                    <input id="input" type="text" class="form-control" placeholder="ex: 300" required>
                  </div>
                  <div class="col-xs-3">
                    <select id="from" class="form-control" required>
-                         <option selected="selected" disabled="disabled">Currency</option>
+                         <option selected="selected" disabled="disabled">Currency</option>
                          <option>EUR</option>
                          <option>CAD</option>
                          <option>USD</option>
          <div class="form-group">
            <label for="inputTo" class="col-sm-2 control-label">to</label>
            <div class="col-sm-9">
-                   <div class="row">
+                   <div class="row">
                          <div class="col-xs-2">
                            <input id="rez" type="text" class="form-control" placeholder=".col-xs-2" disabled="disabled" style="visibility: hidden">
                          </div>
                          <div class="col-xs-3">
                            <select id="to" class="form-control" required>
-                               <option selected="selected" disabled="disabled">Currency</option>
-                               <option>EUR</option>
-                               <option>CAD</option>
-                               <option>USD</option>
-                           </select>
+                               <option selected="selected" disabled="disabled">Currency</option>
+                               <option>EUR</option>
+                               <option>CAD</option>
+                               <option>USD</option>
+                           </select>
                          </div>
                        </div>
                    </div>
 // Checks that the text in the input is numeric and not null
 // and then if two currencies where chosen sends a dictionary to Nit.
 $( "#button" ).click(function() {
-  $("#pre-input").removeClass("has-error");
-  if (($('#input').val() == "")||($.isNumeric($('#input').val()) == false)) {
-       $("#pre-input").addClass("has-error");
-  }
-  else
-  {
-       if (($('#from').val() != null) && ($('#to').val() != null)) {
-               var dictionary = {
-                       value: parseFloat($('#input').val()).toFixed(2),
-                       from: $('#from').val(),
-                       to: $('#to').val(),
+       $("#pre-input").removeClass("has-error");
+       if (($('#input').val() == "")||($.isNumeric($('#input').val()) == false)) {
+               $("#pre-input").addClass("has-error");
+       }
+       else
+       {
+               if (($('#from').val() != null) && ($('#to').val() != null)) {
+                       var dictionary = {
+                               value: parseFloat($('#input').val()).toFixed(2),
+                               from: $('#from').val(),
+                               to: $('#to').val(),
+                       }
+                       converterModule.postMessage(dictionary);
                }
-               converterModule.postMessage(dictionary);
        }
-  }
 });
similarity index 99%
rename from lib/pnacl.nit
rename to lib/pnacl/pnacl.nit
index 89ff3cf..6d41120 100644 (file)
@@ -22,8 +22,8 @@
 # 'nacl_sdk/pepper_your_pepper_version/getting_started/your_project_folder'.
 module pnacl is platform
 
-import standard
-intrude import standard::stream
+import core
+intrude import core::stream
 
 in "C Header" `{
        #include "ppapi/c/pp_errors.h"
@@ -283,7 +283,7 @@ in "C Header" `{
        }
 
        static PP_Bool Instance_HandleDocumentLoad(PP_Instance pp_instance, PP_Resource pp_url_loader) {
-               // TODO
+               // TODO
                return PP_FALSE;
        }
 
@@ -391,8 +391,8 @@ extern class PepperDictionary `{ struct PP_Var* `}
                var native_value = native_get(native_key)
                return native_value.to_nit
        end
-       
-       # Set function using PepperVars. 
+
+       # Set function using PepperVars.
        #
        # Sets the value associated with the specified key.
        # 'key' must be a String typed PepperVar.
@@ -424,11 +424,11 @@ extern class PepperDictionary `{ struct PP_Var* `}
        fun native_delete(key: PepperVar) `{
                g_varDictionaryInterface->Delete(*self, *key);
        `}
-       
+
        # Deletes the specified key and its associated value, if the key exists.
        #
        # Takes a String.
-       fun delete(key: String) 
+       fun delete(key: String)
        do
                var native_key = key.to_pepper
                native_delete native_key
index 8482352..874961f 100644 (file)
@@ -14,8 +14,8 @@
 # Exposes methods for debugging ropes when needed.
 module ropes_debug
 
-import standard
-intrude import standard::text::ropes
+import core
+intrude import core::text::ropes
 
 redef class Text
        # Writes self as a dot file on the hard drive
index 19dbb69..2693086 100644 (file)
@@ -12,7 +12,7 @@
 module saxophonit
 
 import sax
-intrude import standard::file
+intrude import core::file
 private import reader_model
 private import lexer
 
index 33d36b4..4742ad4 100644 (file)
@@ -16,7 +16,7 @@
 module engine_tools
 
 import serialization
-intrude import standard::collection::hash_collection
+intrude import core::collection::hash_collection
 
 # Maps instances to a value, uses `is_same_serialized` and `serialization_hash`.
 class StrictHashMap[K, V]
index a75f7fb..6e036b7 100644 (file)
@@ -18,7 +18,7 @@
 module socket
 
 private import socket_c
-intrude import standard::stream
+intrude import core::stream
 
 # A general Socket, either TCP or UDP
 abstract class Socket
index 023c6c1..40dcdad 100644 (file)
@@ -20,7 +20,7 @@
 module sqlite3
 
 private import native_sqlite3
-import standard
+import core
 
 # A connection to a Sqlite3 database
 class Sqlite3DB
diff --git a/lib/standard.nit b/lib/standard.nit
new file mode 100644 (file)
index 0000000..1ff8288
--- /dev/null
@@ -0,0 +1,18 @@
+# This file is part of NIT ( http://www.nitlanguage.org ).
+#
+# This file is free software, which comes along with NIT.  This software is
+# distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
+# without  even  the implied warranty of  MERCHANTABILITY or  FITNESS FOR A
+# PARTICULAR PURPOSE.  You can modify it is you want,  provided this header
+# is kept unaltered, and a notification of the changes is added.
+# You  are  allowed  to  redistribute it and sell it, alone or is a part of
+# another product.
+
+# Old module implicitly imported by the old compiler.
+# Now it just import `core`
+module standard is
+       # Use `core` instead of `standard`.
+       deprecated
+end
+
+import core
index 441df14..c3fdaad 100644 (file)
@@ -22,8 +22,8 @@ import socket
 import sha1
 import base64
 
-intrude import standard::stream
-intrude import standard::bytes
+intrude import core::stream
+intrude import core::bytes
 
 # Websocket compatible listener
 #
diff --git a/misc/jenkins/check_android.sh b/misc/jenkins/check_android.sh
new file mode 100755 (executable)
index 0000000..a8826e4
--- /dev/null
@@ -0,0 +1,102 @@
+#!/bin/bash
+# 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.
+
+# Script to test Android apps using `adb monkey`
+
+# Show the emulator window?
+show=false
+
+# Name of an already running device, as shown by `adb devices`
+dev=none
+
+# Parse command line options
+stop=false
+while [ $stop = false ]; do
+       case $1 in
+               --show) show=true; shift;;
+               --dev)  dev=$2; shift; shift;;
+               *) stop=true
+       esac
+done
+
+if [ $# = 0 ]; then
+       echo "Test an apk"
+       echo "Usage: check_android.sh [--show] [--dev android-device-name] file.apk [other_file.apk [...]]"
+       exit 1
+fi
+
+set -x
+
+# Create an AVD if none is specified
+kill_emu=false
+if [ $dev = none ]; then
+       kill_emu=true
+
+       # Name of the AVD
+       # TODO have alternatives AVD with different specs
+       avd=check_android_avd
+
+       # Port for the emulator
+       port=5600
+
+       dev=emulator-$port
+
+       # Time to wait for the emulator to be ready
+       to_sleep=20
+
+       # Does the AVD exists?
+       android list avd | grep $avd
+       if [ $? -eq 1 ]; then
+               # Create it
+               echo no | android create avd -n $avd --snapshot -t android-19 --abi x86 || true
+               to_sleep=120
+       fi
+
+       # Show the emulator window on request only
+       emu_opts=
+       if [ $show = false ]; then
+               emu_opts="-no-window"
+       fi
+
+       emulator -avd $avd -port $port -logcat app.nit $emu_opts &
+       # To use hardware optimization add: -qemu -m 512 -enable-kvm
+
+       sleep $to_sleep
+fi
+
+for apk in $@; do
+
+       # Target package name
+       pkg=`aapt dump badging $apk | grep package | sed -e "s/.*name='\([a-z._]*\)'.*/\1/"`
+
+       # Force reinstall
+       adb -s $dev uninstall $pkg
+       adb -s $dev install -r "$apk"
+
+       # Unlock screen
+       adb -s $dev shell input keyevent 82
+       adb -s $dev shell input keyevent 4
+
+       # Run monkey
+       tools_dir=`dirname $0`
+       $tools_dir/unitrun.sh "android-`basename $apk .apk`" \
+               adb -s $dev shell monkey -p $pkg \
+                       --monitor-native-crashes --throttle 2 --pct-touch 50 --pct-motion 50 5000
+done
+
+if [ $kill_emu = true ]; then
+       # Kill emulator
+       adb -s $dev emu kill
+fi
diff --git a/src/README.md b/src/README.md
new file mode 100644 (file)
index 0000000..057a4a4
--- /dev/null
@@ -0,0 +1,3 @@
+Nit compiler and tools
+
+See <http://nitlanguage.org/tools> for usage.
index 9734ed3..e4f6bb1 100644 (file)
@@ -269,7 +269,7 @@ redef class ArticleCommand
 
        redef fun make_results(nitx, results) do
                var len = results.length
-               # FIXME how to render the pager for one worded namespaces like "standard"?
+               # FIXME how to render the pager for one worded namespaces like "core"?
                if len == 1 then
                        var page = results.first.as(PageMatch).page
                        var pager = new Pager
index a82e953..4912404 100644 (file)
@@ -14,8 +14,8 @@
 # underlying implementation and that the services are semantically correct.
 module primitive_types
 
-intrude import standard::file
-intrude import standard::text::flat
+intrude import core::file
+intrude import core::text::flat
 
 # Wrapper for `NativeFile`
 class PrimitiveNativeFile
index 07ae180..6d7bbe7 100644 (file)
@@ -367,6 +367,13 @@ redef class ModelBuilder
                        mgroup.filepath = path
                        mproject.root = mgroup
                        toolcontext.info("found singleton project `{pn}` at {path}", 2)
+
+                       # Attach homonymous `ini` file to the project
+                       var inipath = path.dirname / "{pn}.ini"
+                       if inipath.file_exists then
+                               var ini = new ConfigTree(inipath)
+                               mproject.ini = ini
+                       end
                end
 
                var res = new ModulePath(pn, path, mgroup)
@@ -453,7 +460,8 @@ redef class ModelBuilder
                var mgroup
                if parent == null then
                        # no parent, thus new project
-                       if ini != null and ini.has_key("name") then pn = ini["name"]
+                       var namekey = "project.name"
+                       if ini != null and ini.has_key(namekey) then pn = ini[namekey]
                        var mproject = new MProject(pn, model)
                        mgroup = new MGroup(pn, mproject, null) # same name for the root group
                        mproject.root = mgroup
@@ -833,7 +841,7 @@ redef class ModelBuilder
                        mmodule.set_visibility_for(sup, mvisibility)
                end
                if stdimport then
-                       var mod_name = "standard"
+                       var mod_name = "core"
                        var sup = self.get_mmodule_by_name(nmodule, null, mod_name)
                        if sup == null then
                                nmodule.mmodule = null # invalidate the module
@@ -892,9 +900,9 @@ redef class ModelBuilder
 
                self.toolcontext.info("{mmodule} imports {mmodule.in_importation.direct_greaters.join(", ")}", 3)
 
-               # Force standard to be public if imported
+               # Force `core` to be public if imported
                for sup in mmodule.in_importation.greaters do
-                       if sup.name == "standard" then
+                       if sup.name == "core" then
                                mmodule.set_visibility_for(sup, public_visibility)
                        end
                end
index d49f96b..605f4d3 100644 (file)
@@ -139,20 +139,6 @@ redef class ToolContext
 
 end
 
-redef class MClass
-       # is the class imported from standard lib?
-       fun is_standard: Bool do
-               return self.intro_mmodule.mgroup.mproject.name == "standard"
-       end
-end
-
-redef class MModule
-       # is the module imported from standard lib?
-       fun is_standard: Bool do
-               return self.mgroup.mproject.name == "standard"
-       end
-end
-
 # A Metric is used to collect data about things
 #
 # The concept is reified here for a better organization and documentation
index 7812cb2..e0c3280 100644 (file)
@@ -1280,7 +1280,7 @@ class MGenericType
        redef var to_s: String is noinit
 
        # The full-name of the class, then the full-name of each type arguments within brackets.
-       # Example: `"standard::Map[standard::String, standard::List[standard::Int]]"`
+       # Example: `"core::Map[core::String, core::List[core::Int]]"`
        redef var full_name is lazy do
                var args = new Array[String]
                for t in arguments do
index 9972ea6..7ba038b 100644 (file)
@@ -110,6 +110,7 @@ private class IOSToolchain
                        "xcodebuild -target '{project_name}' " +
                        "-destination 'platform=iOS Simulator,name=iPhone' " +
                        "-configuration {if release then "Release" else "Debug"} " +
+                        "ONLY_ACTIVE_ARCH=NO "+
                        "-sdk iphonesimulator build"]
                toolcontext.exec_and_check(args, "iOS project error")
 
index e69de29..2f19e44 100644 (file)
@@ -0,0 +1,11 @@
+[project]
+name=nitc
+tags=devel,cli
+author=Jean Privat <jean@pryen.org>
+license=Apache-2.0
+[upstream]
+browse=https://github.com/nitlang/nit/tree/master/src
+git=https://github.com/nitlang/nit.git
+git.directory=src
+homepage=http://nitlanguage.org
+issues=https://github.com/nitlang/nit/issues
index b79d1c8..4a4e33c 100644 (file)
@@ -381,9 +381,9 @@ redef class ModelBuilder
                # usualy, only the original module must be imported in the unit test.
                var o = mmodule
                var g = o.mgroup
-               if g != null and g.mproject.name == "standard" then
-                       # except for a unit test in a module of standard
-                       # in this case, the whole standard must be imported
+               if g != null and g.mproject.name == "core" then
+                       # except for a unit test in a module of `core`
+                       # in this case, the whole `core` must be imported
                        o = get_mmodule_by_name(nmodule, g, g.mproject.name).as(not null)
                end
 
index c762a8f..ed2a3e1 100644 (file)
@@ -6,3 +6,4 @@ neo
 cocoa
 mpi
 emscripten
+ui_test
index d31598e..73d0b29 100644 (file)
@@ -12,7 +12,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-import standard::kernel
+import core::kernel
 
 fun foo(i: Int): nullable Int do return i
 fun bar(i: Int) do i.output
index bade6da..cbc59ce 100644 (file)
@@ -12,7 +12,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-import standard::kernel
+import core::kernel
 
 class A
        fun foo do 1.output
index 42e331a..bdec36b 100644 (file)
@@ -12,7 +12,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-import standard::kernel
+import core::kernel
 
 redef class Int
        fun next: nullable Int do if self < 20 then return self + 1 else return null
index 868c0cc..b57ff36 100644 (file)
@@ -12,7 +12,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-import standard::collection::array
+import core::collection::array
 
 var a #1alt1#var a: Array[Object]
 a = [1]#1alt2#
index 2a99ba7..14bdc8b 100644 (file)
@@ -12,7 +12,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-import standard::kernel
+import core::kernel
 
 class O
        fun foo: O do
index 26af488..b7b5a3d 100644 (file)
@@ -12,7 +12,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-import standard::kernel
+import core::kernel
 
 
 interface A
index e342e07..b06eacd 100644 (file)
@@ -12,7 +12,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-import standard::kernel
+import core::kernel
 
 fun foo(i: Int): nullable Int do return i
 fun bar(i: Int) do i.output
index 40f5674..82cc704 100644 (file)
@@ -12,7 +12,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-import standard::kernel
+import core::kernel
 
 var x
 x = null
index d4de4ed..e471207 100644 (file)
@@ -12,7 +12,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-import standard::kernel
+import core::kernel
 
 class A
        fun foo(a, b: nullable Int, c, d: Int, e,f: nullable Int)
index f5f4622..4087bb7 100644 (file)
@@ -12,7 +12,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-import standard::kernel
+import core::kernel
 
 class A
        var mandatory: Int
index 9558e13..9deed9c 100644 (file)
@@ -13,7 +13,7 @@
 # limitations under the License.
 
 import base_arg_default
-import standard::collection::array
+import core::collection::array
 
 fun order(i: Int): Int do
        '>'.output
index 0a5b8e9..522abd1 100644 (file)
@@ -12,7 +12,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-import standard::kernel
+import core::kernel
 
 abstract class A
        var x: Int
index d67a45f..17d2249 100644 (file)
@@ -12,7 +12,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-import standard::kernel
+import core::kernel
 
 interface A
        var i: Int is abstract, autoinit
index 876b85a..fb4d279 100644 (file)
@@ -12,7 +12,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-import standard::kernel
+import core::kernel
 
 interface A
        var i: Int is abstract
index 17f7076..66d7b93 100644 (file)
@@ -12,7 +12,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-import standard::kernel
+import core::kernel
 
 class A
        var a: Object is
index 9beb291..d0be6f3 100644 (file)
@@ -12,7 +12,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-import standard::collection::array
+import core::collection::array
 
 class A
        type V: nullable Object
index 612e837..9275304 100644 (file)
@@ -12,7 +12,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-import standard::kernel
+import core::kernel
 
 var b = 0b_
 var x = 0x_
index 52a4c94..8ff0f9d 100644 (file)
@@ -12,7 +12,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-import standard::kernel
+import core::kernel
 
 class A
        var i: Int = 1
index e59c93e..f46eee7 100644 (file)
@@ -12,7 +12,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-intrude import standard::collection::array
+intrude import core::collection::array
 
 var a = new Array[Bool]
 var cpt = 0
index 133aef1..baae87b 100644 (file)
@@ -12,7 +12,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-import standard::kernel
+import core::kernel
 
 class A[E] #alt2# class A[E: Object]
        type V: nullable Object #alt2# type V: Object
index e993cc9..37e2e38 100644 (file)
@@ -12,7 +12,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-import standard::kernel
+import core::kernel
 
 class A
    fun +: A
index a409bd5..e52bcfa 100644 (file)
@@ -12,7 +12,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-import standard::kernel
+import core::kernel
 
 
 redef class Int
index 8a1bb4c..052c0e1 100644 (file)
@@ -12,7 +12,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-import standard::kernel
+import core::kernel
 
 assert 0b1001 == 0x09
 assert 0o715 == 0x1CD
index 6b7a459..b7df069 100644 (file)
@@ -14,8 +14,8 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-#alt1 import standard
-#alt1 import standard::text::ropes
+#alt1 import core
+#alt1 import core::text::ropes
 
 var n = 4
 if not args.is_empty then
index dd7243b..77d8277 100644 (file)
@@ -12,7 +12,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-import standard::kernel
+import core::kernel
 
 class G[E: Object]
 end
index 274bb77..d0d2953 100644 (file)
@@ -12,7 +12,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-import standard::kernel
+import core::kernel
 
 class G[E]
 end
index 43b8e40..dfc4ab6 100644 (file)
@@ -14,7 +14,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-import standard
+import core
 
 var p = new Process("ls", "-l")
 p.wait
index 7473896..d55dba2 100644 (file)
@@ -53,7 +53,7 @@
 # Un fichier = un module. Les classes d'un module sont définies dans le fichier.
 # Au début des fichiers, les modules à importer doivent être déclarés (via le
 # mot clé "import"). Implicitement, tout module importe le module nommé
-# "standard" qui définit les classes usuelles.
+# "core" qui définit les classes usuelles.
 
 # On va étudier une représentation d'un entrepôt de produits variés.
 class Entrepot
index aabe239..4fbd8a9 100644 (file)
@@ -14,8 +14,8 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-#alt1 import standard
-#alt1 import standard::text::ropes
+#alt1 import core
+#alt1 import core::text::ropes
 
 # A procedural program (without explicit class).
 
index 1264a67..b2d800e 100644 (file)
@@ -18,8 +18,8 @@
 # It displays the value of a local variable.
 # It exhibs ways to concatenate strings.
 
-#alt1 import standard
-#alt1 import standard::text::ropes
+#alt1 import core
+#alt1 import core::text::ropes
 
 var a = 10
 # First way: Multiple parameters.
index 6dafd08..661ac30 100755 (executable)
@@ -8,10 +8,9 @@ printf "%s\n" "$@" \
        ../examples/*/src/*_android.nit \
        ../examples/*/src/*_linux.nit \
        ../examples/*/src/*_null.nit \
-       ../examples/pnacl/converter/converter.nit \
        ../examples/nitcorn/src/*.nit \
-       ../examples/mpi/src/*.nit \
        ../lib/*/examples/*.nit \
+       ../lib/*/examples/*/*.nit \
        ../contrib/friendz/src/solver_cmd.nit \
        ../contrib/neo_doxygen/src/tests/neo_doxygen_*.nit \
        ../contrib/pep8analysis/src/pep8analysis.nit \
index ad78ced..3e10daa 100644 (file)
@@ -30,3 +30,4 @@ first_letter_last_letter
 fibonacci_word
 shootout_nsieve
 test_ropebuffer
+ui_test
index 2add9e5..b536e9a 100644 (file)
@@ -1,4 +1,4 @@
---diagram package --private ./base_prot_sig2.nit -I ../lib/standard
---diagram package ./base_prot_sig2.nit -I ../lib/standard
---diagram class --private ./base_prot_sig2.nit -I ../lib/standard
---diagram class ./base_prot_sig2.nit -I ../lib/standard
+--diagram package --private ./base_prot_sig2.nit -I ../lib/core
+--diagram package ./base_prot_sig2.nit -I ../lib/core
+--diagram class --private ./base_prot_sig2.nit -I ../lib/core
+--diagram class ./base_prot_sig2.nit -I ../lib/core
index ad78ced..3e10daa 100644 (file)
@@ -30,3 +30,4 @@ first_letter_last_letter
 fibonacci_word
 shootout_nsieve
 test_ropebuffer
+ui_test
index ccec709..b865616 100644 (file)
@@ -1,9 +1,9 @@
-alt/base_arg_default_autoinit_alt1.nit:59,5--7: Error: expected at least 1 argument(s) for `init(mandatory: Int, optional: nullable Int)`; got 0. See introduction at `standard::Object::init`.
-alt/base_arg_default_autoinit_alt1.nit:68,5--7: Error: expected 2 argument(s) for `init(mandatory: Int, optional: nullable Int)`; got 3. See introduction at `standard::Object::init`.
-alt/base_arg_default_autoinit_alt1.nit:71,5--7: Error: expected 4 argument(s) for `init(mandatory: Int, optional: nullable Int, optional_b: nullable Int, mandatory_b: Int)`; got 1. See introduction at `standard::Object::init`.
-alt/base_arg_default_autoinit_alt1.nit:74,5--7: Error: expected 4 argument(s) for `init(mandatory: Int, optional: nullable Int, optional_b: nullable Int, mandatory_b: Int)`; got 2. See introduction at `standard::Object::init`.
-alt/base_arg_default_autoinit_alt1.nit:77,5--7: Error: expected 4 argument(s) for `init(mandatory: Int, optional: nullable Int, optional_b: nullable Int, mandatory_b: Int)`; got 3. See introduction at `standard::Object::init`.
-alt/base_arg_default_autoinit_alt1.nit:83,5--7: Error: expected 4 argument(s) for `init(mandatory: Int, optional: nullable Int, optional_b: nullable Int, mandatory_b: Int)`; got 5. See introduction at `standard::Object::init`.
-alt/base_arg_default_autoinit_alt1.nit:86,5--7: Error: expected 3 argument(s) for `init(optional_b: nullable Int, mandatory_b: Int, mandatory: Int)`; got 1. See introduction at `standard::Object::init`.
-alt/base_arg_default_autoinit_alt1.nit:89,5--7: Error: expected 3 argument(s) for `init(optional_b: nullable Int, mandatory_b: Int, mandatory: Int)`; got 2. See introduction at `standard::Object::init`.
-alt/base_arg_default_autoinit_alt1.nit:95,5--7: Error: expected 3 argument(s) for `init(optional_b: nullable Int, mandatory_b: Int, mandatory: Int)`; got 4. See introduction at `standard::Object::init`.
+alt/base_arg_default_autoinit_alt1.nit:59,5--7: Error: expected at least 1 argument(s) for `init(mandatory: Int, optional: nullable Int)`; got 0. See introduction at `core::Object::init`.
+alt/base_arg_default_autoinit_alt1.nit:68,5--7: Error: expected 2 argument(s) for `init(mandatory: Int, optional: nullable Int)`; got 3. See introduction at `core::Object::init`.
+alt/base_arg_default_autoinit_alt1.nit:71,5--7: Error: expected 4 argument(s) for `init(mandatory: Int, optional: nullable Int, optional_b: nullable Int, mandatory_b: Int)`; got 1. See introduction at `core::Object::init`.
+alt/base_arg_default_autoinit_alt1.nit:74,5--7: Error: expected 4 argument(s) for `init(mandatory: Int, optional: nullable Int, optional_b: nullable Int, mandatory_b: Int)`; got 2. See introduction at `core::Object::init`.
+alt/base_arg_default_autoinit_alt1.nit:77,5--7: Error: expected 4 argument(s) for `init(mandatory: Int, optional: nullable Int, optional_b: nullable Int, mandatory_b: Int)`; got 3. See introduction at `core::Object::init`.
+alt/base_arg_default_autoinit_alt1.nit:83,5--7: Error: expected 4 argument(s) for `init(mandatory: Int, optional: nullable Int, optional_b: nullable Int, mandatory_b: Int)`; got 5. See introduction at `core::Object::init`.
+alt/base_arg_default_autoinit_alt1.nit:86,5--7: Error: expected 3 argument(s) for `init(optional_b: nullable Int, mandatory_b: Int, mandatory: Int)`; got 1. See introduction at `core::Object::init`.
+alt/base_arg_default_autoinit_alt1.nit:89,5--7: Error: expected 3 argument(s) for `init(optional_b: nullable Int, mandatory_b: Int, mandatory: Int)`; got 2. See introduction at `core::Object::init`.
+alt/base_arg_default_autoinit_alt1.nit:95,5--7: Error: expected 3 argument(s) for `init(optional_b: nullable Int, mandatory_b: Int, mandatory: Int)`; got 4. See introduction at `core::Object::init`.
index 4cd5256..9caee3f 100644 (file)
@@ -1 +1 @@
-alt/base_attr_annot_1alt1.nit:33,9--11: Error: expected 0 argument(s) for `init`; got 1. See introduction at `standard::Object::init`.
+alt/base_attr_annot_1alt1.nit:33,9--11: Error: expected 0 argument(s) for `init`; got 1. See introduction at `core::Object::init`.
index 0b649c6..ea3b78f 100644 (file)
@@ -1 +1 @@
-alt/base_attr_annot_alt1.nit:33,9--11: Error: expected 1 argument(s) for `init(a: Object)`; got 0. See introduction at `standard::Object::init`.
+alt/base_attr_annot_alt1.nit:33,9--11: Error: expected 1 argument(s) for `init(a: Object)`; got 0. See introduction at `core::Object::init`.
index 968b927..28413fe 100644 (file)
@@ -1 +1 @@
-alt/base_import_alt3.nit:18,8--21: Error: cannot find module `fail` from `project1`. Tried: ., ../lib/standard, ../lib/standard/collection, alt, ../lib, ../contrib.
+alt/base_import_alt3.nit:18,8--21: Error: cannot find module `fail` from `project1`. Tried: ., ../lib/core, ../lib/core/collection, alt, ../lib, ../contrib.
index d64fbf2..335fcd3 100644 (file)
@@ -1 +1 @@
-alt/base_import_alt5.nit:20,8--25: Error: cannot find module `project2` from `project1`. Tried: ., ../lib/standard, ../lib/standard/collection, alt, ../lib, ../contrib.
+alt/base_import_alt5.nit:20,8--25: Error: cannot find module `project2` from `project1`. Tried: ., ../lib/core, ../lib/core/collection, alt, ../lib, ../contrib.
index 0cc549d..9cdbe5b 100644 (file)
@@ -1 +1 @@
-alt/base_import_alt6.nit:21,8--20: Error: cannot find `fail`. Tried: ., ../lib/standard, ../lib/standard/collection, alt, ../lib, ../contrib.
+alt/base_import_alt6.nit:21,8--20: Error: cannot find `fail`. Tried: ., ../lib/core, ../lib/core/collection, alt, ../lib, ../contrib.
index ae87071..e73cdca 100644 (file)
@@ -1 +1 @@
-alt/base_init_basic_alt5.nit:79,9--11: Error: expected 2 argument(s) for `init(c: Int, b: Int)`; got 1. See introduction at `standard::Object::init`.
+alt/base_init_basic_alt5.nit:79,9--11: Error: expected 2 argument(s) for `init(c: Int, b: Int)`; got 1. See introduction at `core::Object::init`.
index 1235c2b..7282bf5 100644 (file)
@@ -1 +1 @@
-alt/base_init_noinit_alt4.nit:30,3--5: Error: expected 0 argument(s) for `init`; got 1. See introduction at `standard::Object::init`.
+alt/base_init_noinit_alt4.nit:30,3--5: Error: expected 0 argument(s) for `init`; got 1. See introduction at `core::Object::init`.
index abd440c..7f4184e 100644 (file)
@@ -1,4 +1,4 @@
 alt/base_module_conditional_alt1.nit:17,20--30: Syntax Error: `conditional` expects module identifiers as arguments.
 alt/base_module_conditional_alt1.nit:18,32--36: Syntax Error: `conditional` expects module identifier as arguments.
-alt/base_module_conditional_alt1.nit:19,32--35: Error: cannot find module `fail` from `base_module_conditional_alt1`. Tried: ., ../lib/standard, ../lib/standard/collection, alt, ../lib, ../contrib.
-alt/base_module_conditional_alt1.nit:20,8--11: Error: cannot find module `fail` from `base_module_conditional_alt1`. Tried: ., ../lib/standard, ../lib/standard/collection, alt, ../lib, ../contrib.
+alt/base_module_conditional_alt1.nit:19,32--35: Error: cannot find module `fail` from `base_module_conditional_alt1`. Tried: ., ../lib/core, ../lib/core/collection, alt, ../lib, ../contrib.
+alt/base_module_conditional_alt1.nit:20,8--11: Error: cannot find module `fail` from `base_module_conditional_alt1`. Tried: ., ../lib/core, ../lib/core/collection, alt, ../lib, ../contrib.
index aca97d0..b41f1d6 100644 (file)
@@ -1,12 +1,12 @@
-../lib/standard/kernel.nit:32,1--225,3: Error: `kernel#Object` does not specialize `module_0#Object`. Possible duplication of the root class `Object`?
-../lib/standard/kernel.nit:227,1--300,3: Error: `kernel#Sys` does not specialize `module_0#Object`. Possible duplication of the root class `Object`?
-../lib/standard/kernel.nit:313,1--371,3: Error: `kernel#Comparable` does not specialize `module_0#Object`. Possible duplication of the root class `Object`?
-../lib/standard/kernel.nit:373,1--410,3: Error: `kernel#Discrete` does not specialize `module_0#Object`. Possible duplication of the root class `Object`?
-../lib/standard/kernel.nit:412,1--429,3: Error: `kernel#Cloneable` does not specialize `module_0#Object`. Possible duplication of the root class `Object`?
-../lib/standard/kernel.nit:431,1--486,3: Error: `kernel#Numeric` does not specialize `module_0#Object`. Possible duplication of the root class `Object`?
-../lib/standard/kernel.nit:492,1--515,3: Error: `kernel#Bool` does not specialize `module_0#Object`. Possible duplication of the root class `Object`?
-../lib/standard/kernel.nit:517,1--599,3: Error: `kernel#Float` does not specialize `module_0#Object`. Possible duplication of the root class `Object`?
-../lib/standard/kernel.nit:601,1--697,3: Error: `kernel#Byte` does not specialize `module_0#Object`. Possible duplication of the root class `Object`?
-../lib/standard/kernel.nit:699,1--884,3: Error: `kernel#Int` does not specialize `module_0#Object`. Possible duplication of the root class `Object`?
-../lib/standard/kernel.nit:886,1--1039,3: Error: `kernel#Char` does not specialize `module_0#Object`. Possible duplication of the root class `Object`?
-../lib/standard/kernel.nit:1041,1--1048,3: Error: `kernel#Pointer` does not specialize `module_0#Object`. Possible duplication of the root class `Object`?
+../lib/core/kernel.nit:32,1--225,3: Error: `kernel#Object` does not specialize `module_0#Object`. Possible duplication of the root class `Object`?
+../lib/core/kernel.nit:227,1--300,3: Error: `kernel#Sys` does not specialize `module_0#Object`. Possible duplication of the root class `Object`?
+../lib/core/kernel.nit:313,1--371,3: Error: `kernel#Comparable` does not specialize `module_0#Object`. Possible duplication of the root class `Object`?
+../lib/core/kernel.nit:373,1--410,3: Error: `kernel#Discrete` does not specialize `module_0#Object`. Possible duplication of the root class `Object`?
+../lib/core/kernel.nit:412,1--429,3: Error: `kernel#Cloneable` does not specialize `module_0#Object`. Possible duplication of the root class `Object`?
+../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--697,3: Error: `kernel#Byte` does not specialize `module_0#Object`. Possible duplication of the root class `Object`?
+../lib/core/kernel.nit:699,1--884,3: Error: `kernel#Int` does not specialize `module_0#Object`. Possible duplication of the root class `Object`?
+../lib/core/kernel.nit:886,1--1039,3: Error: `kernel#Char` does not specialize `module_0#Object`. Possible duplication of the root class `Object`?
+../lib/core/kernel.nit:1041,1--1048,3: Error: `kernel#Pointer` does not specialize `module_0#Object`. Possible duplication of the root class `Object`?
index dc98934..a466472 100644 (file)
@@ -1,4 +1,4 @@
-error_init_auto.nit:34,5--7: Error: expected 1 argument(s) for `init(x: Int)`; got 0. See introduction at `standard::Object::init`.
-error_init_auto.nit:36,5--7: Error: expected 1 argument(s) for `init(x: Int)`; got 2. See introduction at `standard::Object::init`.
-error_init_auto.nit:37,5--7: Error: expected 1 argument(s) for `init(x: Int)`; got 3. See introduction at `standard::Object::init`.
+error_init_auto.nit:34,5--7: Error: expected 1 argument(s) for `init(x: Int)`; got 0. See introduction at `core::Object::init`.
+error_init_auto.nit:36,5--7: Error: expected 1 argument(s) for `init(x: Int)`; got 2. See introduction at `core::Object::init`.
+error_init_auto.nit:37,5--7: Error: expected 1 argument(s) for `init(x: Int)`; got 3. See introduction at `core::Object::init`.
 error_init_auto.nit:38,11--13: Error: method `foo` does not exists in `A`.
index a13c50a..3356259 100644 (file)
@@ -1,4 +1,4 @@
-alt/error_init_auto_alt1.nit:35,5--7: Error: expected 0 argument(s) for `init`; got 1. See introduction at `standard::Object::init`.
-alt/error_init_auto_alt1.nit:36,5--7: Error: expected 0 argument(s) for `init`; got 2. See introduction at `standard::Object::init`.
-alt/error_init_auto_alt1.nit:37,5--7: Error: expected 0 argument(s) for `init`; got 3. See introduction at `standard::Object::init`.
+alt/error_init_auto_alt1.nit:35,5--7: Error: expected 0 argument(s) for `init`; got 1. See introduction at `core::Object::init`.
+alt/error_init_auto_alt1.nit:36,5--7: Error: expected 0 argument(s) for `init`; got 2. See introduction at `core::Object::init`.
+alt/error_init_auto_alt1.nit:37,5--7: Error: expected 0 argument(s) for `init`; got 3. See introduction at `core::Object::init`.
 alt/error_init_auto_alt1.nit:38,11--13: Error: method `foo` does not exists in `A`.
index d4a95b7..af18d0c 100644 (file)
@@ -1,4 +1,4 @@
-alt/error_init_auto_alt2.nit:34,5--7: Error: expected 2 argument(s) for `init(x: Int, y: Int)`; got 0. See introduction at `standard::Object::init`.
-alt/error_init_auto_alt2.nit:35,5--7: Error: expected 2 argument(s) for `init(x: Int, y: Int)`; got 1. See introduction at `standard::Object::init`.
-alt/error_init_auto_alt2.nit:37,5--7: Error: expected 2 argument(s) for `init(x: Int, y: Int)`; got 3. See introduction at `standard::Object::init`.
+alt/error_init_auto_alt2.nit:34,5--7: Error: expected 2 argument(s) for `init(x: Int, y: Int)`; got 0. See introduction at `core::Object::init`.
+alt/error_init_auto_alt2.nit:35,5--7: Error: expected 2 argument(s) for `init(x: Int, y: Int)`; got 1. See introduction at `core::Object::init`.
+alt/error_init_auto_alt2.nit:37,5--7: Error: expected 2 argument(s) for `init(x: Int, y: Int)`; got 3. See introduction at `core::Object::init`.
 alt/error_init_auto_alt2.nit:38,11--13: Error: method `foo` does not exists in `A`.
index e1b5e3f..1e2a53a 100644 (file)
@@ -1,3 +1,3 @@
-alt/error_init_auto_alt4.nit:34,5--7: Error: expected 1 argument(s) for `init(x: Int)`; got 0. See introduction at `standard::Object::init`.
-alt/error_init_auto_alt4.nit:36,5--7: Error: expected 1 argument(s) for `init(x: Int)`; got 2. See introduction at `standard::Object::init`.
-alt/error_init_auto_alt4.nit:37,5--7: Error: expected 1 argument(s) for `init(x: Int)`; got 3. See introduction at `standard::Object::init`.
+alt/error_init_auto_alt4.nit:34,5--7: Error: expected 1 argument(s) for `init(x: Int)`; got 0. See introduction at `core::Object::init`.
+alt/error_init_auto_alt4.nit:36,5--7: Error: expected 1 argument(s) for `init(x: Int)`; got 2. See introduction at `core::Object::init`.
+alt/error_init_auto_alt4.nit:37,5--7: Error: expected 1 argument(s) for `init(x: Int)`; got 3. See introduction at `core::Object::init`.
index 29ce68b..1f4dbf5 100644 (file)
@@ -1 +1 @@
-error_mod_unk.nit:17,8--11: Error: cannot find module `dfgd` from `error_mod_unk`. Tried: ., ../lib/standard, ../lib/standard/collection, alt, ../lib, ../contrib.
+error_mod_unk.nit:17,8--11: Error: cannot find module `dfgd` from `error_mod_unk`. Tried: ., ../lib/core, ../lib/core/collection, alt, ../lib, ../contrib.
index ed63849..8e5869f 100644 (file)
@@ -1,4 +1,4 @@
-Runtime error: Cast failed. Expected `OTHER`, got `Float` (../lib/standard/kernel.nit:720)
+Runtime error: Cast failed. Expected `OTHER`, got `Float` (../lib/core/kernel.nit:720)
 11
 21
 31
index ed63849..8e5869f 100644 (file)
@@ -1,4 +1,4 @@
-Runtime error: Cast failed. Expected `OTHER`, got `Float` (../lib/standard/kernel.nit:720)
+Runtime error: Cast failed. Expected `OTHER`, got `Float` (../lib/core/kernel.nit:720)
 11
 21
 31
index ed63849..8e5869f 100644 (file)
@@ -1,4 +1,4 @@
-Runtime error: Cast failed. Expected `OTHER`, got `Float` (../lib/standard/kernel.nit:720)
+Runtime error: Cast failed. Expected `OTHER`, got `Float` (../lib/core/kernel.nit:720)
 11
 21
 31
diff --git a/tests/sav/nitcg/fixme/complete_simple_android.res b/tests/sav/nitcg/fixme/complete_simple_android.res
deleted file mode 100644 (file)
index 4ad3dc3..0000000
+++ /dev/null
@@ -1 +0,0 @@
-UNDEFINED
diff --git a/tests/sav/nitcsg/fixme/complete_simple_android.res b/tests/sav/nitcsg/fixme/complete_simple_android.res
deleted file mode 100644 (file)
index 4ad3dc3..0000000
+++ /dev/null
@@ -1 +0,0 @@
-UNDEFINED
diff --git a/tests/sav/niti/complete_simple_android.res b/tests/sav/niti/complete_simple_android.res
deleted file mode 100644 (file)
index 123fbb3..0000000
+++ /dev/null
@@ -1 +0,0 @@
-../lib/android/platform.nit:18,20--37: Error: target platform `android` unknown.
diff --git a/tests/sav/niti/simple_android.res b/tests/sav/niti/simple_android.res
deleted file mode 100644 (file)
index 123fbb3..0000000
+++ /dev/null
@@ -1 +0,0 @@
-../lib/android/platform.nit:18,20--37: Error: target platform `android` unknown.
index d93978e..aaf02ae 100644 (file)
@@ -1,4 +1,4 @@
-Runtime error: Cast failed. Expected `OTHER`, got `Float` (../lib/standard/kernel.nit:542)
+Runtime error: Cast failed. Expected `OTHER`, got `Float` (../lib/core/kernel.nit:542)
 11
 21
 31
index d93978e..aaf02ae 100644 (file)
@@ -1,4 +1,4 @@
-Runtime error: Cast failed. Expected `OTHER`, got `Float` (../lib/standard/kernel.nit:542)
+Runtime error: Cast failed. Expected `OTHER`, got `Float` (../lib/core/kernel.nit:542)
 11
 21
 31
index d93978e..aaf02ae 100644 (file)
@@ -1,4 +1,4 @@
-Runtime error: Cast failed. Expected `OTHER`, got `Float` (../lib/standard/kernel.nit:542)
+Runtime error: Cast failed. Expected `OTHER`, got `Float` (../lib/core/kernel.nit:542)
 11
 21
 31
index b8f0ce3..9c69939 100644 (file)
@@ -17,7 +17,7 @@
 # Module comment
 module test_mod2 # second comment
 
-import standard::kernel
-#import standard::text
+import core::kernel
+#import core::text
 import template # no need for string
-# import standard
+# import core
index 4e30ae2..ef5a694 100644 (file)
@@ -13,8 +13,8 @@
 # limitations under the License.
 
 import end
-intrude import standard::kernel
-private import standard::text
+intrude import core::kernel
+private import core::text
 
 `{`}
 
index 26f83e5..cb3d574 100644 (file)
@@ -17,8 +17,8 @@
 # Module comment
 module test_mod2 # second comment
 
-import standard::kernel
-#import standard::text
+import core::kernel
+#import core::text
 
 import template # no need for string
-# import standard
\ No newline at end of file
+# import core
\ No newline at end of file
index 71d112f..33a3bfe 100644 (file)
@@ -13,8 +13,8 @@
 # limitations under the License.
 
 import end
-intrude import standard::kernel
-private import standard::text
+intrude import core::kernel
+private import core::text
 
 `{`}
 
index b36335e..2d0898a 100644 (file)
@@ -13,6 +13,7 @@ redef class Deserializer
                if name == "Array[nullable Object]" then return new Array[nullable Object].from_deserializer(self)
                if name == "Array[Serializable]" then return new Array[Serializable].from_deserializer(self)
                if name == "Array[Object]" then return new Array[Object].from_deserializer(self)
+               if name == "Array[Match]" then return new Array[Match].from_deserializer(self)
                return super
        end
 end
index 8c655a2..5d5471f 100644 (file)
@@ -5,17 +5,17 @@ Entities: 4; Documented ones: 3; With nitunits: 3; Failures: 0
 TestSuites:
 No test cases found
 Class suites: 0; Test Cases: 0; Failures: 0
-<testsuites><testsuite package="test_nitunit2"><testcase classname="nitunit.test_nitunit2.standard::Sys" name="test_nitunit2::Sys::foo1"><system-err></system-err><system-out>if true then
+<testsuites><testsuite package="test_nitunit2"><testcase classname="nitunit.test_nitunit2.core::Sys" name="test_nitunit2::Sys::foo1"><system-err></system-err><system-out>if true then
 
    assert true
 
 end
-</system-out></testcase><testcase classname="nitunit.test_nitunit2.standard::Sys" name="test_nitunit2::Sys::bar2"><system-err></system-err><system-out>if true then
+</system-out></testcase><testcase classname="nitunit.test_nitunit2.core::Sys" name="test_nitunit2::Sys::bar2"><system-err></system-err><system-out>if true then
 
     assert true
 
 end
-</system-out></testcase><testcase classname="nitunit.test_nitunit2.standard::Sys" name="test_nitunit2::Sys::foo3"><system-err></system-err><system-out>var a = 1
+</system-out></testcase><testcase classname="nitunit.test_nitunit2.core::Sys" name="test_nitunit2::Sys::foo3"><system-err></system-err><system-out>var a = 1
 assert a == 1
 assert a == 1
 </system-out></testcase></testsuite><testsuite></testsuite></testsuites>
\ No newline at end of file
index 3da2105..e89f593 100644 (file)
@@ -5,7 +5,7 @@ Entities: 6; Documented ones: 5; With nitunits: 3; Failures: 0
 TestSuites:
 No test cases found
 Class suites: 0; Test Cases: 0; Failures: 0
-<testsuites><testsuite package="test_doc2"><testcase classname="nitunit.test_doc2.standard::Sys" name="test_doc2::Sys::foo1"><system-err></system-err><system-out>assert true # tested
-</system-out></testcase><testcase classname="nitunit.test_doc2.standard::Sys" name="test_doc2::Sys::foo2"><system-err></system-err><system-out>assert true # tested
-</system-out></testcase><testcase classname="nitunit.test_doc2.standard::Sys" name="test_doc2::Sys::foo3"><system-err></system-err><system-out>assert true # tested
+<testsuites><testsuite package="test_doc2"><testcase classname="nitunit.test_doc2.core::Sys" name="test_doc2::Sys::foo1"><system-err></system-err><system-out>assert true # tested
+</system-out></testcase><testcase classname="nitunit.test_doc2.core::Sys" name="test_doc2::Sys::foo2"><system-err></system-err><system-out>assert true # tested
+</system-out></testcase><testcase classname="nitunit.test_doc2.core::Sys" name="test_doc2::Sys::foo3"><system-err></system-err><system-out>assert true # tested
 </system-out></testcase></testsuite><testsuite></testsuite></testsuites>
\ No newline at end of file
index e1dcdb7..3f42f57 100644 (file)
@@ -7,4 +7,4 @@ Entities: 6; Documented ones: 5; With nitunits: 3; Failures: 3
 TestSuites:
 No test cases found
 Class suites: 0; Test Cases: 0; Failures: 0
-<testsuites><testsuite package="test_doc3"><testcase classname="nitunit.test_doc3.standard::Sys" name="test_doc3::Sys::foo1"><failure message="test_doc3.nit:15,1--18,0: Invalid block of code. At 1,3--9: Syntax Error: unexpected identifier &#39;garbage&#39;.."></failure></testcase><testcase classname="nitunit.test_doc3.standard::Sys" name="test_doc3::Sys::foo2"><failure message="test_doc3.nit:20,1--25,0: Invalid block of code. At 1,2--8: Syntax Error: unexpected identifier &#39;garbage&#39;.."></failure></testcase><testcase classname="nitunit.test_doc3.standard::Sys" name="test_doc3::Sys::foo3"><failure message="test_doc3.nit:27,1--32,0: Invalid block of code. At 1,2--8: Syntax Error: unexpected identifier &#39;garbage&#39;.."></failure></testcase></testsuite><testsuite></testsuite></testsuites>
\ No newline at end of file
+<testsuites><testsuite package="test_doc3"><testcase classname="nitunit.test_doc3.core::Sys" name="test_doc3::Sys::foo1"><failure message="test_doc3.nit:15,1--18,0: Invalid block of code. At 1,3--9: Syntax Error: unexpected identifier &#39;garbage&#39;.."></failure></testcase><testcase classname="nitunit.test_doc3.core::Sys" name="test_doc3::Sys::foo2"><failure message="test_doc3.nit:20,1--25,0: Invalid block of code. At 1,2--8: Syntax Error: unexpected identifier &#39;garbage&#39;.."></failure></testcase><testcase classname="nitunit.test_doc3.core::Sys" name="test_doc3::Sys::foo3"><failure message="test_doc3.nit:27,1--32,0: Invalid block of code. At 1,2--8: Syntax Error: unexpected identifier &#39;garbage&#39;.."></failure></testcase></testsuite><testsuite></testsuite></testsuites>
\ No newline at end of file
diff --git a/tests/sav/simple_linux.res b/tests/sav/simple_linux.res
deleted file mode 100644 (file)
index c1dad34..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-../lib/mnit_linux/linux_app.nit:29,16--31: Redef Error: a virtual type cannot be refined.
-../lib/mnit_linux/linux_app.nit:30,16--29: Redef Error: a virtual type cannot be refined.
index fcde192..458de3c 100644 (file)
@@ -1,4 +1,4 @@
-Runtime error: Cast failed. Expected `E`, got `Bool` (../lib/standard/collection/array.nit:960)
+Runtime error: Cast failed. Expected `E`, got `Bool` (../lib/core/collection/array.nit:960)
 NativeString
 0x4e
 Nit
index aee2b8f..a6f70bd 100644 (file)
@@ -1,5 +1,5 @@
-#alt1 import standard::text::ropes
-#alt1 import standard
+#alt1 import core::text::ropes
+#alt1 import core
 
 var trimtest = "   \t nono nono   \n \t"
 
index 4615cf6..3165543 100644 (file)
@@ -12,8 +12,8 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-import standard
-intrude import standard::text::ropes
+import core
+intrude import core::text::ropes
 
 var rp: String = new Concat("xxx", "yyy")
 rp += "zzz"
index 0e8df59..1c18b03 100644 (file)
@@ -12,7 +12,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-import standard::kernel
+import core::kernel
 
 in "C Header" `{
        // C types of public Nit classes must be in the C header block
index 091c999..5181198 100644 (file)
@@ -14,7 +14,7 @@
 
 # Test callback to an extern constructor from extern code
 
-import standard::text
+import core::text
 
 extern class IntPtr `{ int* `}
        new (v: Int) `{
index 1e54bee..8b1d6bc 100644 (file)
@@ -12,7 +12,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-#alt1 import standard
+#alt1 import core
 #alt1 import buffered_ropes
 
 var st = "quick brown fox over the lazy dog"
index 44be897..3860835 100644 (file)
@@ -15,7 +15,7 @@ redef enum Int
        end
 end
 
-# call local::to_s and then standard::to_s
+# call local::to_s and then core::to_s
 print 123.to_s
 
 # call Int::foo and then Object::foo
index d80d4ec..4b0964b 100644 (file)
@@ -13,8 +13,8 @@
 # limitations under the License.
 
 import end
-intrude import standard::kernel
-private import standard::text
+intrude import core::kernel
+private import core::text
 
 `{`}
 
index 80517b9..397eebc 100644 (file)
@@ -17,8 +17,8 @@
 # Module comment
 module test_mod2 # second comment
 
-   import standard::kernel
-#import standard::text
+   import core::kernel
+#import core::text
 
        import template # no need for string
-# import standard
+# import core
index f499510..8c3efda 100644 (file)
@@ -19,3 +19,11 @@ var re = "a+".to_re #alt1#
 
 print "aa".has(re)
 print "bb".has(re)
+
+var str = "é12345"
+
+var re1 = "3".to_re
+print str.split(re1)
+
+var re2 = "5".to_re
+print str.split(re2)
index 5e2a585..7ea9920 100644 (file)
@@ -12,8 +12,8 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-import standard
-intrude import standard::text::ropes
+import core
+intrude import core::text::ropes
 
 # Force building a Rope
 redef fun maxlen: Int do return once 2
index 06caf25..b2592a1 100644 (file)
@@ -18,8 +18,8 @@
 # the buffer.
 module test_ropes_buffer_add_overflow
 
-import standard
-intrude import standard::text::ropes
+import core
+intrude import core::text::ropes
 
 var buffer = new RopeBuffer
 
index eba364e..4293f8b 100644 (file)
@@ -15,7 +15,7 @@
 # Checks if `RopeBuffer.clear` actually reset everything.
 module test_ropes_buffer_clear
 
-import standard
+import core
 
 var buffer = new RopeBuffer
 
index e4a0170..1d8033c 100644 (file)
@@ -14,7 +14,7 @@
 
 module test_ropes_buffer_reverse
 
-import standard
+import core
 
 redef fun maxlen do return 3
 
index cc8eb4f..6078961 100644 (file)
@@ -15,7 +15,7 @@
 # Checks the immutability of the strings returned by `RopeBuffer.to_s`.
 module test_ropes_buffer_to_s
 
-import standard
+import core
 
 # Note: In this sort of test, never print the string more than once: the string
 # itself may cache an flatten representation of itself when `print` calls `to_s`
index 3eef039..95f8dc7 100644 (file)
@@ -14,8 +14,8 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-#alt1 import standard
-#alt1 import standard::text::ropes
+#alt1 import core
+#alt1 import core::text::ropes
 
 var s = "Bonjour !\n"
 var r: Buffer = new FlatBuffer.with_capacity(50)
index 3e7da27..ea3db1e 100644 (file)
@@ -12,7 +12,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-#alt2 import standard
+#alt2 import core
 #alt2 import buffered_ropes
 
 var str = "Woe to you, oh earth and sea for the Devil sends the beast with wrath because he knows the time is short. Let him who hath understanding reckon the number of the beast, for it is a human number, its number is Six Hundred and Sixty-Six."
index 7d94a50..b821db4 100644 (file)
@@ -12,7 +12,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-#alt1 import standard::text::ropes
+#alt1 import core::text::ropes
 
 var x: Buffer = new FlatBuffer.from("test")
 #alt1 x = new RopeBuffer.from("test")
index d069253..de412ac 100644 (file)
@@ -12,8 +12,8 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-intrude import standard::text::flat
-import standard
+intrude import core::text::flat
+import core
 
 var s = "𐏓􏿿".as(FlatString)
 print s.items.char_at(0).ascii.to_hex
index 768b698..99e3008 100755 (executable)
@@ -578,7 +578,7 @@ for ii in "$@"; do
 
        tmp=${ii/../AA}
        if [ "x$tmp" = "x$ii" ]; then
-               includes="-I . -I ../lib/standard -I ../lib/standard/collection -I alt"
+               includes="-I . -I ../lib/core -I ../lib/core/collection -I alt"
        else
                includes="-I alt"
        fi