diff -Nru falconpl-0.9.1.8/build.sh falconpl-0.9.2/build.sh --- falconpl-0.9.1.8/build.sh 2009-05-19 19:36:34.000000000 +0100 +++ falconpl-0.9.2/build.sh 2009-06-20 19:13:04.000000000 +0100 @@ -77,6 +77,8 @@ -s Do NOT strip binaries even if in reselase mode. -int Do NOT use internal versions of ZLIB and PCRE -l set a different library path under prefix (default is lib) + -r Change RPATH (defaults to {prefix|final}/lib). + -b Recompile grammar files through bison. Environment variables CFLAGS - extra C flags to pass to the compiler @@ -94,12 +96,14 @@ EOT TARGET_DEST="" +SPEC_RPATH="" TARGET_LIB_DIR="lib" FINAL_DEST="" DO_INSTALL="no" DEBUG="no" STRIP="yes" PROCESSORS="1" +SKIP_BISON="-DSKIP_BISON:BOOL=ON" BUILD_WITH_MY_LIBS="-DWITH_INTERNAL_PCRE=ON -DWITH_INTERNAL_ZLIB=ON" until [ -z "$1" ]; do @@ -109,7 +113,9 @@ "-f") shift; FINAL_DEST=$1;; "-i") DO_INSTALL="yes";; "-j") shift; PROCESSORS=$1;; + "-r") shift; SPEC_RPATH="-DFALCON_RPATH=$1";; "-int") BUILD_WITH_MY_LIBS="";; + "-b") SKIP_BISON="";; "-d") DEBUG="yes";; "-s") STRIP="no";; *) func_usage ; exit 1 ;; @@ -197,14 +203,17 @@ echo "Performing also installing!" fi -cmake -DCMAKE_CXX_FLAGS:STRING="$CXXFLAGS" \ +cmake -Wno-dev \ + -DCMAKE_CXX_FLAGS:STRING="$CXXFLAGS" \ -DCMAKE_C_FLAGS:STRING="$CFLAGS" \ -DCMAKE_LD_FLAGS:STRING="$LDFLAGS" \ -DCMAKE_BUILD_TYPE:STRING="$FALCON_BUILD_TYPE" \ -DFALCON_INSTALL_TREE_LIB:STRING="$TARGET_LIB_DIR" \ -DFALCON_INSTALL_TREE:STRING="$TARGET_DEST" \ -DFALCON_FINAL_DESTINATION:STRING="$FINAL_DEST" \ + $SKIP_BISON \ $BUILD_WITH_MY_LIBS \ + $SPEC_RPATH \ $EXTRA_CMAKE \ $FALCON_SRC_TREE \ || func_errors diff -Nru /tmp/qLlpeOGf0f/falconpl-0.9.1.8/ChangeLog /tmp/Y4mp0W3rzG/falconpl-0.9.2/ChangeLog --- falconpl-0.9.1.8/ChangeLog 2009-05-19 12:02:04.000000000 +0100 +++ falconpl-0.9.2/ChangeLog 2009-06-20 14:21:46.000000000 +0100 @@ -1,3 +1,35 @@ +Falcon (0.9.2) + * fixed: using more modern throw instead of the obsolete raise() functions + in many points. + * fixed: "find" method in strings was erroneusly named "strFind". + * minor: Added brigade() ETA function. + * fixed: Directory class wasn't masked; as a result, using it caused crash. + As a fix, we removed DirectoryOpen function and allowed Directory + constructor to work as previously done by DirectoryOpen. + * added: Directory.descend (it's meant to be a reminder for a complete + do() framework). + * fixed: List.first() wasn't returning a fully prepared iterator. + * fixed: Oob wasn't working properly on immediate strings. + * fixed: isoob() was returning 0 or 1 instead or false/true. + * fixed: PostMessage() wasn't forwarding errors to the main VM loop in case + of asynchronous message posting. + * fixed: More correct error messages in case of problems loading submodules. + * added: Method wordSize() to MemBuf metaclass. + * fixed: Particular errors in class declaration may have caused error detection + to segfault. + * fixed: Array back-mark to its table did not deep-mark its data; as a result, + the table got marked with the current generation and skipped its mark + processing loop as a standard object. This exposes the need to + rationalize and simplify the Garbage/mark Object/gcMark interface. + * fixed: LiveModule::detach() was nilling the original (imported) values + rather than the local objects. + * fixed: fself wasn't working in init blocks. + * fixed: Error class couldn't be inherited from scripts. + * fixed: For/in loops with negative step exited immediately when start == stop + * added: Added String.startsWith, String.endsWith, strStartWith(), strEndWith() + * fixed: Multiline strings in MS-Win text file format sources (CRLF) couldn't + be correctly parsed. + Falcon (0.9.1.8) * fixed: faltest didn't output help text when called with -h/-? * fixed: Operator overriding in blessed dictionaries had many issues. @@ -8,31 +40,32 @@ communicate across threads. * minor: StringStream is now interlocked; it can be proficiently used as an interthread safe raw data exchange device. - * fixed: Obviating the need for ";" in function declared inside + * fixed: Obviating the need for ";" in function declared inside dictionaries. * minor: Falcon command line doesn't require full module generation to generate the debug grammar tree module. * major: Now allowing circular references in module loads. * fixed: Unpack is now working in every situation (and generally, more efficiently). - * fixed: Didn't set correctly the default .ftt extension for -y options, and + * fixed: Didn't set correctly the default .ftt extension for -y options, and caused the original file to be overwritten. * fixed: Issues on multilanguage and internationalization. - * minor: Added search path to the engine and to all the items involved into + * minor: Added search path to the engine and to all the items involved into compilation. Also, added vmSearchPath() script function to allow scripts to get the path as set by the application. * fixed: Format wasn't correctly parsing ":0" (zero-length variable length integer formatting). * fixed: Escapes at the beginning of multiline double-quote strings were lost. - + * fixed: Possible reaping of table pages by an execessive GC usage. + Falcon (0.9.1.6) * fixed: In loop statement, continue looped from the top skipping the loop condition (if it was present). * fixed: Function "any" was STILL returning 0 instead of false. * major: Added method ptr() to FBOM and various metaclasses. - * major: Added explicit character size scaling and c-zation of + * major: Added explicit character size scaling and c-zation of Falcon::Strings. - * fixed: Repeated assert() may have crashed depending on the stack + * fixed: Repeated assert() may have crashed depending on the stack status. * fixed: Due to faulty method equality check, method unsubscription was failing. @@ -46,10 +79,10 @@ know it was a sequence. * minor: Added first() and last() methods to VMSlot to allow iterators to work. - * fixed: Detach() sequence was just a draft, and didn't actually free + * fixed: Detach() sequence was just a draft, and didn't actually free app-side data. * fixed: Respecting ThreadParams settings in POSIX thread creation. - * fixed: Dind't correctly generate InterruptedError on VM interruption + * fixed: Dind't correctly generate InterruptedError on VM interruption requests. * fixed: Function parameters were still hard-limited to 255. Now they are limited to uint32 (2^32). @@ -66,14 +99,14 @@ Falcon (0.9.1.4) * fixed: As now files and modules loads are URIs, and URI decoding was - strict, modules with international names could not be loaded + strict, modules with international names could not be loaded unless the name was previously URI escaped. * minor: Now it's possible to prevent parsing (un-escaping) from URI constructor. * minor: Fixed error failed DLL load error report string in Windows. - * fixed: Now correctly importing symbols from modules named with + * fixed: Now correctly importing symbols from modules named with strings. - + Falcon (0.9.1.2) * fixed: Correct parsing of octal number (0 and 7 was out...) * fixed: Crash with statements == just numbers, and allowing interactive diff -Nru /tmp/qLlpeOGf0f/falconpl-0.9.1.8/core/clt/falcon/falcon.rc /tmp/Y4mp0W3rzG/falconpl-0.9.2/core/clt/falcon/falcon.rc --- falconpl-0.9.1.8/core/clt/falcon/falcon.rc 2007-12-21 12:09:00.000000000 +0000 +++ falconpl-0.9.2/core/clt/falcon/falcon.rc 2009-06-19 12:01:44.000000000 +0100 @@ -1,54 +1,54 @@ -///////////////////////////////////////////////////////////////////////////// -// -// Icon -// - -// Icon with lowest ID value placed first to ensure application icon -// remains consistent on all systems. -MAINICON ICON "resources\\falcon-ico-base.ico" - -///////////////////////////////////////////////////////////////////////////// -// -// Version -// - -// for project wide versioning... -#include -#include - -// and application versioning -#include "version.h" -#define VS_VERSION_INFO 1 - -VS_VERSION_INFO VERSIONINFO - FILEVERSION FCLT_VERSION_MAJOR, FCLT_VERSION_MINOR, FCLT_VERSION_REVISION, 0 - PRODUCTVERSION FALCON_VERSION_RCINFO_N - FILEFLAGSMASK 0x17L -#ifdef _DEBUG - FILEFLAGS 0x1L -#else - FILEFLAGS 0x0L -#endif - FILEOS 0x4L - FILETYPE 0x0L - FILESUBTYPE 0x0L -BEGIN - BLOCK "StringFileInfo" - BEGIN - BLOCK "041004b0" - BEGIN - VALUE "CompanyName", "Falcon Committee" - VALUE "FileDescription", "The Falcon command line compiler" - VALUE "FileVersion", FALCON_MAKE_VERSION_STRING( FCLT_VERSION_MAJOR, FCLT_VERSION_MINOR, FCLT_VERSION_REVISION ) - VALUE "InternalName", "falcon" - VALUE "LegalCopyright", "The Falcon Programming Language License" - VALUE "OriginalFilename", "falcon.exe" - VALUE "ProductName", "The Falcon Programming Language" - VALUE "ProductVersion", FALCON_VERSION - END - END - BLOCK "VarFileInfo" - BEGIN - VALUE "Translation", 0x410, 1200 - END -END +///////////////////////////////////////////////////////////////////////////// +// +// Icon +// + +// Icon with lowest ID value placed first to ensure application icon +// remains consistent on all systems. +MAINICON ICON "resources\\falcon-ico-base.ico" + +///////////////////////////////////////////////////////////////////////////// +// +// Version +// + +// for project wide versioning... +#include +#include + +// and application versioning +#include "version.h" +#define VS_VERSION_INFO 1 + +VS_VERSION_INFO VERSIONINFO + FILEVERSION FCLT_VERSION_MAJOR, FCLT_VERSION_MINOR, FCLT_VERSION_REVISION, 0 + PRODUCTVERSION FALCON_VERSION_RCINFO_N + FILEFLAGSMASK 0x17L +#ifdef _DEBUG + FILEFLAGS 0x1L +#else + FILEFLAGS 0x0L +#endif + FILEOS 0x4L + FILETYPE 0x0L + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "041004b0" + BEGIN + VALUE "CompanyName", "Falcon Committee" + VALUE "FileDescription", "The Falcon command line compiler" + VALUE "FileVersion", FALCON_MAKE_VERSION_STRING( FCLT_VERSION_MAJOR, FCLT_VERSION_MINOR, FCLT_VERSION_REVISION ) + VALUE "InternalName", "falcon" + VALUE "LegalCopyright", "The Falcon Programming Language License" + VALUE "OriginalFilename", "falcon.exe" + VALUE "ProductName", "The Falcon Programming Language" + VALUE "ProductVersion", FALCON_VERSION + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x410, 1200 + END +END diff -Nru /tmp/qLlpeOGf0f/falconpl-0.9.1.8/core/clt/falcon/version.h /tmp/Y4mp0W3rzG/falconpl-0.9.2/core/clt/falcon/version.h --- falconpl-0.9.1.8/core/clt/falcon/version.h 2009-04-11 21:51:13.000000000 +0100 +++ falconpl-0.9.2/core/clt/falcon/version.h 2009-06-20 14:21:46.000000000 +0100 @@ -19,7 +19,7 @@ #define FCLT_VERSION_MAJOR 0 #define FCLT_VERSION_MINOR 9 -#define FCLT_VERSION_REVISION 1 +#define FCLT_VERSION_REVISION 2 #endif diff -Nru /tmp/qLlpeOGf0f/falconpl-0.9.1.8/core/clt/faldisass/version.h /tmp/Y4mp0W3rzG/falconpl-0.9.2/core/clt/faldisass/version.h --- falconpl-0.9.1.8/core/clt/faldisass/version.h 2009-04-11 21:51:13.000000000 +0100 +++ falconpl-0.9.2/core/clt/faldisass/version.h 2009-06-20 14:21:46.000000000 +0100 @@ -19,7 +19,7 @@ #define FDIS_VERSION_MAJOR 0 #define FDIS_VERSION_MINOR 9 -#define FDIS_VERSION_REVISION 1 +#define FDIS_VERSION_REVISION 2 #endif diff -Nru /tmp/qLlpeOGf0f/falconpl-0.9.1.8/core/clt/falrun/version.h /tmp/Y4mp0W3rzG/falconpl-0.9.2/core/clt/falrun/version.h --- falconpl-0.9.1.8/core/clt/falrun/version.h 2009-04-11 21:51:13.000000000 +0100 +++ falconpl-0.9.2/core/clt/falrun/version.h 2009-06-20 14:21:46.000000000 +0100 @@ -19,7 +19,7 @@ #define FRUN_VERSION_MAJOR 0 #define FRUN_VERSION_MINOR 9 -#define FRUN_VERSION_REVISION 1 +#define FRUN_VERSION_REVISION 2 #endif diff -Nru /tmp/qLlpeOGf0f/falconpl-0.9.1.8/core/clt/faltest/version.h /tmp/Y4mp0W3rzG/falconpl-0.9.2/core/clt/faltest/version.h --- falconpl-0.9.1.8/core/clt/faltest/version.h 2009-04-11 21:51:13.000000000 +0100 +++ falconpl-0.9.2/core/clt/faltest/version.h 2009-06-20 14:21:46.000000000 +0100 @@ -19,7 +19,7 @@ #define VERSION_MAJOR 0 #define VERSION_MINOR 9 -#define VERSION_REVISION 1 +#define VERSION_REVISION 2 #endif diff -Nru /tmp/qLlpeOGf0f/falconpl-0.9.1.8/core/CMakeLists.txt /tmp/Y4mp0W3rzG/falconpl-0.9.2/core/CMakeLists.txt --- falconpl-0.9.1.8/core/CMakeLists.txt 2009-05-08 23:14:25.000000000 +0100 +++ falconpl-0.9.2/core/CMakeLists.txt 2009-06-20 19:11:37.000000000 +0100 @@ -69,9 +69,6 @@ MESSAGE( "Compiling Falcon on ${CMAKE_SYSTEM}" ) - -MESSAGE( "Compiling Falcon on ${CMAKE_SYSTEM}" ) - ############################################################################## # Including specific build informations # This is a user-configurable script containing vars @@ -141,6 +138,19 @@ set( CMAKE_MODULE_LINKER_FLAGS -mthreads ) ENDIF ( "${CMAKE_GENERATOR}" STREQUAL "MinGW Makefiles" ) ELSE(WIN32) + + #prepare RPATH to the final destination/lib dir + SET(CMAKE_SKIP_BUILD_RPATH TRUE) + SET(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE) + SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) + + IF ("${FALCON_RPATH}" STREQUAL "") + SET(CMAKE_INSTALL_RPATH "${FALCON_FINAL_DESTINATION}/${FALCON_FINAL_DESTINATION_LIB}") + ELSE ("${FALCON_RPATH}" STREQUAL "") + SET(CMAKE_INSTALL_RPATH "${FALCON_RPATH}") + ENDIF("${FALCON_RPATH}" STREQUAL "") + + # Set common UNIX warnings. IF("${CMAKE_SYSTEM_NAME}" STREQUAL "SunOS") ELSE("${CMAKE_SYSTEM_NAME}" STREQUAL "SunOS") diff -Nru /tmp/qLlpeOGf0f/falconpl-0.9.1.8/core/devtools/falconeer.fal.in /tmp/Y4mp0W3rzG/falconpl-0.9.2/core/devtools/falconeer.fal.in --- falconpl-0.9.1.8/core/devtools/falconeer.fal.in 2008-09-05 19:46:51.000000000 +0100 +++ falconpl-0.9.2/core/devtools/falconeer.fal.in 2009-06-19 12:01:44.000000000 +0100 @@ -1,260 +1,260 @@ -#!/usr/bin/env falcon -/* - FALCON - The Falcon Programming Language. - FILE: falconeer.fal - - Script that configures module skeleton. - ------------------------------------------------------------------- - - Copyright 2008 Giancarlo Niccolai - - Licensed under the Falcon Programming Language License, - Version 1.1 (the "License") or GPLv2.0 or following, - at your choice; you may not use this file except in - compliance with on of the Licenses. You may obtain - a copy of the Licenses at - - http://www.falconpl.org/?page_id=license_1_1 - http://www.gnu.org/licenses/old-licenses/gpl-2.0.html - - 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. -*/ - -load regex - -//========================================== -// Global definitions -// - -// name used for skeleton files -const skelname = "fmodskel" - -// using falcon string concatenation to prevent cmake -// to mangle with this values. -const var_prjname = "@" "PROJECT_NAME@" -const var_desc = "@" "DESCRIPTION@" -const var_author = "@" "AUTHOR@" -const var_date = "@" "DATE@" -const var_year = "@" "YEAR@" -const var_copy = "@" "COPYRIGHT@" -const var_license = "@" "LICENSE@" -const var_mainprj = "@" "MAIN_PRJ@" - -const default_license = \ - " Licensed under the Falcon Programming Language License,\n" - " Version 1.1 (the \"License\"); you may not use this file\n" - " except in compliance with the License. You may obtain\n" - " a copy of the License at\n" - "\n" - " http://www.falconpl.org/?page_id=license_1_1\n" - "\n" - " Unless required by applicable law or agreed to in writing,\n" - " software distributed under the License is distributed on\n" - " an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n" - " KIND, either express or implied. See the License for the\n" - " specific language governing permissions and limitations\n" - " under the License.\n" - -const default_prj = "FALCON - The Falcon Programming Language." - -files = [\ - "src/" + skelname + ".cpp", - "src/" + skelname + "_ext.cpp", - "src/" + skelname + "_ext.h", - "src/" + skelname + "_st.cpp", - "src/" + skelname + "_st.h", - "src/" + skelname + "_mod.cpp", - "src/" + skelname + "_mod.h", - "src/" + skelname + "_srv.cpp", - "src/" + skelname + "_srv.h", - "src/" + skelname + "_CMakeLists.txt:src/CMakeLists.txt", - "templates/"+ skelname + "_cpp_template", - "templates/" + skelname + "_h_template", - "docs/" + skelname + "_faldoc.fd:docs/faldoc.fd", - skelname + "_CMakeLists.txt:CMakeLists.txt", - skelname + "_build.sh:build.sh", - skelname + "_falmod.cmake:falmod.cmake", - skelname + ".sln", - skelname + ".vcproj", - skelname + "_Makefile.gnu", - skelname + "_Makefile.mac" -] - -chgRegex = Regex( skelname ) - -variables = [=>] - -//========================================== -// Configuration options parser -// - -object MyParser from CmdlineParser - prj_name = nil - author = "Unknown author" - description = "" - date = CurrentTime() - copyright = "The above AUTHOR" - licplate = default_license - mainprj = default_prj - - function onOption( option ) - switch option - case "?", "help": self.usage() - case "a", "author", "n", "name", "d", "description", \ - "l", "license", "c", "copyright", "p", "project" - self.expectValue() - default - self.unrecognized( option ) - end - end - - function onValue( option, value ) - switch option - case "a", "author": self.author = value - case "n", "name": self.prj_name = value - case "d", "description": self.description = value - case "l", "license": self.loadLicense( value ) - case "c", "copyright": self.copyright = value - case "p", "project": self.mainprj = value - end - end - - function onFree( param ) - self.unrecognized( param ) - end - - function loadLicense( param ) - try - inf = InputStream( param ) - self.licplate="" - while ( data = inf.read(2048) ) - self.licplate +=data - end - inf.close() - catch IoError in e - > "falconeer.fal: FATAL: cannot load license plate file ", param - > e - exit(1) - end - end - - function unrecognized( option ) - printl( "Unrecognized option \"", option, "\"\n\n" ); - self.usage() - exit(1) - end - - function usage() - > "Falconeer -- the skeleton module configurator.\n" - " Enter a directory where the Falcon Skeleton Module has been unpacked\n" - " and load this script setting the '-n' option.\n" - " Relevant the files in the skeleton directory will be renamed accordingly\n" - " to your settings, and configurable placeholder variables in each file\n" - " will be overwritten.\n" - - > " Options:\n" - " -?,--help \tPrints this help\n" - " -n/--name \tName of the project (will affect filenames)\n" - " -a/--author \tAuthor(s) of the project\n" - " -c/--copyright \tCopyright owner\n" - " -d/--description \tDescription for the project\n" - " -l/--license \tPointer to a license plate\n" - " -p/--project \tMain project to which this module belongs\n\n" - " -n option is mandatory.\n" - end -end - -//========================================== -// Function that does the job -// -function parse_file( fileName, destName ) - global variables - - fin = InputStream( fileName ) - // convert the name - if not destName - foutName = fileName - chgRegex.replace( foutName, MyParser.prj_name ) - else - foutName = destName - end - if foutName == fileName: foutName += "_new" - - try - // open the output file name - fout = OutputStream( foutName ) - line = "" - - // read the line - loop - fin.readLine( line, 512 ) - if fin.eof(): break - - // scan and substitute the variables - for key, value in variables - pos = strFind( line, key ) - // can be more than one per line - while pos >= 0 - line[pos : pos + key.len()] = value - pos = strFind( line, key ) - end - end - // now we can write the line - fout.write( line + "\n" ) - end - - fin.close() - fout.close() - catch in error - > @"Error while performing change $fileName -> $foutName" - > error - return - end - - // remove the old file - // TODO: set an option to prevent this - try - fileRemove( fileName ) - catch in error - > @"Error removing $fileName" - > error - end -end - -//========================================== -// Main program -// - -MyParser.parse() -if not MyParser.prj_name - MyParser.usage() - exit( 1 ) -end - -// create the variables -variables[var_prjname] = MyParser.prj_name -variables[var_desc ] = MyParser.description -variables[var_author ] = MyParser.author -variables[var_date ] = MyParser.date.toRFC2822() -variables[var_year ] = MyParser.date.year.toString() -variables[var_copy ] = MyParser.copyright -variables[var_license] = MyParser.licplate -variables[var_mainprj] = MyParser.mainprj - -for file in files - if ":" in file - file, dest = strSplit( file, ":", 2 ) - else - dest = nil - end - - > "Examining ", file, "..." - parse_file( file, dest ) -end - -/* End of falconeer.fal */ +#!/usr/bin/env falcon +/* + FALCON - The Falcon Programming Language. + FILE: falconeer.fal + + Script that configures module skeleton. + ------------------------------------------------------------------- + + Copyright 2008 Giancarlo Niccolai + + Licensed under the Falcon Programming Language License, + Version 1.1 (the "License") or GPLv2.0 or following, + at your choice; you may not use this file except in + compliance with on of the Licenses. You may obtain + a copy of the Licenses at + + http://www.falconpl.org/?page_id=license_1_1 + http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + + 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. +*/ + +load regex + +//========================================== +// Global definitions +// + +// name used for skeleton files +const skelname = "fmodskel" + +// using falcon string concatenation to prevent cmake +// to mangle with this values. +const var_prjname = "@" "PROJECT_NAME@" +const var_desc = "@" "DESCRIPTION@" +const var_author = "@" "AUTHOR@" +const var_date = "@" "DATE@" +const var_year = "@" "YEAR@" +const var_copy = "@" "COPYRIGHT@" +const var_license = "@" "LICENSE@" +const var_mainprj = "@" "MAIN_PRJ@" + +const default_license = \ + " Licensed under the Falcon Programming Language License,\n" + " Version 1.1 (the \"License\"); you may not use this file\n" + " except in compliance with the License. You may obtain\n" + " a copy of the License at\n" + "\n" + " http://www.falconpl.org/?page_id=license_1_1\n" + "\n" + " Unless required by applicable law or agreed to in writing,\n" + " software distributed under the License is distributed on\n" + " an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n" + " KIND, either express or implied. See the License for the\n" + " specific language governing permissions and limitations\n" + " under the License.\n" + +const default_prj = "FALCON - The Falcon Programming Language." + +files = [\ + "src/" + skelname + ".cpp", + "src/" + skelname + "_ext.cpp", + "src/" + skelname + "_ext.h", + "src/" + skelname + "_st.cpp", + "src/" + skelname + "_st.h", + "src/" + skelname + "_mod.cpp", + "src/" + skelname + "_mod.h", + "src/" + skelname + "_srv.cpp", + "src/" + skelname + "_srv.h", + "src/" + skelname + "_CMakeLists.txt:src/CMakeLists.txt", + "templates/"+ skelname + "_cpp_template", + "templates/" + skelname + "_h_template", + "docs/" + skelname + "_faldoc.fd:docs/faldoc.fd", + skelname + "_CMakeLists.txt:CMakeLists.txt", + skelname + "_build.sh:build.sh", + skelname + "_falmod.cmake:falmod.cmake", + skelname + ".sln", + skelname + ".vcproj", + skelname + "_Makefile.gnu", + skelname + "_Makefile.mac" +] + +chgRegex = Regex( skelname ) + +variables = [=>] + +//========================================== +// Configuration options parser +// + +object MyParser from CmdlineParser + prj_name = nil + author = "Unknown author" + description = "" + date = CurrentTime() + copyright = "The above AUTHOR" + licplate = default_license + mainprj = default_prj + + function onOption( option ) + switch option + case "?", "help": self.usage() + case "a", "author", "n", "name", "d", "description", \ + "l", "license", "c", "copyright", "p", "project" + self.expectValue() + default + self.unrecognized( option ) + end + end + + function onValue( option, value ) + switch option + case "a", "author": self.author = value + case "n", "name": self.prj_name = value + case "d", "description": self.description = value + case "l", "license": self.loadLicense( value ) + case "c", "copyright": self.copyright = value + case "p", "project": self.mainprj = value + end + end + + function onFree( param ) + self.unrecognized( param ) + end + + function loadLicense( param ) + try + inf = InputStream( param ) + self.licplate="" + while ( data = inf.read(2048) ) + self.licplate +=data + end + inf.close() + catch IoError in e + > "falconeer.fal: FATAL: cannot load license plate file ", param + > e + exit(1) + end + end + + function unrecognized( option ) + printl( "Unrecognized option \"", option, "\"\n\n" ); + self.usage() + exit(1) + end + + function usage() + > "Falconeer -- the skeleton module configurator.\n" + " Enter a directory where the Falcon Skeleton Module has been unpacked\n" + " and load this script setting the '-n' option.\n" + " Relevant the files in the skeleton directory will be renamed accordingly\n" + " to your settings, and configurable placeholder variables in each file\n" + " will be overwritten.\n" + + > " Options:\n" + " -?,--help \tPrints this help\n" + " -n/--name \tName of the project (will affect filenames)\n" + " -a/--author \tAuthor(s) of the project\n" + " -c/--copyright \tCopyright owner\n" + " -d/--description \tDescription for the project\n" + " -l/--license \tPointer to a license plate\n" + " -p/--project \tMain project to which this module belongs\n\n" + " -n option is mandatory.\n" + end +end + +//========================================== +// Function that does the job +// +function parse_file( fileName, destName ) + global variables + + fin = InputStream( fileName ) + // convert the name + if not destName + foutName = fileName + chgRegex.replace( foutName, MyParser.prj_name ) + else + foutName = destName + end + if foutName == fileName: foutName += "_new" + + try + // open the output file name + fout = OutputStream( foutName ) + line = "" + + // read the line + loop + fin.readLine( line, 512 ) + if fin.eof(): break + + // scan and substitute the variables + for key, value in variables + pos = strFind( line, key ) + // can be more than one per line + while pos >= 0 + line[pos : pos + key.len()] = value + pos = strFind( line, key ) + end + end + // now we can write the line + fout.write( line + "\n" ) + end + + fin.close() + fout.close() + catch in error + > @"Error while performing change $fileName -> $foutName" + > error + return + end + + // remove the old file + // TODO: set an option to prevent this + try + fileRemove( fileName ) + catch in error + > @"Error removing $fileName" + > error + end +end + +//========================================== +// Main program +// + +MyParser.parse() +if not MyParser.prj_name + MyParser.usage() + exit( 1 ) +end + +// create the variables +variables[var_prjname] = MyParser.prj_name +variables[var_desc ] = MyParser.description +variables[var_author ] = MyParser.author +variables[var_date ] = MyParser.date.toRFC2822() +variables[var_year ] = MyParser.date.year.toString() +variables[var_copy ] = MyParser.copyright +variables[var_license] = MyParser.licplate +variables[var_mainprj] = MyParser.mainprj + +for file in files + if ":" in file + file, dest = strSplit( file, ":", 2 ) + else + dest = nil + end + + > "Examining ", file, "..." + parse_file( file, dest ) +end + +/* End of falconeer.fal */ diff -Nru /tmp/qLlpeOGf0f/falconpl-0.9.1.8/core/docs/faldoc.fd /tmp/Y4mp0W3rzG/falconpl-0.9.2/core/docs/faldoc.fd --- falconpl-0.9.1.8/core/docs/faldoc.fd 2009-03-22 17:30:23.000000000 +0000 +++ falconpl-0.9.2/core/docs/faldoc.fd 2009-06-20 00:08:37.000000000 +0100 @@ -8,9 +8,9 @@ # Documentation generic data ################################################ -Title = Falcon - Base Function Reference. +Title = Falcon Core Module Author = The Falcon Committee -Version = 0.9.0 +Version = 0.9.2 ################################################ # Faldoc Input settings @@ -29,6 +29,7 @@ ################################################ Output.module=html +Output.module=list ################################################ # Faldoc HTML Output settings @@ -36,6 +37,16 @@ # Output.. configs ################################################ -Output.html.directory=Falcon-docs-core.0.9.0 +Output.html.directory=Falcon-docs-core.0.9.2 Output.html.url=. Output.html.doctitle=Falcon Function Reference + +################################################ +# Faldoc listing Output settings +################################################ + +Output.list.file=coreModule-0.9.2.lst +Output.list.doctitle=Falcon Core Module - Function List +Output.list.bytype=true +Output.list.members=true +Output.list.brief=true diff -Nru /tmp/qLlpeOGf0f/falconpl-0.9.1.8/core/docs/main.fd /tmp/Y4mp0W3rzG/falconpl-0.9.2/core/docs/main.fd --- falconpl-0.9.1.8/core/docs/main.fd 2008-12-22 13:41:29.000000000 +0000 +++ falconpl-0.9.2/core/docs/main.fd 2009-06-19 12:01:44.000000000 +0100 @@ -1,14 +1,14 @@ /*# @main The Falcon Core Function Reference -Falcon provides an ever growing set of modules which interacts with the host system. +Falcon provides an ever growing set of @b modules which interacts with the host system. Also, there are many function meant to operate on the standard types, or to interact with the Virtual Machine itself. -@section The core module +@section core_module The core module The core module interacts with the virtual machine, to the point that, at times, - the virtual machine itself refers to it. In example, while the exceptions can be of + the virtual machine itself refers to it. For example, while the exceptions can be of any types, the exceptions internally generated by the machine are instance of the Error class, which is part of the core module. @@ -54,7 +54,7 @@ - Suspension on sleep request - Synchronous periodic callback -@section Wait Interruption Protocol +@section wait_interrupt Wait Interruption Protocol Blocking operations performed by the Virtual Machine can be asynchronously interrupted from another thread of the application @@ -76,7 +76,7 @@ @a Stream.writeAvailable and a few others. Compliancy to interruption protocol is specified in the item descriptions. -@section Suspension on sleep request. +@section suspend_on_sleep Suspension on sleep request. Embedding applications may also require the VM to suspend its execution on sleep requests coming from the scripts or from extension modules. It is usefull to have @@ -87,7 +87,7 @@ and start a new execution or to destroy it. After a return in sleep request state, the VM is clear for inspection, modification, concurrent execution and termination. -@section Synchronous periodic callback. +@section periodic_callback Synchronous periodic callback. The VM provides a callback hook that will be periodically called. This hook can be used by embedding applications to check for program status change, and it may @@ -104,3 +104,13 @@ executed, and can be regulated and changed live. */ + +/*# + @group coroutine_support Support for coroutines + @brief All that's useful for coroutines. +*/ + +/*# + @group general_purpose General purpose + @brief Generic language and type oriented functions. +*/ diff -Nru /tmp/qLlpeOGf0f/falconpl-0.9.1.8/core/engine/citerator.cpp /tmp/Y4mp0W3rzG/falconpl-0.9.2/core/engine/citerator.cpp --- falconpl-0.9.1.8/core/engine/citerator.cpp 2009-03-27 09:55:03.000000000 +0000 +++ falconpl-0.9.2/core/engine/citerator.cpp 2009-06-19 12:01:44.000000000 +0100 @@ -57,6 +57,7 @@ void CoreIterator::gcMark( uint32 mark ) { + // AARRG if ( m_creator != 0 ) m_creator->mark( mark ); diff -Nru /tmp/qLlpeOGf0f/falconpl-0.9.1.8/core/engine/CMakeLists.txt /tmp/Y4mp0W3rzG/falconpl-0.9.2/core/engine/CMakeLists.txt --- falconpl-0.9.1.8/core/engine/CMakeLists.txt 2009-04-17 17:24:42.000000000 +0100 +++ falconpl-0.9.2/core/engine/CMakeLists.txt 2009-06-20 15:07:24.000000000 +0100 @@ -55,8 +55,7 @@ IF(NOT BISON_EXECUTABLE) FIND_PROGRAM(BISON_EXECUTABLE bison) IF (NOT BISON_EXECUTABLE) - MESSAGE("WARNING: BISON not found - won't perform grammar -recompilation") + MESSAGE("WARNING: BISON not found - won't perform grammar recompilation") ENDIF (NOT BISON_EXECUTABLE) ENDIF(NOT BISON_EXECUTABLE) diff -Nru /tmp/qLlpeOGf0f/falconpl-0.9.1.8/core/engine/compiler.cpp /tmp/Y4mp0W3rzG/falconpl-0.9.2/core/engine/compiler.cpp --- falconpl-0.9.1.8/core/engine/compiler.cpp 2009-05-18 15:08:40.000000000 +0100 +++ falconpl-0.9.2/core/engine/compiler.cpp 2009-06-19 12:01:44.000000000 +0100 @@ -317,7 +317,7 @@ SyntaxError *error = new SyntaxError( ErrorParam(code, line) .origin( e_orig_compiler ) ); error->extraDescription( errorp ); - error->module( m_module->path() ); + error->module( String(m_module->path()).bufferize() ); raiseError( error ); } diff -Nru /tmp/qLlpeOGf0f/falconpl-0.9.1.8/core/engine/core_module/array_ext.cpp /tmp/Y4mp0W3rzG/falconpl-0.9.2/core/engine/core_module/array_ext.cpp --- falconpl-0.9.1.8/core/engine/core_module/array_ext.cpp 2009-03-24 23:52:11.000000000 +0000 +++ falconpl-0.9.2/core/engine/core_module/array_ext.cpp 2009-06-20 00:08:37.000000000 +0100 @@ -32,13 +32,6 @@ namespace core { /*# - @class Array - @brief MetaClass for Falcon arrays. - - This is the class reflecting the base array classes. -*/ - -/*# @method front Array @brief Returns and eventually extracts the first element in the array. @optparam remove true to remove the front item. @@ -242,7 +235,6 @@ @param array The array where the item should be placed. @param itempos The position where the item should be placed. @param item The item to be inserted. - The item is inserted before the given position. If pos is 0, the item is inserted in the very first position, while if it's equal to the array length, it is appended at the array tail. diff -Nru /tmp/qLlpeOGf0f/falconpl-0.9.1.8/core/engine/core_module/cmdlineparser.cpp /tmp/Y4mp0W3rzG/falconpl-0.9.2/core/engine/core_module/cmdlineparser.cpp --- falconpl-0.9.1.8/core/engine/core_module/cmdlineparser.cpp 2009-03-15 15:02:51.000000000 +0000 +++ falconpl-0.9.2/core/engine/core_module/cmdlineparser.cpp 2009-06-19 12:01:44.000000000 +0100 @@ -27,10 +27,6 @@ #include /*# - -*/ - -/*# @class CmdlineParser @brief Provides simple and powerful parsing of the command line options. @@ -39,7 +35,7 @@ bit more specific than just "operate". Some embedding applications may provide the scripts with a command line too; - in example, a "scanner" script in a FPS game may be provided with the objects + for example, a "scanner" script in a FPS game may be provided with the objects to search for in a "command line", that may be actually the string that represents its configuration in the user interface. @@ -54,21 +50,21 @@ The command line parser knows the following option categories: - @b short @b options: options consisting of a single character, case sensitive, - following a single "-". In example, "-a", "-B", "-x". Short options may be - chained in sequences of characters as, in example "-aBx" which is + following a single "-". For example, "-a", "-B", "-x". Short options may be + chained in sequences of characters as, for example "-aBx" which is equivalent to "-a -B -x". Short options may have also the special "switch off" semantic; if they are followed by a "-" sign, the parser - interprets it as a will to turn off some feature; in example, the + interprets it as a will to turn off some feature; for example, the sequence "-B-" means that the "B" option should be turned off. The semantic can be expressed also in chained options as "-aB-x". - @b long @b options: they consists of two minus followed by a word of any - length, as in example "--parameter", "--config", "--elements". + length, as for example "--parameter", "--config", "--elements". Long options are usually (but not necessarily) meant to receive a parameter, - in example "--debug off". + for example "--debug off". - @b free @b options: they are strings not leaded by any "-" sign. Usually the semantic - of a command gives free options a special meaning; in example the "cp" unix command + of a command gives free options a special meaning; for example the "cp" unix command accept an arbitrary amount of free options, where the first N-1 options are the name of the files to copy, and the Nth option is the copy destination. A single "-" not followed by any letter is considered a free option @@ -82,7 +78,7 @@ Short and long options may be parametric. The word (or string) following parametric option is considered the parameter of that option, and is not subject to parsing. - In example, if "--terminator" is a parametric option, it is possible to write + For example, if "--terminator" is a parametric option, it is possible to write "./myprg.fal --terminator -opt". The parameter "-opt" will be passed as-is to the script as "terminator" option parameter. In case of short option chaining, if more than one chained option is parametric, the parameter following the chained @@ -94,7 +90,7 @@ in the CmdlineParser class. The parser will call the methods of the subclasses as it finds options in the argument vector; the callbacks will configure the application, report errors and mis-usage, terminate the program on fatal errors and communicate - with the parser through member functions. In example, it is not necessary to declare + with the parser through member functions. For example, it is not necessary to declare in advance which are the parametric options; it's done on a per-option basis by calling the expectParam() method and returning to the parser. @@ -208,7 +204,7 @@ Start the parsing process. If args parameter is not provided, the method gets the content of the @a args global vector defined in the Core module. - Returns true if the parsing was complete, and false on error (in example, + Returns true if the parsing was complete, and false on error (for example, if some element in the array wasn't a string). */ FALCON_FUNC CmdlineParser_parse( ::Falcon::VMachine *vm ) diff -Nru /tmp/qLlpeOGf0f/falconpl-0.9.1.8/core/engine/core_module/core_module.cpp /tmp/Y4mp0W3rzG/falconpl-0.9.2/core/engine/core_module/core_module.cpp --- falconpl-0.9.1.8/core/engine/core_module/core_module.cpp 2009-05-18 15:08:40.000000000 +0100 +++ falconpl-0.9.2/core/engine/core_module/core_module.cpp 2009-06-19 21:12:31.000000000 +0100 @@ -94,7 +94,7 @@ The methods can be applied both to symbols containing some data of a certain types, or directly to the constants specifying them. - In example, to obtain the length of the "Hello world" string, it is + For example, to obtain the length of the "Hello world" string, it is possible to do either: @code @@ -122,6 +122,11 @@ item metaclasses derived from BOM, as i.e. the @a Dictionary metaclass, can be applied only to items of the reflected type. + @note The method @a BOM.compare is meant to overload the behavior + of generic VM comparisons, including relational operators + (<, >, <=, >=, ==, !=) and generic ordering criterions, for example in + @a Dictionary insertions and @a arraySort. + @prop add__ Overrides + @prop sub__ Overrides - @prop mul__ Overrides * @@ -133,7 +138,6 @@ @prop dec__ Overrides -- (prefix) @prop incpost__ Overrides postfix ++ @prop decpost__ Overrides posrfix -- - @prop compare Overrides <, >, <=, >=, == and != (return 1, 0, -1 or nil) @prop call__ Overrides () call operator. @prop setIndex__ Overrides accessor [] in write mode. Will receive 2 parameters (index, set value) @prop getIndex__ Overrides accessor [] in read mode. Will receive 1 parameter (index) @@ -196,6 +200,22 @@ num_meta->exported( false ); num_meta->getClassDef()->setMetaclassFor( FLC_ITEM_NUM ); + /*# + @class Range + @from BOM + @ingroup bom_classes + @brief Metaclass for Falcon range type. + + This class holds the methods that can be applied to Falcon range items. + Ranges are created through the @b [:] operator, like this: + @code + r1 = [1:10] // 1 to 10 + r2 = [-1:0] // reverse sequence + r3 = [0:10:2] // stepping range + + > "Hello world"[r2] // reverses the string + @endcode + */ Falcon::Symbol *range_meta = self->addClass( "Range" ); range_meta->getClassDef()->addInheritance( new Falcon::InheritDef( bom_meta ) ); range_meta->exported( false ); @@ -212,7 +232,7 @@ @class Function @from BOM @ingroup bom_classes - @brief Generic number type basic object model metaclass. + @brief Metaclass for Falcon function type. */ Falcon::Symbol *func_meta = self->addClass( "Function" ); func_meta->getClassDef()->addInheritance( new Falcon::InheritDef( bom_meta ) ); @@ -222,6 +242,15 @@ self->addClassMethod( func_meta, "caller", &Falcon::core::Function_caller ).asSymbol()-> addParam("level"); //static + /*# + @class GarbagePointer + @from BOM + @ingroup bom_classes + @brief Metaclass for internal and application-wide garbage sensible data. + + GarbagePointer is a class used to reflect opaque data which can be automatically + destroyed by the Falcon Garbage Collector when it goes out of scope. + */ Falcon::Symbol *gcptr_meta = self->addClass( "GarbagePointer" ); gcptr_meta->getClassDef()->addInheritance( new Falcon::InheritDef( bom_meta ) ); gcptr_meta->exported( false ); @@ -246,7 +275,9 @@ @class String @from BOM @ingroup bom_classes - @brief Generic number type basic object model metaclass. + @brief Metaclass for string items. + + This is the set of methods that can be applied to string items. */ Falcon::Symbol *string_meta = self->addClass( "String" ); @@ -274,7 +305,7 @@ self->addClassMethod( string_meta, "merge", &Falcon::core::mth_strMerge ).asSymbol() ->addParam("array")->addParam("mergeStr")->addParam("count"); self->addClassMethod( string_meta, "join", &Falcon::core::String_join ); - self->addClassMethod( string_meta, "strFind", &Falcon::core::mth_strFind ).asSymbol() + self->addClassMethod( string_meta, "find", &Falcon::core::mth_strFind ).asSymbol() ->addParam("needle")->addParam("start")->addParam("end"); self->addClassMethod( string_meta, "strBackFind", &Falcon::core::mth_strBackFind ).asSymbol() ->addParam("needle")->addParam("start")->addParam("end"); @@ -293,6 +324,10 @@ self->addClassMethod( string_meta, "ptr", &Falcon::core::String_ptr ); self->addClassMethod( string_meta, "charSize", &Falcon::core::String_charSize ).asSymbol() ->addParam("bpc"); + self->addClassMethod( string_meta, "startsWith", &Falcon::core::mth_strStartsWith ).asSymbol() + ->addParam("token")->addParam("icase"); + self->addClassMethod( string_meta, "endsWith", &Falcon::core::mth_strEndsWith ).asSymbol() + ->addParam("token")->addParam("icase"); //================================================================== // Array class @@ -306,7 +341,9 @@ @class Array @from BOM @ingroup bom_classes - @brief Array type basic object model metaclass. + @brief MetaClass for Falcon arrays. + + This is the class reflecting the base array classes. */ self->addClassMethod( array_meta, "front", &Falcon::core::Array_front ).asSymbol()-> addParam("remove"); @@ -365,7 +402,9 @@ @class Dictionary @from BOM @ingroup bom_classes - @brief Dictionary type basic object model metaclass. + @brief Metaclass for Falcon dictionary types. + + This class holds the methods that can be applied to Falcon dictionary items. */ self->addClassMethod( dict_meta, "front", &Falcon::core::mth_dictFront ).asSymbol()-> addParam("remove")->addParam("key"); @@ -419,12 +458,7 @@ //================================================================== // MemoryBuffer class // - /*# - @class MemoryBuffer - @from BOM - @ingroup bom_classes - @brief Memory buffer type basic object model metaclass. - */ + /* Docs for this class are in membuf_ext.cpp */ Falcon::Symbol *membuf_meta = self->addClass( "MemoryBuffer" ); membuf_meta->getClassDef()->addInheritance( new Falcon::InheritDef( bom_meta ) ); membuf_meta->exported( false ); @@ -450,6 +484,7 @@ self->addClassMethod( membuf_meta, "remaining", &Falcon::core::MemoryBuffer_remaining ); self->addClassMethod( membuf_meta, "fill", &Falcon::core::MemoryBuffer_fill ).asSymbol()-> addParam("value"); + self->addClassMethod( membuf_meta, "wordSize", &Falcon::core::MemoryBuffer_wordSize ); self->addClassMethod( membuf_meta, "ptr", &Falcon::core::MemoryBuffer_ptr ); @@ -486,7 +521,7 @@ //======================================================================= /*# - @entity args + @global args @brief Script arguments @ingroup general_purpose @@ -498,7 +533,7 @@ self->addGlobal( "args", true ); /*# - @entity scriptName + @global scriptName @brief Logical module name of current module @ingroup general_purpose @@ -508,7 +543,7 @@ self->addGlobal( "scriptName", true ); /*# - @entity scriptPath + @global scriptPath @brief Complete path used to load the script @ingroup general_purpose @@ -694,12 +729,12 @@ ->addParam( "code" )->addParam( "description")->addParam( "extra" ); interr_cls->getClassDef()->addInheritance( new Falcon::InheritDef( error_class ) ); interr_cls->setWKS( true ); - + Falcon::Symbol *msgerr_cls = self->addClass( "MessageError", &Falcon::core::MessageError_init ) ->addParam( "code" )->addParam( "description")->addParam( "extra" ); msgerr_cls->getClassDef()->addInheritance( new Falcon::InheritDef( error_class ) ); msgerr_cls->setWKS( true ); - + //========================================= // Creating the semaphore class -- will be a FalconObject @@ -714,7 +749,7 @@ // GC support Symbol *gcsing = self->addSingleton( "GC", Falcon::core::GC_init ); Symbol *gc_cls = gcsing->getInstance(); - gc_cls->getClassDef()->factory(Falcon::ReflectOpaqueFactory); + gc_cls->getClassDef()->factory(&Falcon::ReflectOpaqueFactory); self->addClassProperty( gc_cls, "usedMem" ). setReflectFunc( &Falcon::core::GC_usedMem_rfrom ); self->addClassProperty( gc_cls, "aliveMem" ). @@ -819,6 +854,8 @@ addParam("item"); self->addExtFunc( "cascade", &Falcon::core::core_cascade )->setEta( true )-> addParam("callList"); + self->addExtFunc( "brigade", &Falcon::core::core_brigade )->setEta( true )-> + addParam("fl"); self->addExtFunc( "dolist", &Falcon::core::core_dolist )->setEta( true )-> addParam("processor")->addParam("sequence"); self->addExtFunc( "floop", &Falcon::core::core_floop )->setEta( true )-> @@ -931,6 +968,10 @@ //======================================================================= self->addExtFunc( "strFill", &Falcon::core::mth_strFill ) ->addParam( "string" )->addParam( "chr" ); + self->addExtFunc( "strStartsWith", &Falcon::core::mth_strStartsWith ) + ->addParam( "string" )->addParam( "chr" )->addParam( "icase" ); + self->addExtFunc( "strEndsWith", &Falcon::core::mth_strEndsWith ) + ->addParam( "string" )->addParam( "token" )->addParam( "icase" ); self->addExtFunc( "strSplit", &Falcon::core::mth_strSplit ) ->addParam( "string" )->addParam( "token" )->addParam( "count" ); self->addExtFunc( "strSplitTrimmed", &Falcon::core::mth_strSplitTrimmed )-> @@ -1317,15 +1358,13 @@ //======================================================================= // Directory class //======================================================================= - - // factory function - self->addExtFunc( "DirectoryOpen", &Falcon::core::DirectoryOpen )-> - addParam("dirname"); - - Falcon::Symbol *dir_class = self->addClass( "Directory" ); + Falcon::Symbol *dir_class = self->addClass( "Directory", &Falcon::core::Directory_init ) + ->addParam("path"); dir_class->setWKS(true); //dir_class->getClassDef()->setObjectManager( &core_falcon_data_manager ); self->addClassMethod( dir_class, "read", &Falcon::core::Directory_read ); + self->addClassMethod( dir_class, "descend", &Falcon::core::Directory_descend ).asSymbol()-> + addParam("dfunc")->addParam("ffunc"); self->addClassMethod( dir_class, "close", &Falcon::core::Directory_close ); self->addClassMethod( dir_class, "error", &Falcon::core::Directory_error ); diff -Nru /tmp/qLlpeOGf0f/falconpl-0.9.1.8/core/engine/core_module/core_module.h /tmp/Y4mp0W3rzG/falconpl-0.9.2/core/engine/core_module/core_module.h --- falconpl-0.9.1.8/core/engine/core_module/core_module.h 2009-05-18 15:08:40.000000000 +0100 +++ falconpl-0.9.2/core/engine/core_module/core_module.h 2009-06-19 12:01:44.000000000 +0100 @@ -157,6 +157,7 @@ FALCON_FUNC MemoryBuffer_fill( ::Falcon::VMachine *vm ); FALCON_FUNC MemoryBuffer_compact( ::Falcon::VMachine *vm ); FALCON_FUNC MemoryBuffer_remaining( ::Falcon::VMachine *vm ); +FALCON_FUNC MemoryBuffer_wordSize( ::Falcon::VMachine *vm ); FALCON_FUNC MemoryBuffer_ptr( VMachine *vm ); FALCON_FUNC Method_source( ::Falcon::VMachine *vm ); @@ -185,6 +186,7 @@ FALCON_FUNC core_floop ( ::Falcon::VMachine *vm ); FALCON_FUNC core_firstof ( ::Falcon::VMachine *vm ); FALCON_FUNC core_let ( ::Falcon::VMachine *vm ); +FALCON_FUNC core_brigade ( ::Falcon::VMachine *vm ); FALCON_FUNC core_oob( ::Falcon::VMachine *vm ); FALCON_FUNC core_deoob( ::Falcon::VMachine *vm ); @@ -284,7 +286,8 @@ FALCON_FUNC mth_strFront ( ::Falcon::VMachine *vm ); FALCON_FUNC mth_strBack ( ::Falcon::VMachine *vm ); - +FALCON_FUNC mth_strStartsWith ( ::Falcon::VMachine *vm ); +FALCON_FUNC mth_strEndsWith ( ::Falcon::VMachine *vm ); FALCON_FUNC mth_strFill ( ::Falcon::VMachine *vm ); FALCON_FUNC mth_strSplit ( ::Falcon::VMachine *vm ); FALCON_FUNC mth_strSplitTrimmed ( ::Falcon::VMachine *vm ); @@ -354,8 +357,9 @@ FALCON_FUNC fileType( ::Falcon::VMachine *vm ); FALCON_FUNC fileNameSplit ( ::Falcon::VMachine *vm ); FALCON_FUNC fileNameMerge ( ::Falcon::VMachine *vm ); -FALCON_FUNC DirectoryOpen ( ::Falcon::VMachine *vm ); +FALCON_FUNC Directory_init ( ::Falcon::VMachine *vm ); FALCON_FUNC Directory_read ( ::Falcon::VMachine *vm ); +FALCON_FUNC Directory_descend ( ::Falcon::VMachine *vm ); FALCON_FUNC Directory_close ( ::Falcon::VMachine *vm ); FALCON_FUNC Directory_error ( ::Falcon::VMachine *vm ); FALCON_FUNC dirChange ( ::Falcon::VMachine *vm ); diff -Nru /tmp/qLlpeOGf0f/falconpl-0.9.1.8/core/engine/core_module/dict_ext.cpp /tmp/Y4mp0W3rzG/falconpl-0.9.2/core/engine/core_module/dict_ext.cpp --- falconpl-0.9.1.8/core/engine/core_module/dict_ext.cpp 2009-05-08 10:33:36.000000000 +0100 +++ falconpl-0.9.2/core/engine/core_module/dict_ext.cpp 2009-06-19 12:01:44.000000000 +0100 @@ -57,14 +57,6 @@ ****************************************/ /*# - @class Dictionary - @from BOM - @brief Metaclass for Falcon dictionary types. - - This class holds the methods that can be applied to Falcon dictionary items. -*/ - -/*# @method front Dictionary @brief Returns the first item in the dictionary. @optparam remove If true, remove the dictionary entry too. @@ -162,7 +154,7 @@ } /*# - @method first Dictionary + @method last Dictionary @brief Returns an iterator to the head of this dictionary. @return An iterator. */ @@ -525,7 +517,7 @@ returned if the value associated with a given key is exactly nil. In case the key cannot be found, the returned value will be marked as OOB. - @notice This method bypassess getIndex__ override in blessed (POOP) dictionaries. + @note This method bypassess getIndex__ override in blessed (POOP) dictionaries. @see oob */ @@ -569,7 +561,7 @@ @param value The key to be set. @return True if the value was overwritten, false if it has been inserted anew. - @notice This method bypassess setIndex__ override in blessed (POOP) dictionaries. + @note This method bypassess setIndex__ override in blessed (POOP) dictionaries. @see oob */ @@ -581,7 +573,7 @@ @param value The key to be set. @return True if the value was overwritten, false if it has been inserted anew. - @notice This method bypassess setIndex__ override in blessed (POOP) dictionaries. + @note This method bypassess setIndex__ override in blessed (POOP) dictionaries. @see oob */ diff -Nru /tmp/qLlpeOGf0f/falconpl-0.9.1.8/core/engine/core_module/dir_ext.cpp /tmp/Y4mp0W3rzG/falconpl-0.9.2/core/engine/core_module/dir_ext.cpp --- falconpl-0.9.1.8/core/engine/core_module/dir_ext.cpp 2009-04-08 10:35:50.000000000 +0100 +++ falconpl-0.9.2/core/engine/core_module/dir_ext.cpp 2009-06-19 12:01:44.000000000 +0100 @@ -34,10 +34,6 @@ #include /*# - -*/ - -/*# @begingroup core_syssupport */ @@ -258,7 +254,7 @@ } /*# - @method readStats FileStat + @method read FileStat @brief Fills the data in this instance reading them from a system file. @param filename Relative or absolute path to a file for which stats must be read @return True on success, false if the file cannot be queried. @@ -448,7 +444,7 @@ } -/* +/*# @function fileNameMerge @brief Merges a filename split up in four elements. @param spec The disk or server specification, an array containing all the @@ -528,7 +524,7 @@ vm->retval( new CoreString( p.get() ) ); } -/* +/*# @function fileName @brief Determines the name of a file in a complete path. @param path A string containing a path. @@ -567,7 +563,7 @@ } -/* +/*# @function filePath @brief Return the path specification part in a complete filename. @param fullpath A string containing a path. @@ -608,62 +604,55 @@ vm->retval( new CoreString ); } -/* - @function DirectoryOpen - @brief Opens a directory and returns a directory object. +/*# + @class Directory + @brief Special iterator to access directory listings. @param dirname A relative or absolute path to a directory - @return An instance of the @a Directory class. @raise IoError on failure. - If the function is successful, an instance of the Directory - class is returned. The instance can be used to retrieve the - directory entries one at a time. + The Directory class allow to iterate through the contents of a local file directory. + + The caller should repeatedly call the read() method until nil is returned. In + case an error is raised, the error() method may be called to get informations on + the cause that raised the error. - On failure, an IoError instance with code 1010 is raised. + After the read is complete, the caller should call close() to free the resources + associated with the object. The garbage collector will eventually take care of + it, but it is better to close the object as soon as possible. */ -FALCON_FUNC DirectoryOpen ( ::Falcon::VMachine *vm ) +/*# + @init Directory + @brief Opens a directory entry. + @raise IoError on failure. +*/ +FALCON_FUNC Directory_init ( ::Falcon::VMachine *vm ) { Item *name = vm->param(0); if ( name == 0 || ! name->isString() ) { - vm->raiseModError( new ParamError( ErrorParam( e_inv_params, __LINE__ ).origin( e_orig_runtime ) ) ); + throw new ParamError( ErrorParam( e_inv_params, __LINE__ ) + .origin( e_orig_runtime ) + .extra( "S" ) ); return; } int32 fsError; DirEntry *dir = Sys::fal_openDir( *name->asString(), fsError ); - if( dir != 0 ) { - Item *dir_class = vm->findWKI( "Directory" ); - //if we wrote the std module, can't be zero. - fassert( dir_class != 0 ); - CoreObject *self = dir_class->asClass()->createInstance(dir); - vm->retval( self ); + if( dir != 0 ) + { + CoreObject *self = vm->self().asObjectSafe(); + self->setUserData( dir ); } else { - vm->raiseModError( new IoError( ErrorParam( 1010, __LINE__ ). - origin( e_orig_runtime ).desc( "Can't open directory" ).extra( *name->asString() ). - sysError( (uint32) Sys::_lastError() ) ) ); + throw new IoError( ErrorParam( e_io_error, __LINE__ ) + .origin( e_orig_runtime ) + .extra( *name->asString() ) + .sysError( (uint32) Sys::_lastError() ) ); } } -/*# - @class Directory - @brief Special iterator to access directory listings. - - The Directory class is used by DirectoryOpen() function to return an - object that the user can iterate upon. It should not be created directly, - but only through @a DirectoryOpen . - - The caller should repeatedly call the read() method until nil is returned. In - case an error is raised, the error() method may be called to get informations on - the cause that raised the error. - - After the read is complete, the caller should call close() to free the resources - associated with the object. The garbage collector will eventually take care of - it, but it is better to close the object as soon as possible. -*/ /*# @method read Directory @@ -682,9 +671,9 @@ } else { if ( dir->lastError() != 0 ) { - vm->raiseModError( new IoError( ErrorParam( 1010, __LINE__ ). - origin( e_orig_runtime ).desc( "Can't read directory" ). - sysError( (uint32) Sys::_lastError() ) ) ); + throw new IoError( ErrorParam( e_io_error, __LINE__ ) + .origin( e_orig_runtime ) + .sysError( (uint32) Sys::_lastError() ) ); } vm->retnil(); } @@ -704,10 +693,156 @@ DirEntry *dir = dyncast(vm->self().asObject()->getFalconData()); dir->close(); if ( dir->lastError() != 0 ) { - vm->raiseModError( new IoError( ErrorParam( 1010, __LINE__ ). - origin( e_orig_runtime ).desc( "Can't close directory" ). - sysError( (uint32) Sys::_lastError() ) ) ); + throw new IoError( ErrorParam( e_io_error, __LINE__ ) + .origin( e_orig_runtime ) + .sysError( (uint32) Sys::_lastError() ) ); + } +} + + +static bool Directory_descend_next_descend ( ::Falcon::VMachine *vm ) +{ + if( vm->regA().isOob() && vm->regA().isInteger() ) + { + // in case of 0 or 1 we should break. + if ( vm->regA().asInteger() == 0 || vm->regA().asInteger() == 1 ) + return false; + } + + // we're in a directory. descend. + int32 fsError; + DirEntry *dir = Sys::fal_openDir( *vm->param(0)->asString(), fsError ); + vm->regB().setNil(); + + if( dir != 0 ) + { + Item* i_dir = vm->findWKI( "Directory" ); + fassert( i_dir != 0 && i_dir->isClass() ); + + // we don't want to be called anymore. + // when this frame returns, resume previous frame. + vm->returnHandler( 0 ); + + CoreClass* dircls = i_dir->asClass(); + CoreObject *self = dircls->createInstance( dir ); + vm->param(1)->asArray()->append( self ); + // and be sure that the VM will execute this last time + return false; + } + + throw new IoError( ErrorParam( e_io_error, __LINE__ ) + .origin( e_orig_runtime ) + .extra( *vm->param(0)->asString() ) + .sysError( (uint32) Sys::_lastError() ) ); +} + +static bool Directory_descend_next ( ::Falcon::VMachine *vm ) +{ + // get the real self + CoreArray* pushed = vm->local(0)->asArray(); + fassert( pushed->length() > 0 ); + Item& self = pushed->at( pushed->length() -1 ); + DirEntry *dir = dyncast(self.asObjectSafe()->getFalconData()); + + if( vm->regA().isOob() && vm->regA().isInteger() && vm->regA().asInteger() == 0 ) + { + // we're out of here. + return false; + } + + String fnext; + + // skip this and parent dir + while( fnext == "" || fnext == "." || fnext == ".." ) + { + if( ! dir->read( fnext ) ) + { + // pop this level. + dir->close(); + pushed->length( pushed->length()-1); + // please, repeat us if this was not the last level + return pushed->length() != 0; + } + } + + // is this a directory? + if ( dir->path().size() != 0 ) + fnext.prepend( dir->path() + "/" ); + + FileStat fs; + Sys::fal_stats( fnext, fs ); + if( fs.m_type == FileStat::t_dir ) + { + // yes? -- prepare the new callback frame + vm->pushParameter( (new CoreString( fnext ))->bufferize() ); + vm->pushParameter( pushed ); + vm->callFrame( *vm->param(0), 2 ); + + // prepare the descent + vm->returnHandler( &Directory_descend_next_descend ); + } + else { + // should we call the file handler? + Item* i_ffunc = vm->param(1); + if ( i_ffunc != 0 ) + { + vm->pushParameter( (new CoreString( fnext ))->bufferize() ); + vm->callFrame( *i_ffunc, 1 ); + // no need for extra params + } + } + + return true; +} + +/*# + @method descend Directory + @brief Descends into subdirectories, iteratively calling a function. + @param dfunc Function to be called upon directories. + @optparam ffunc Function to be called upon files. + + This function calls iteratively a function on directory entries. + If an entry is detected to be a directory, it is passed to + @b dfunc as the only parameter. If @b ffunc is also provided, + then it will receive all the non-directory entries. Entries + coresponding to the current directory and the parent directory + will never be sent to the handler functions. + + @note The parameters for @b dfunc and @b ffunc will always + be relative to the directory on which this object has been + created. + + Retunring an out of band 0, any of the callbacks involved may + stop the processing and return immediately. An out of band 1 + will skip the currently processed item and proceed. + The @b dfunc handler is called before descending into the found + subdirectory; this gives the handlers the chance to skip directories + or interrupt the search. + + @note After a complete descend, this directory will be closed and won't + be usable anymore. +*/ +FALCON_FUNC Directory_descend ( ::Falcon::VMachine *vm ) +{ + Item *i_dfunc = vm->param(0); + Item *i_ffunc = vm->param(1); + + if ( i_dfunc == 0 || ! i_dfunc->isCallable() + || ( i_ffunc != 0 && ! i_ffunc->isCallable() ) ) + { + throw new ParamError( ErrorParam( e_inv_params, __LINE__ ) + .origin( e_orig_runtime ) + .extra( "C,[C]" ) ); + return; } + + vm->addLocals(1); + *vm->local(0) = new CoreArray(1); + vm->local(0)->asArray()->append( vm->self() ); + + // be sure we won't loop out + vm->regA().setNil(); + vm->returnHandler( &Directory_descend_next ); } /*# @@ -737,7 +872,7 @@ It is possible to specify both a relative or absolute path; both the relative and absolute path can contain a subtree specification, that is, a set of directories separated by forward slashes, which - lead to the directory that should be created. In example: + lead to the directory that should be created. For example: @code dirMake( "top/middle/bottom" ) diff -Nru /tmp/qLlpeOGf0f/falconpl-0.9.1.8/core/engine/core_module/envvars.cpp /tmp/Y4mp0W3rzG/falconpl-0.9.2/core/engine/core_module/envvars.cpp --- falconpl-0.9.1.8/core/engine/core_module/envvars.cpp 2008-09-30 00:36:24.000000000 +0100 +++ falconpl-0.9.2/core/engine/core_module/envvars.cpp 2009-06-19 12:01:44.000000000 +0100 @@ -25,13 +25,6 @@ /*# -*/ - -/*# - @begingroup core_syssupport -*/ - -/*# @funset core_environ Environment support @brief Functions used to access the process environment variables. @@ -42,6 +35,7 @@ Variables set with "setenv()" will be available to child processes in case they are launched with the utilities in the Process module. + @begingroup core_syssupport @beginset core_environ */ diff -Nru /tmp/qLlpeOGf0f/falconpl-0.9.1.8/core/engine/core_module/error_ext.cpp /tmp/Y4mp0W3rzG/falconpl-0.9.2/core/engine/core_module/error_ext.cpp --- falconpl-0.9.1.8/core/engine/core_module/error_ext.cpp 2009-03-15 15:02:51.000000000 +0000 +++ falconpl-0.9.2/core/engine/core_module/error_ext.cpp 2009-06-19 12:01:44.000000000 +0100 @@ -472,7 +472,7 @@ does not respect this protocol, the item cannot be cloned. When this error is raised, it is usually because the script - tried to explicitly duplicate a "very special object" (in example, + tried to explicitly duplicate a "very special object" (for example, as an external resource handle created by a module). */ FALCON_FUNC CloneError_init ( ::Falcon::VMachine *vm ) diff -Nru /tmp/qLlpeOGf0f/falconpl-0.9.1.8/core/engine/core_module/fal_include.cpp /tmp/Y4mp0W3rzG/falconpl-0.9.2/core/engine/core_module/fal_include.cpp --- falconpl-0.9.1.8/core/engine/core_module/fal_include.cpp 2009-05-18 15:08:40.000000000 +0100 +++ falconpl-0.9.2/core/engine/core_module/fal_include.cpp 2009-06-19 12:01:44.000000000 +0100 @@ -29,7 +29,7 @@ @optparam path A string of ';' separated search paths. @optparam symDict Symbols to be queried (or nil). - @raise IOError if the module cannot be found or loaded. + @raise IoError if the module cannot be found or loaded. A module indicated by filename is compiled, loaded and linked in the running Virtual Machine. The inclusion is relative to the current diff -Nru /tmp/qLlpeOGf0f/falconpl-0.9.1.8/core/engine/core_module/file_ext.cpp /tmp/Y4mp0W3rzG/falconpl-0.9.2/core/engine/core_module/file_ext.cpp --- falconpl-0.9.1.8/core/engine/core_module/file_ext.cpp 2009-05-15 16:50:31.000000000 +0100 +++ falconpl-0.9.2/core/engine/core_module/file_ext.cpp 2009-06-19 12:01:44.000000000 +0100 @@ -548,7 +548,7 @@ /*# @method grabLine Stream @brief Grabs a line of text encoded data. - @sparam size Maximum count of characters to be read before to return anyway. + @param size Maximum count of characters to be read before to return anyway. @return A string containing the read line. @raise IoError on system errors. @@ -638,8 +638,8 @@ copying the memory buffers. MemBuf items can participate to stream binary writes through their internal - position pointers. The buffer is written from @a MemBuf.position up to - @a MemBuf.limit, and upon completion @a MemBuf.position is advanced accordingly + position pointers. The buffer is written from @a MemoryBuffer.position up to + @a MemoryBuffer.limit, and upon completion @a MemoryBuffer.position is advanced accordingly to the number of bytes effectively stored on the stream. When a MemBuf is used, @b size and @b start parameters are ignored. */ @@ -1750,9 +1750,11 @@ internal_make_stream( vm, new RawStdErrStream(), 2 ); } +/*# @endset */ + /*# @function systemErrorDescription - @inset core_general_purpose + @ingroup general_purpose @brief Returns a system dependent message explaining an integer error code. @param errorCode A (possibly) numeric error code that some system function has returned. @return A system-specific error description. @@ -1970,7 +1972,7 @@ @brief Returns the size of I/O buffering active on this stream. @return 0 if the stream is unbuffered or a positive number if it is buffered. - @see setBuffering + @see Stream.setBuffering */ FALCON_FUNC Stream_getBuffering ( ::Falcon::VMachine *vm ) diff -Nru /tmp/qLlpeOGf0f/falconpl-0.9.1.8/core/engine/core_module/format_ext.cpp /tmp/Y4mp0W3rzG/falconpl-0.9.2/core/engine/core_module/format_ext.cpp --- falconpl-0.9.1.8/core/engine/core_module/format_ext.cpp 2009-03-21 09:39:15.000000000 +0000 +++ falconpl-0.9.2/core/engine/core_module/format_ext.cpp 2009-06-20 00:08:37.000000000 +0100 @@ -31,7 +31,7 @@ Format class is meant to provide an efficient way to format variables into strings that can then be sent to output streams. Internally, the format class - is used in string expansion (the '@' operator), but while string expansion causes + is used in string expansion (the '\@' operator), but while string expansion causes a string parsing to be initiated and an internal temporary Format object to be instantiated each time an expansion is performed, using a prebuilt Format object allows to optimize repeated formatting operations. Also, Format class instances may @@ -41,7 +41,7 @@ The format specifier is a string that may contain various elements indicating how the target variable should be rendered as a string. - @subsection Format specification + @subsection format_specification Format specification @b Size: The minimum field length; it can be just expressed by a number. if the formatted output is wide as or wider than the allocated size, the output @@ -74,7 +74,7 @@ while if it's set to zero, decimal numbers will be rounded. @b Decimal @b separator: a 'd' followed by any non-cipher character will be interpreted as decimal - separator setting. In example, to use central European standard for decimal nubmers and limit the + separator setting. For example, to use central European standard for decimal nubmers and limit the output to 3 decimals, write ".3d,", or "d,.3". The default value is '.'. @b (Thousands) @b Grouping: actually it's the integer part group separator, as it will be displayed @@ -206,6 +206,7 @@ /*# @method format Format + @brief Performs desired formatting on a target item. @param item The item to be formatted @optparam dest A string where to store the formatted data. @return A formatted string @@ -258,6 +259,7 @@ /*# @method toString Format + @brief Represents this format as a string. @return The format specifier. Returns a string representation of the format instance. diff -Nru /tmp/qLlpeOGf0f/falconpl-0.9.1.8/core/engine/core_module/functional_ext.cpp /tmp/Y4mp0W3rzG/falconpl-0.9.2/core/engine/core_module/functional_ext.cpp --- falconpl-0.9.1.8/core/engine/core_module/functional_ext.cpp 2009-04-28 16:49:35.000000000 +0100 +++ falconpl-0.9.2/core/engine/core_module/functional_ext.cpp 2009-06-19 21:12:31.000000000 +0100 @@ -15,9 +15,6 @@ #include "core_module.h" -/*# - -*/ namespace Falcon { namespace core { @@ -54,7 +51,7 @@ so that when the VM finds a special construct in its evaluation process, it ceases using the default evaluation algorithm and passes evaluation control to the construct. - In example, the iff construct selects one of its branches to be evaluated only if the first + For example, the iff construct selects one of its branches to be evaluated only if the first parameter evaluates to true: @code list = [iff, someValueIsTrue, [func0, [func1, param1]], [func1, param2] ] @@ -74,7 +71,7 @@ Please, notice that "callable" doesn't necessarily mean "evaluable". To evaluate in functional context a callable symbol without parameter, it must be transformed into a single-element array. - In example: + For example: @code function func0(): ... @@ -309,7 +306,7 @@ This function works like @a any, but the sequence may be specified directly in the parameters rather being given in a separate array. This make easier to write - anyp in callable arrays. In example, one may write + anyp in callable arrays. For example, one may write @code [anyp, 1, k, n ...] @endcode @@ -395,7 +392,7 @@ This function works like @a all, but the collection may be specified directly in the parameters rather being given in a separate array. This make easier to - write allp in callable arrays. In example, one may write + write allp in callable arrays. For example, one may write @code [allp, 1, k, n ...] @endcode @@ -523,7 +520,7 @@ A standard VM comparation is performed, so the standard ordering rules apply. This also means that objects overloading - the @a FBOM.compare method may provide specialized ordering + the @a BOM.compare method may provide specialized ordering rules. If more than one item is found equal and lesser than @@ -568,7 +565,7 @@ A standard VM comparation is performed, so the standard ordering rules apply. This also means that objects overloading - the @a FBOM.compare method may provide specialized ordering + the @a BOM.compare method may provide specialized ordering rules. If more than one item is found equal and greater than @@ -616,7 +613,7 @@ If mfunc returns an out of band nil item, map skips the given position in the target array, actually acting also as a filter function. - In example: + For example: @code function mapper( item ) if item < 0: return oob(nil) // discard negative items @@ -853,7 +850,7 @@ an out-of-band 0 or 1. If any function in the sequence returns an out-of-band 0, @b times terminates and return immediately (performing an operation similar to "break"). If a function returns an out-of-band 1, the rest of the items in @b sequence are ignored, and the loop is restarted with the index updated; this - is equivalent to a functional "continue". In example: + is equivalent to a functional "continue". For example: @code times( 10, @@ -866,7 +863,7 @@ The @b times function return the last generated value for the index. A natural termination of @b times can be detected thanks to the fact that the index is equal to the upper bound of the range, while - an anticipated termination causes @b times to return a different index. In example, if @b count is + an anticipated termination causes @b times to return a different index. For example, if @b count is 10, the generated index (possibly received by the items in @b sequence) will range from 0 to 9 included, and if the function terminates correctly, it will return 10. If a function in @b sequence returns an out-of-band 0, causing a premature termination of the loop, the value returned by times will be the loop @@ -1165,7 +1162,7 @@ The filter function may return an out of band nil item to signal that the current item should not be added to the final collection. - In example: + For example: @code mapper = { item => item < 0 ? oob(nil) : item ** 0.5 } @@ -1425,7 +1422,7 @@ Basically, this function is meant to return the second parameter or the third (or nil if not given), depending on the value of the first parameter; however, every item is evaluated in a functional context. This means that cfr may be a callable item, in which case its return value will be evaluated - for truthfulness, and also the other parameters may. In example: + for truthfulness, and also the other parameters may. For example: @code > iff( 0, "was true", "was false" ) // will print "was false" iff( [{a=>a*2}, 1] , [printl, "ok!"] ) // will print "ok!" and return nil @@ -1559,7 +1556,7 @@ This function is meant to interrupt functional evaluation of lists. It has the same meaning of the single quote literal ' operator of the LISP language. - In example, the following code will return either a callable instance of printl, + For example, the following code will return either a callable instance of printl, which prints a "prompt" before the parameter, or a callable instance of inspect: @code iff( a > 0, [lit, [printl, "val: "] ], inspect)( param ) @@ -1712,7 +1709,7 @@ If the first function of the list declines processing by returning an oob item, the initial parameters are all passed to the second function, and so on till the last call. - In example: + For example: @code function whichparams( a, b ) @@ -1925,7 +1922,7 @@ The return value of this function, both used directly or pre-cached, can be seamlessly merged with the & operator in functional sequences. - In example, it is possible to write the following loop: + For example, it is possible to write the following loop: @code eval( .[ .[ times 10 &count .[ @@ -2035,6 +2032,173 @@ vm->regA() = *vm->param(0); } + +static bool core_brigade_next( ::Falcon::VMachine *vm ) +{ + int64 next = vm->local(0)->asInteger(); + + // Has the previous call returned something interesting? + if ( vm->regA().isOob() ) + { + if( vm->regA().isInteger() ) + { + // break request? + if( vm->regA().asInteger() == 0 ) + { + vm->retnil(); + return false; + } + else if( vm->regA().asInteger() == 1 ) + { + // loop from start + next = 0; + } + } + else if ( vm->regA().isArray() ) + { + CoreArray* newParams = vm->regA().asArray(); + *vm->local(1) = newParams; + // add a space for the calls + newParams->prepend( Item() ); + } + } + + CoreArray* list = vm->param(0)->asArray(); + + // are we done? + if( next >= list->length() ) + return false; + + // prepare the local call + vm->local(0)->setInteger( next + 1 ); + + bool success; + // anyhow, prepare the call + //-- have we changed parameters? + if ( vm->local(1)->isArray() ) + { + CoreArray* callarr = vm->local(1)->asArray(); + callarr->at(0) = list->at((int32)next); + success = vm->callFrame( callarr, 0 ); + } + else + { + // no? -- use our original paramters. + for( int32 i = 1; i < vm->paramCount(); ++i ) + { + vm->pushParameter( *vm->param(i) ); + } + + success = vm->callFrame( list->at((int32)next), vm->paramCount()-1 ); + } + + if ( ! success ) + { + throw new ParamError( ErrorParam( e_non_callable,__LINE__ ) ); + } + + return true; // call me again +} + + +/*# + @function brigade + @inset functional_support + @brief Process a list of functions passing the same parameters to them. + @param fl The sequence of callable items to be called. + @param ... Arbitrary parameters used by the brigade functions. + @return The return value of the last function in fl. + + This function process a sequence of functions passing them the + same set of parameters. The idea is that of a "brigate" of functions + operating all on the same parameters so that it is possible to put + common code into separate functions. + + Items in the list are not functionally evaluated; they are simply called, + passing to them the same parameters that the brigade group receives. Brigate + is an ETA funcion, and this means that ongoing functional evaluation is + interrupted as soon as a brigade is encountered. + + @code + function mean( array ) + value = 0 + for elem in array: value += elem + return value / len( array ) + end + + function dbl( array ) + for i in [0:len(array)]: array[i] *= 2 + end + + doubleMean = .[ brigade .[ + dbl + mean + ]] + + > "Mean: ", mean( [1,2,3] ) + > "Double mean: ", doubleMean( [1,2,3] ) + @endcode + + The above example brigades a "prefix" function to double the values in + an array that must be processed by the main function. + + Using out of band return values, the functions in the sequence can also + control the parameters that the following functions will receive, terminate + immediately the evaluation or restart it, forming a sort of iterative + functional loop. An oob 0 causes the sequence to be interrutped (and return oob(0) itself), + an out of band 1 will cause the first element of the sequence to be called again, and + an out of band array will permanently change the parameters as seen by the functions. + + The following brigate performs a first step using the given parameters, and another one + using modified ones: + + @code + looper = .[brigade .[ + { val, text => printl( text, ": ", val ) } // do things + { val, text => oob( [val+1, "Changed"] ) } // change params + { val, text => val >= 10 ? oob(0) : oob(1)} // loop control + ]] + + looper( 1, "Original" ) + @endcode +*/ + +FALCON_FUNC core_brigade ( ::Falcon::VMachine *vm ) +{ + Item *i_fl = vm->param(0); + + if( i_fl == 0 || ! i_fl->isArray() ) + { + throw new ParamError( ErrorParam( e_inv_params, __LINE__ ). + extra( "A" ) ); + } + + // nothing to do? + if ( i_fl->asArray()->length() == 0 ) + { + vm->retnil(); + return; + } + + vm->returnHandler( &core_brigade_next ); + vm->addLocals(2); + vm->local(0)->setInteger(1); + vm->local(1)->setNil(); + + // anyhow, prepare the call + for( int32 i = 1; i < vm->paramCount(); ++i ) + { + vm->pushParameter( *vm->param(i) ); + } + + if ( ! vm->callFrame( vm->param(0)->asArray()->at(0), vm->paramCount()-1 ) ) + { + throw new ParamError( ErrorParam( e_non_callable,__LINE__ ) ); + } + +} + + } } diff -Nru /tmp/qLlpeOGf0f/falconpl-0.9.1.8/core/engine/core_module/function_ext.cpp /tmp/Y4mp0W3rzG/falconpl-0.9.2/core/engine/core_module/function_ext.cpp --- falconpl-0.9.1.8/core/engine/core_module/function_ext.cpp 2009-03-22 23:11:56.000000000 +0000 +++ falconpl-0.9.2/core/engine/core_module/function_ext.cpp 2009-06-19 12:01:44.000000000 +0100 @@ -22,7 +22,7 @@ /*# @method name Function @brief Gets the symbolic name of the given function. - @returns A string containing the function name + @return A string containing the function name This is useful if the function symbol or has been re-assigned to temporary variables, or if it is applied @@ -43,7 +43,7 @@ @method caller Function @brief Gets the direct caller or one of the calling ancestors. @optparam level Caller level (starting from zero, the default). - @returns The item having performed the nth call. + @return The item having performed the nth call. This function returns the n-th caller (zero based) that caused this function to be called. It may be a function, a method diff -Nru /tmp/qLlpeOGf0f/falconpl-0.9.1.8/core/engine/core_module/gc_ext.cpp /tmp/Y4mp0W3rzG/falconpl-0.9.2/core/engine/core_module/gc_ext.cpp --- falconpl-0.9.1.8/core/engine/core_module/gc_ext.cpp 2009-04-08 17:49:00.000000000 +0100 +++ falconpl-0.9.2/core/engine/core_module/gc_ext.cpp 2009-06-19 12:01:44.000000000 +0100 @@ -16,19 +16,17 @@ #include "core_module.h" #include -/*# - -*/ namespace Falcon { namespace core { /*# @page gc_control About the garbage collector. + The standard collector strategy (be it set up by the Falcon interpreter or by embedding applications) is adequate for average scripts. However, some script meant to start from command line and dealing with time - critical data may find the action of the garbage collector too intrusive. In example + critical data may find the action of the garbage collector too intrusive. For example the GC may occuur at the wrong time. Other times, calculation intensive programs may generate a lot of data that they know in advance can be never garbaged during some period. In those case, having GC to scan periodically the diff -Nru /tmp/qLlpeOGf0f/falconpl-0.9.1.8/core/engine/core_module/inspect.cpp /tmp/Y4mp0W3rzG/falconpl-0.9.2/core/engine/core_module/inspect.cpp --- falconpl-0.9.1.8/core/engine/core_module/inspect.cpp 2009-04-04 16:53:27.000000000 +0100 +++ falconpl-0.9.2/core/engine/core_module/inspect.cpp 2009-06-19 12:01:44.000000000 +0100 @@ -24,10 +24,6 @@ #include #include -/*# - -*/ - namespace Falcon { namespace core { diff -Nru /tmp/qLlpeOGf0f/falconpl-0.9.1.8/core/engine/core_module/itemcopy.cpp /tmp/Y4mp0W3rzG/falconpl-0.9.2/core/engine/core_module/itemcopy.cpp --- falconpl-0.9.1.8/core/engine/core_module/itemcopy.cpp 2009-03-15 15:02:51.000000000 +0000 +++ falconpl-0.9.2/core/engine/core_module/itemcopy.cpp 2009-06-19 12:01:44.000000000 +0100 @@ -35,7 +35,7 @@ /*# @function itemCopy - @inset core_general_purpose + @ingroup general_purpose @brief Performs a shallow copy of one item. @param item The item to be copied. @return A copy of the item. diff -Nru /tmp/qLlpeOGf0f/falconpl-0.9.1.8/core/engine/core_module/item_ext.cpp /tmp/Y4mp0W3rzG/falconpl-0.9.2/core/engine/core_module/item_ext.cpp --- falconpl-0.9.1.8/core/engine/core_module/item_ext.cpp 2009-04-30 15:07:59.000000000 +0100 +++ falconpl-0.9.2/core/engine/core_module/item_ext.cpp 2009-06-19 12:01:44.000000000 +0100 @@ -44,6 +44,15 @@ value is 0. */ +/*# + @method len BOM + + @brief Retreives the lenght of a collection + @return the count of items in the sequence, or 0. + + The returned value represent the "size" of this item. + @see len +*/ FALCON_FUNC mth_len ( ::Falcon::VMachine *vm ) { Item *elem; @@ -231,6 +240,14 @@ - @b MethodType - the item is a method - @b ClassMethodType - the item is a method inside a class */ + +/*# + @method typeId BOM + @brief Returns an integer indicating the type of this item. + @return A constant indicating the type of the item. + + See @a typeOf() function for details. +*/ FALCON_FUNC mth_typeId ( ::Falcon::VMachine *vm ) { if ( vm->self().isMethodic() ) @@ -1058,7 +1075,7 @@ } /*# - @method ptr MemBuf + @method ptr MemoryBuffer @brief Returns the pointer to the raw memory stored in this memory buffer. @return A memory pointer. diff -Nru /tmp/qLlpeOGf0f/falconpl-0.9.1.8/core/engine/core_module/iterator_ext.cpp /tmp/Y4mp0W3rzG/falconpl-0.9.2/core/engine/core_module/iterator_ext.cpp --- falconpl-0.9.1.8/core/engine/core_module/iterator_ext.cpp 2009-03-15 15:02:51.000000000 +0000 +++ falconpl-0.9.2/core/engine/core_module/iterator_ext.cpp 2009-06-19 12:01:44.000000000 +0100 @@ -21,10 +21,6 @@ namespace core { /*# - -*/ - -/*# @class Iterator @brief Indirect pointer to sequences. @ingroup general_purpose @@ -792,7 +788,7 @@ greater than the desired key; it's the best position for an insertion of the searched key. - In example, to traverse all the items in a dictionary starting with 'C', + For example, to traverse all the items in a dictionary starting with 'C', the following code can be used: @code @@ -929,13 +925,14 @@ } break; - case FLC_ITEM_OBJECT: + default: { CoreIterator *iter = dyncast( self->getFalconData() ); - if ( iter->insert( *i_key ) ) + if( iter->insert( *i_key ) ) + { return; + } } - break; } vm->raiseRTError( new AccessError( ErrorParam( e_arracc ).extra( "Iterator.insert" ) ) ); diff -Nru /tmp/qLlpeOGf0f/falconpl-0.9.1.8/core/engine/core_module/list.cpp /tmp/Y4mp0W3rzG/falconpl-0.9.2/core/engine/core_module/list.cpp --- falconpl-0.9.1.8/core/engine/core_module/list.cpp 2009-03-15 15:02:51.000000000 +0000 +++ falconpl-0.9.2/core/engine/core_module/list.cpp 2009-06-20 00:08:37.000000000 +0100 @@ -26,10 +26,6 @@ #include "core_module.h" #include -/*# - -*/ - namespace Falcon { namespace core { @@ -44,7 +40,7 @@ can be generated for them using first() and last() BOM methods. Also, instances of the List class can be used as any other sequence in for/in loops. - In example, the following code: + For example, the following code: @code descr = List("blue", "red", "gray", "purple") @@ -66,6 +62,8 @@ /*# @init List + @brief Creates and eventually fills the list. + This constructor creates a list that may be initially filled with the items passed as parameters. The items are inserted in the order they are passed. @@ -178,7 +176,7 @@ @raise AccessError if the list is empty. @return The first item in the list. - This method overloads the BOM method @a BOM.front. If the list + This method overloads the BOM method @b front. If the list is not empty, it returns the first element. */ FALCON_FUNC List_front ( ::Falcon::VMachine *vm ) @@ -201,7 +199,7 @@ @raise AccessError if the list is empty. @return The last item in the list. - This method overloads the BOM method @a BOM.back. If the list + This method overloads the BOM method @b back. If the list is not empty, it returns the last element. */ FALCON_FUNC List_back ( ::Falcon::VMachine *vm ) @@ -237,6 +235,7 @@ CoreObject *iobj = i_iclass->asClass()->createInstance(); ItemListElement *iter = list->first(); iobj->setUserData( new ItemListIterator( list, iter ) ); + iobj->setProperty( "_origin", vm->self() ); vm->retval( iobj ); } @@ -257,7 +256,7 @@ fassert( i_iclass != 0 ); CoreObject *iobj = i_iclass->asClass()->createInstance(); - iobj->setProperty( "origin", vm->self() ); + iobj->setProperty( "_origin", vm->self() ); ItemListElement *iter = list->last(); iobj->setUserData( new ItemListIterator( list, iter ) ); @@ -340,7 +339,7 @@ Inserts an item at the position indicated by the iterator. After a successful insert, the new item is placed before the old one and the iterator points to the - new item. In example, if inserting at the position indicated by first(), the new + new item. For example, if inserting at the position indicated by first(), the new item is appended in front of the list and the iterator still points to the first item. To insert at the end of the list, get last() iterator, and move it forward with next(). The iterator is then invalidated, but an insert() will append an diff -Nru /tmp/qLlpeOGf0f/falconpl-0.9.1.8/core/engine/core_module/math.cpp /tmp/Y4mp0W3rzG/falconpl-0.9.2/core/engine/core_module/math.cpp --- falconpl-0.9.1.8/core/engine/core_module/math.cpp 2008-11-08 16:54:01.000000000 +0000 +++ falconpl-0.9.2/core/engine/core_module/math.cpp 2009-06-19 12:01:44.000000000 +0100 @@ -424,7 +424,7 @@ @return The fractional part of a number. This function returns the non-integer part of a number. - In example, + For example, @code > fract( 1.234 ) @endcode @@ -456,7 +456,7 @@ @return A floating point number with fractional part zeroed. Fint function works like the core @a int function, - but it returns a floating point number. In example, + but it returns a floating point number. For example, @b fint applied on 3.58e200 will return the same number, while @a int would raise a math error, as the number cannot be represented in a integer @@ -492,7 +492,7 @@ floating point number. If the fractional part of the number is greater or equal to 0.5, the number is rounded up to the nearest biggest integer in absolute value, while if it's less than 0.5 - the number is rounded down to the mere integer part. In example, 1.6 + the number is rounded down to the mere integer part. For example, 1.6 is rounded to 2, -1.6 is rounded to -2, 1.2 is rounded to 1 and -1.2 is rounded to -1. */ @@ -534,7 +534,7 @@ @return The smallest integer near to the given value. Floor function returns the smallest integer near to a given floating - point number. In example, floor of 1.9 is 1, and floor of -1.9 is -2. + point number. For example, floor of 1.9 is 1, and floor of -1.9 is -2. If an integer number is given, then the function returns the same number. This is similar to fint(), but in case of negative numbers @a fint would return the integer part; in case of -1.9 it would return -1. @@ -562,7 +562,7 @@ @return The ceil value. Ceil function returns the highest integer near to a given floating point - number. In example, ceil of 1.1 is 2, and ceil of -1.1 is -1. If an + number. For example, ceil of 1.1 is 2, and ceil of -1.1 is -1. If an integer number is given, then the function returns the same number. */ diff -Nru /tmp/qLlpeOGf0f/falconpl-0.9.1.8/core/engine/core_module/membuf_ext.cpp /tmp/Y4mp0W3rzG/falconpl-0.9.2/core/engine/core_module/membuf_ext.cpp --- falconpl-0.9.1.8/core/engine/core_module/membuf_ext.cpp 2009-03-22 17:30:23.000000000 +0000 +++ falconpl-0.9.2/core/engine/core_module/membuf_ext.cpp 2009-06-19 12:01:44.000000000 +0100 @@ -15,9 +15,6 @@ #include "core_module.h" -/*# - -*/ namespace Falcon { namespace core { @@ -58,22 +55,16 @@ /*# @class MemoryBuffer @from BOM + @ingroup bom_classes @brief Metaclass for MemBuf items. - @see membuf_bin_parse -*/ - -/*# - @group membuf_bin_parse MemBuf pointers - @brief Binary stream parsing support. - The Memory Buffers have a set of internal pointers and sequence methods useful to parse binary streams read in variable size chunks. Initially, allocate a memory buffer wide enough to store enough data. The maximum possible amount of data units (generally bytes) that can be stored in a memory buffer is its @b length, returned by the - @a BOM.len method or @a len function. + BOM @b len method or @a len function. After having read some contents from a stream, the buffer @b limit will be moved to the amount of incoming data (which may be also @@ -191,7 +182,6 @@ /*# @method put MemoryBuffer @brief Puts a value in the memory buffer. - @ingroup membuf_bin_parse @return The buffer itself. @raise AccessError if the buffer is full (limit() == position()) @@ -215,7 +205,6 @@ /*# @method get MemoryBuffer @brief Gets a value in the memory buffer. - @ingroup membuf_bin_parse @return the retreived value. @raise AccessError if the buffer is full (limit() == position()) @@ -231,7 +220,6 @@ /*# @method rewind MemoryBuffer @brief Rewinds the buffer and discards the mark. - @ingroup membuf_bin_parse @return The buffer itself Returns the position at 0 and discards the mark. Limit is unchanged. @@ -247,7 +235,6 @@ /*# @method reset MemoryBuffer @brief Returns the position to the last mark. - @ingroup membuf_bin_parse @return The buffer itself @raise AccessError if the mark is not defined. @@ -264,7 +251,6 @@ /*# @method remaining MemoryBuffer @brief Determines how many items can be read. - @ingroup membuf_bin_parse @return Count of remanining items. Returns the count of times get and put can be called on this memory buffer @@ -279,7 +265,6 @@ /*# @method compact MemoryBuffer @brief Discards processed data and prepares to a new read. - @ingroup membuf_bin_parse @return The buffer itself This operation moves all the bytes between the position (included) and the limit @@ -303,7 +288,6 @@ /*# @method flip MemoryBuffer @brief Sets the limit to the current position, and the position to zero. - @ingroup membuf_bin_parse @return The buffer itself This is useful to write some parsed or created contents back on a stream. @@ -322,7 +306,6 @@ /*# @method mark MemoryBuffer @brief Places the mark at current position. - @ingroup membuf_bin_parse @return The buffer itself This position sets the mark at current position; calling @a MemoryBuffer.reset later @@ -339,7 +322,6 @@ /*# @method position MemoryBuffer @brief Sets or get the current position in the buffer. - @ingroup membuf_bin_parse @optparam pos The new position @return The buffer itself or the requested position. @raise AccessError if the @b pos parameter is > limit. @@ -373,7 +355,6 @@ /*# @method clear MemoryBuffer @brief Clears the buffer resetting it to initial status. - @ingroup membuf_bin_parse @return The buffer itself. Removes the mark, sets the position to zero and the limit to the length. @@ -417,6 +398,17 @@ } } + +/*# + @method wordSize MemoryBuffer + @brief Returns the number of bytes used to store each entry of this Memory Buffer. + @return Size of each memory buffer entity in bytes. +*/ +FALCON_FUNC MemoryBuffer_wordSize( ::Falcon::VMachine *vm ) +{ + vm->retval( (int64) vm->self().asMemBuf()->wordSize() ); +} + /*# @method fill MemoryBuffer @brief Fills all the elements in the memory buffer with a given value. diff -Nru /tmp/qLlpeOGf0f/falconpl-0.9.1.8/core/engine/core_module/message_ext.cpp /tmp/Y4mp0W3rzG/falconpl-0.9.2/core/engine/core_module/message_ext.cpp --- falconpl-0.9.1.8/core/engine/core_module/message_ext.cpp 2009-05-19 10:04:49.000000000 +0100 +++ falconpl-0.9.2/core/engine/core_module/message_ext.cpp 2009-06-20 00:08:37.000000000 +0100 @@ -68,13 +68,13 @@ @param msg A message (string) to be broadcast. @optparam ... Zero or more data to be broadcaset. @brief Sends a message to every callable item subscribed to a message. - @return true if @a msg is found, false if it doesn't exist. + @return true if @b msg is found, false if it doesn't exist. @inset set_message_model @see VMSlot @see getSlot Broadcast function implicitly searches for a Virtual Machine Message Slot (@a VMSlot) - with the given @a msg name, and if it finds it, it emits a broadcast on that. + with the given @b msg name, and if it finds it, it emits a broadcast on that. If the message is not found, the broadcast is silently dropped (no error is raised), but the function returns false. @@ -126,9 +126,8 @@ if ( i_msg == 0 || ! i_msg->isString() || i_handler == 0 || ! ( i_handler->isCallable() || i_handler->isComposed() ) ) { - vm->raiseRTError( new ParamError( ErrorParam( e_inv_params ). - extra( "S,C" ) ) ); - return; + throw new ParamError( ErrorParam( e_inv_params ). + extra( "S,C" ) ); } String *sub = i_msg->asString(); @@ -159,17 +158,15 @@ if ( i_msg == 0 || ! i_msg->isString() || i_handler == 0 || ! ( i_handler->isCallable() || i_handler->isComposed() ) ) { - vm->raiseRTError( new ParamError( ErrorParam( e_inv_params ). - extra( "S,C" ) ) ); - return; + throw new ParamError( ErrorParam( e_inv_params ). + extra( "S,C" ) ); } CoreSlot* cs = vm->getSlot( *i_msg->asString(), false ); if ( cs == 0 ) { - vm->raiseRTError( new AccessError( ErrorParam( e_inv_params ). - extra( *i_msg->asString() ) ) ); - return; + throw new AccessError( ErrorParam( e_inv_params ). + extra( *i_msg->asString() ) ); } if( ! cs->remove( *i_handler ) ) @@ -198,9 +195,8 @@ if ( i_msg == 0 || ! i_msg->isString() ) { - vm->raiseRTError( new ParamError( ErrorParam( e_inv_params ). - extra( "S" ) ) ); - return; + throw new ParamError( ErrorParam( e_inv_params ). + extra( "S" ) ); } CoreSlot* cs = vm->getSlot( *i_msg->asString(), (vm->param(1) == 0 || vm->param(1)->isTrue()) ); @@ -248,9 +244,8 @@ Item *i_data = vm->param( 1 ); if ( i_msg == 0 || ! i_msg->isString() || i_data == 0 ) { - vm->raiseRTError( new ParamError( ErrorParam( e_inv_params ). - extra( "S,X" ) ) ); - return; + throw new ParamError( ErrorParam( e_inv_params ). + extra( "S,X" ) ); } CoreSlot* cs = vm->getSlot( *i_msg->asString(), true ); @@ -268,9 +263,8 @@ Item *i_msg = vm->param( 0 ); if ( i_msg == 0 || ! i_msg->isString() ) { - vm->raiseRTError( new ParamError( ErrorParam( e_inv_params ). - extra( "S" ) ) ); - return; + throw new ParamError( ErrorParam( e_inv_params ). + extra( "S" ) ); } CoreSlot* cs = vm->getSlot( *i_msg->asString(), true ); @@ -301,9 +295,8 @@ if ( i_msg == 0 || ! i_msg->isString() ) { - vm->raiseRTError( new ParamError( ErrorParam( e_inv_params ). - extra( "S" ) ) ); - return; + throw new ParamError( ErrorParam( e_inv_params ). + extra( "S" ) ); } CoreSlot* cs = vm->getSlot( *i_msg->asString(), true ); @@ -373,7 +366,7 @@ */ /*# - @endgroup message_model + @endgroup */ /*# @@ -386,9 +379,8 @@ if ( i_msg == 0 || ! i_msg->isString() ) { - vm->raiseRTError( new ParamError( ErrorParam( e_inv_params ). - extra( "S" ) ) ); - return; + throw new ParamError( ErrorParam( e_inv_params ). + extra( "S" ) ); } CoreSlot* vms = vm->getSlot( *i_msg->asString(), true ); @@ -438,9 +430,8 @@ Item *i_prio = vm->param(1); if ( callback == 0 || ! ( callback->isCallable() || callback->isComposed() ) ) { - vm->raiseRTError( new ParamError( ErrorParam( e_inv_params ). - extra( "C" ) ) ); - return; + throw new ParamError( ErrorParam( e_inv_params ). + extra( "C" )); } CoreSlot* cs = (CoreSlot*) vm->self().asObject()->getUserData(); @@ -464,9 +455,8 @@ Item *callback = vm->param(0); if ( callback == 0 ) { - vm->raiseRTError( new ParamError( ErrorParam( e_inv_params ). - extra( "S,C" ) ) ); - return; + throw new ParamError( ErrorParam( e_inv_params ). + extra( "S,C" ) ); } CoreSlot* cs = (CoreSlot*) vm->self().asObject()->getUserData(); @@ -492,9 +482,8 @@ Item *callback = vm->param(0); if ( callback == 0 || ! ( callback->isCallable() || callback->isComposed() ) ) { - vm->raiseRTError( new ParamError( ErrorParam( e_inv_params ). - extra( "C" ) ) ); - return; + throw new ParamError( ErrorParam( e_inv_params ). + extra( "C" ) ); } CoreSlot* cs = (CoreSlot*) vm->self().asObject()->getUserData(); @@ -515,8 +504,8 @@ Item *i_data = vm->param( 0 ); if ( i_data == 0 ) { - vm->raiseRTError( new ParamError( ErrorParam( e_inv_params ). - extra( "X" ) ) ); + throw new ParamError( ErrorParam( e_inv_params ). + extra( "X" ) ); return; } diff -Nru /tmp/qLlpeOGf0f/falconpl-0.9.1.8/core/engine/core_module/oob_ext.cpp /tmp/Y4mp0W3rzG/falconpl-0.9.2/core/engine/core_module/oob_ext.cpp --- falconpl-0.9.1.8/core/engine/core_module/oob_ext.cpp 2008-08-14 01:58:50.000000000 +0100 +++ falconpl-0.9.2/core/engine/core_module/oob_ext.cpp 2009-06-19 12:01:44.000000000 +0100 @@ -15,9 +15,7 @@ #include "core_module.h" -/*# -*/ namespace Falcon { namespace core { @@ -28,7 +26,7 @@ Out-of-band items are normal items which can be tested for the out-of-band quality through the @a isoob function to perform special tasks. Some core and RTL functions can check for the item being out-of-band to take special decisions about the item, or to - modify their behavior. In example, the @a map function drops the item (acting like @a filter ), + modify their behavior. For example, the @a map function drops the item (acting like @a filter ), if it is out-of-band. This feature is available also to scripts; functions accepting any kind of items from @@ -146,7 +144,7 @@ return; } - vm->retval( (int64) (obbed->isOob() ? 1 : 0 ) ); + vm->regA().setBoolean( obbed->isOob() ); } } diff -Nru /tmp/qLlpeOGf0f/falconpl-0.9.1.8/core/engine/core_module/param_ext.cpp /tmp/Y4mp0W3rzG/falconpl-0.9.2/core/engine/core_module/param_ext.cpp --- falconpl-0.9.1.8/core/engine/core_module/param_ext.cpp 2009-05-06 22:04:51.000000000 +0100 +++ falconpl-0.9.2/core/engine/core_module/param_ext.cpp 2009-06-19 12:01:44.000000000 +0100 @@ -15,10 +15,6 @@ #include "core_module.h" -/*# - -*/ - namespace Falcon { namespace core { diff -Nru /tmp/qLlpeOGf0f/falconpl-0.9.1.8/core/engine/core_module/path_ext.cpp /tmp/Y4mp0W3rzG/falconpl-0.9.2/core/engine/core_module/path_ext.cpp --- falconpl-0.9.1.8/core/engine/core_module/path_ext.cpp 2009-03-27 22:29:11.000000000 +0000 +++ falconpl-0.9.2/core/engine/core_module/path_ext.cpp 2009-06-19 12:01:44.000000000 +0100 @@ -292,7 +292,7 @@ If the parameter is an array, it must have at least four string elements, and it will be used to build the path from - its constituents. In example: + its constituents. For example: @code unit = "C" @@ -300,12 +300,13 @@ file = "somefile" ext = "anext" p = Path( [ unit, location, file, ext ] ) - @endocde + @endcode @b nil can be passed if some part of the specification is not used. @note Use the fileNameMerge() function to simply merge elements of a path specification into a string. + @see fileNameMerge */ diff -Nru /tmp/qLlpeOGf0f/falconpl-0.9.1.8/core/engine/core_module/random.cpp /tmp/Y4mp0W3rzG/falconpl-0.9.2/core/engine/core_module/random.cpp --- falconpl-0.9.1.8/core/engine/core_module/random.cpp 2009-03-15 15:02:51.000000000 +0000 +++ falconpl-0.9.2/core/engine/core_module/random.cpp 2009-06-19 12:01:44.000000000 +0100 @@ -30,10 +30,6 @@ #include /*# - -*/ - -/*# @funset core_random Random functions @brief Functions providing random numbers and sequences. @beginset core_random @@ -292,7 +288,7 @@ @function randomDice @brief Performs a virtual dice set trow. @param dices Number of dices to be thrown. - @optParam sides Number of faces in the virtual dices. + @optparam sides Number of faces in the virtual dices. @return A random value which is the sum of the virtual throws. This function generates a series of successive @b dices throws, diff -Nru /tmp/qLlpeOGf0f/falconpl-0.9.1.8/core/engine/core_module/seconds.cpp /tmp/Y4mp0W3rzG/falconpl-0.9.2/core/engine/core_module/seconds.cpp --- falconpl-0.9.1.8/core/engine/core_module/seconds.cpp 2009-03-21 09:39:15.000000000 +0000 +++ falconpl-0.9.2/core/engine/core_module/seconds.cpp 2009-06-19 12:01:44.000000000 +0100 @@ -22,17 +22,13 @@ #include #endif -/*# - -*/ - namespace Falcon { namespace core { /*# @function seconds - @inset core_general_purpose + @ingroup general_purpose @brief Returns the number of seconds since the "epoch" as reported by the system. @return The number of seconds and fractions of seconds in a floating point value. diff -Nru /tmp/qLlpeOGf0f/falconpl-0.9.1.8/core/engine/core_module/serialize.cpp /tmp/Y4mp0W3rzG/falconpl-0.9.2/core/engine/core_module/serialize.cpp --- falconpl-0.9.1.8/core/engine/core_module/serialize.cpp 2009-05-08 22:53:59.000000000 +0100 +++ falconpl-0.9.2/core/engine/core_module/serialize.cpp 2009-06-19 12:01:44.000000000 +0100 @@ -29,10 +29,6 @@ #include /*# - -*/ - -/*# @funset core_serialization Serialization functions @brief Function used to store items persistently. @@ -98,12 +94,7 @@ is raised. The BOM method @a BOM.serialize is available for all the Falcon items, - and is equivalent to call this function. Also, the method - @a Stream.writeItem is equivalent to this function; the difference in - BOM.serialize() and Stream.writeItem() is only in the fact that - Item.serialize() accepts a stream on which to perform the serialization as the - parameter, while Stream.writeItem() must be provided with the item to be - serialized. + and is equivalent to call this function. */ FALCON_FUNC mth_serialize ( ::Falcon::VMachine *vm ) { @@ -158,8 +149,7 @@ If the underlying stream read causes an i/o failure, an error is raised. Also, an error is raised if the function cannot deserialize from the stream - because the data format is invalid. This call is equivalent to call - @a Stream.readItem method. + because the data format is invalid. */ FALCON_FUNC deserialize ( ::Falcon::VMachine *vm ) diff -Nru /tmp/qLlpeOGf0f/falconpl-0.9.1.8/core/engine/core_module/string_ext.cpp /tmp/Y4mp0W3rzG/falconpl-0.9.2/core/engine/core_module/string_ext.cpp --- falconpl-0.9.1.8/core/engine/core_module/string_ext.cpp 2009-05-07 17:23:35.000000000 +0100 +++ falconpl-0.9.2/core/engine/core_module/string_ext.cpp 2009-06-20 00:08:37.000000000 +0100 @@ -28,10 +28,6 @@ #include /*# - -*/ - -/*# @funset core_string_functions String functions @brief Functions manipulating strings @@ -79,15 +75,7 @@ } /*# - @class String - @from BOM - @brief Metaclass for string items. - - This is the set of methods that can be applied to string items. -*/ - -/*# - @method String charSize + @method charSize String @brief Returns or changes the size in bytes in this string. @optparam bpc New value for bytes per character (1, 2 or 4). @return This string if @b bpc is given, or the current character size value if not given. @@ -97,11 +85,11 @@ { Item *i_bpc = vm->param(0); String* str = vm->self().asString(); - + if ( i_bpc == 0 ) { // no parameters -- just read us. - vm->retval( (int64) str->manipulator()->charSize() ); + vm->retval( (int64) str->manipulator()->charSize() ); return; } else if( ! i_bpc->isOrdinal() ) @@ -109,13 +97,13 @@ throw new ParamError( ErrorParam( e_inv_params, __LINE__ ) .extra( "[N]" ) ); } - + uint32 bpc = (uint32) i_bpc->forceInteger(); if ( ! str->setCharSize( bpc ) ) { throw new ParamError( ErrorParam( e_param_range, __LINE__ ) ); } - + vm->retval( str ); } @@ -327,7 +315,7 @@ @note this function is equivalent to the fbom method String.splittr - @note See @a Tokienizer for a more adequate function to scan extensively + @note See @a Tokenizer for a more adequate function to scan extensively wide strings. */ @@ -462,7 +450,7 @@ at worst a single element containing a copy of the whole string passed as a parameter. - In example, the following may be useful to parse a INI file where keys are + For example, the following may be useful to parse a INI file where keys are separated from values by "=" signs: @code @@ -664,10 +652,10 @@ CoreString *ts = new CoreString; // filling the target. - for( uint32 i = 1; i <= len ; i ++ ) + for( uint32 i = 1; i <= len ; i ++ ) { Item* item = elements+(i-1); - + if ( item->isString() ) *ts += *item->asString(); else @@ -680,7 +668,7 @@ if ( mr_str != 0 && i < len ) ts->append( *mr_str ); - ts->reserve( len/i * ts->size() ); + ts->reserve( len/i * ts->size() ); } vm->retval( ts ); @@ -695,7 +683,7 @@ If this string is not empty, it is copied between each joined string. - In example, the next code separates each value with ", " + For example, the next code separates each value with ", " @code > ", ".join( "have", "a", "nice", "day" ) @@ -736,7 +724,7 @@ *ts += temp; } - ts->reserve( pc/i * ts->size() ); + ts->reserve( pc/i * ts->size() ); } } @@ -1058,7 +1046,7 @@ @function strFrontTrim @brief Removes white spaces from the front of the string. @param string The string to be trimmed. - @optParam trimSet A set of characters that must be removed. + @optparam trimSet A set of characters that must be removed. @return The trimmed substring. A new string, which is a copy of the original one with all characters in @b trimSet @@ -1129,7 +1117,7 @@ @function strBackTrim @brief Removes white spaces at both the beginning and the end of the string. @param string The string to be trimmed. - @optParam trimSet A set of characters that must be removed. + @optparam trimSet A set of characters that must be removed. @return The trimmed substring. A new string, which is a copy of the original one with all characters in @b trimSet @@ -1520,6 +1508,136 @@ } } + +/*# + @method startsWith String + @brief Check if a strings starts with a substring. + @param token The substring that will be compared with this string. + @optparam icase If true, pefroms a case neutral check + @return True if @b token matches the beginning of this string, false otherwise. + + This method performs a comparation check at the beginning of the string. + If this string starts with @b token, the function returns true. If @b token + is larger than the string, the method will always return false, and + if @b token is an empty string, it will always match. + + The optional parameter @b icase can be provided as true to have this + method to perform a case insensitive match. +*/ +/*# + @function strStartsWith + @brief Check if a strings starts with a substring. + @param string The string that is going to be tested for the given token. + @param token The substring that will be compared with this string. + @optparam icase If true, pefroms a case neutral check + @return True if @b token matches the beginning of @b string, false otherwise. + + This functioin performs a comparation check at the beginning of the @b string. + If this string starts with @b token, the function returns true. If @b token + is larger than the string, the function will always return false, and + if @b token is an empty string, it will always match. + + The optional parameter @b icase can be provided as true to have this + function to perform a case insensitive match. +*/ + +FALCON_FUNC mth_strStartsWith ( ::Falcon::VMachine *vm ) +{ + Item* source; + Item* i_token; + Item* i_icase; + + // Parameter checking; + if ( vm->self().isMethodic() ) + { + source = &vm->self(); + i_token = vm->param(0); + i_icase = vm->param(1); + } + else + { + source = vm->param(0); + i_token = vm->param(1); + i_icase = vm->param(2); + } + + if ( source == 0 || ! source->isString() || + i_token == 0 || ! i_token->isString() ) + { + throw new ParamError( ErrorParam( e_inv_params, __LINE__ ) + .origin( e_orig_runtime ) + .extra( vm->self().isMethodic() ? "S,[B]" : "S,S,[B]" ) ); + } + + String *src = source->asString(); + vm->regA().setBoolean( src->startsWith( *i_token->asString(), i_icase ? i_icase->isTrue():false ) ); +} + + +/*# + @method endsWith String + @brief Check if a strings ends with a substring. + @param token The substring that will be compared with this string. + @optparam icase If true, pefroms a case neutral check + @return True if @b token matches the end of this string, false otherwise. + + This method performs a comparation check at the end of the string. + If this string ends with @b token, the function returns true. If @b token + is larger than the string, the method will always return false, and + if @b token is an empty string, it will always match. + + The optional parameter @b icase can be provided as true to have this + method to perform a case insensitive match. +*/ +/*# + @function strEndsWith + @brief Check if a strings ends with a substring. + @param string The string that is going to be tested for the given token. + @param token The substring that will be compared with this string. + @optparam icase If true, pefroms a case neutral check + @return True if @b token matches the end of @b string, false otherwise. + + This functioin performs a comparation check at the end of the @b string. + If this string ends with @b token, the function returns true. If @b token + is larger than the string, the function will always return false, and + if @b token is an empty string, it will always match. + + The optional parameter @b icase can be provided as true to have this + function to perform a case insensitive match. +*/ +FALCON_FUNC mth_strEndsWith ( ::Falcon::VMachine *vm ) +{ + Item* source; + Item* i_token; + Item* i_icase; + + // Parameter checking; + if ( vm->self().isMethodic() ) + { + source = &vm->self(); + i_token = vm->param(0); + i_icase = vm->param(1); + } + else + { + source = vm->param(0); + i_token = vm->param(1); + i_icase = vm->param(2); + } + + if ( source == 0 || ! source->isString() || + i_token == 0 || ! i_token->isString() ) + { + throw new ParamError( ErrorParam( e_inv_params, __LINE__ ) + .origin( e_orig_runtime ) + .extra( vm->self().isMethodic() ? "S,[B]" : "S,S,[B]" ) ); + } + + String *src = source->asString(); + vm->regA().setBoolean( src->endsWith( *i_token->asString(), i_icase ? i_icase->isTrue() : false ) ); +} + + /*# @function strCmpIgnoreCase @brief Performs a lexicographic comparation of two strings, ignoring character case. @@ -1633,14 +1751,16 @@ The wildcard must match completely the given string for the function to return true. - In example: + For example: - "*" matches everything - "a?b" matches "aab", "adb" and so on - "a*b" matches "ab", "annnb" and so on + + @see String.wmatch */ /*# - @method wmatch + @method wmatch String @brief Perform an old-style file-like jolly-based wildcard match. @param wildcard A wildcard, possibly but not necessarily including a jolly character. @optparam ignoreCase If true, the latin 26 base letters case is ignored in matches. @@ -1653,10 +1773,12 @@ The wildcard must match completely the given string for the function to return true. - In example: + For example: - "*" matches everything - "a?b" matches "aab", "adb" and so on - "a*b" matches "ab", "annnb" and so on + + @see strWildcardMatch */ FALCON_FUNC mth_strWildcardMatch ( ::Falcon::VMachine *vm ) { @@ -1811,7 +1933,7 @@ */ /*# - @method toMemBuf + @method toMemBuf String @brief Convets this string into a Memory Buffer @optparam wordWidth The memory buffer word width (defaults to string character size). @return The resulting membuf. diff -Nru /tmp/qLlpeOGf0f/falconpl-0.9.1.8/core/engine/core_module/stringstream_ext.cpp /tmp/Y4mp0W3rzG/falconpl-0.9.2/core/engine/core_module/stringstream_ext.cpp --- falconpl-0.9.1.8/core/engine/core_module/stringstream_ext.cpp 2009-03-15 15:02:51.000000000 +0000 +++ falconpl-0.9.2/core/engine/core_module/stringstream_ext.cpp 2009-06-19 12:01:44.000000000 +0100 @@ -23,9 +23,6 @@ #include #include -/*# - -*/ namespace Falcon { namespace core { @@ -38,7 +35,7 @@ The StringStream class inherits from stream. It can be used to provide functions that are supposed to write to streams with a memory - buffer; in example, variables may be serialized on a string stream + buffer; for example, variables may be serialized on a string stream which can be then written completely on a physical stream, or sent over the network, or written in a database blob field. The reverse is of course possible: a string can be read from any source and then used to construct a diff -Nru /tmp/qLlpeOGf0f/falconpl-0.9.1.8/core/engine/core_module/table.cpp /tmp/Y4mp0W3rzG/falconpl-0.9.2/core/engine/core_module/table.cpp --- falconpl-0.9.1.8/core/engine/core_module/table.cpp 2009-03-27 22:29:11.000000000 +0000 +++ falconpl-0.9.2/core/engine/core_module/table.cpp 2009-06-19 12:01:44.000000000 +0100 @@ -55,11 +55,13 @@ // create the first table CoreArray *page = new CoreArray( vm->paramCount() ); - page->mark(vm->generation()); + //page->mark(vm->generation()); table->insertPage( vm->self().asObject(), page ); table->setCurrentPage(0); CoreObject *self = vm->self().asObject(); + self->setUserData( table ); + // now we can safely add every other row that has been passed. for (int i = 1; i < vm->paramCount(); i ++ ) @@ -77,11 +79,8 @@ return; } vi->asArray()->table( self ); - table->insertRow( vi->asArray() ); } - - self->setUserData( table ); } @@ -257,8 +256,7 @@ @raise AccessError if the table is empty. @return The first item in the table. - This method overloads the BOM method @a BOM.front. If the table - is not empty, it returns the first element. + If the table is not empty, it returns the first element (row) in the table. */ FALCON_FUNC Table_front ( ::Falcon::VMachine *vm ) { @@ -280,8 +278,7 @@ @raise AccessError if the table is empty. @return The last item in the table. - This method overloads the BOM method @a BOM.back. If the table - is not empty, it returns the last element. + If the table is not empty, it returns the last element (row) in the table. */ FALCON_FUNC Table_back ( ::Falcon::VMachine *vm ) { @@ -491,8 +488,7 @@ column data is changed. Anyhow, the previous value is returned. Notice that the column data of an existing column may be nil; to know - if a column with a given name exists, use the @a Table.column method. - + if a column with a given name exists, use the @a Table.columnPos method. */ FALCON_FUNC Table_columnData ( ::Falcon::VMachine *vm ) @@ -533,7 +529,7 @@ also, it inherits all the table clumns, that can be accessed as bindings with the dot accessor and will resolve in one of the element in the array. - In case of success, through the BOM method @a BOM.tabRow it is possible to retreive + In case of success, through the BOM method @a Array.tabRow it is possible to retreive the table row position of the returned array. */ FALCON_FUNC Table_find ( ::Falcon::VMachine *vm ) @@ -1094,7 +1090,7 @@ @optparam offer Offer column (number or name). @optparam rows Range of rows in which to perform the bidding. @return The winning row, or the coresponding value in the offer column. - @return AccessError if the table or ranges are empty. + @raise AccessError if the table or ranges are empty. This method calls iteratively all the items in a determined column of the table, recording their return value, which must be numeric. It is @@ -1229,12 +1225,12 @@ if ( i_data == 0 ) { CoreArray* page = new CoreArray; - page->mark( vm->generation() ); + //page->mark( vm->generation() ); table->insertPage( vm->self().asObject(), page, pos ); } else { CoreArray* page = i_data->asArray()->clone(); - page->mark( vm->generation() ); + //page->mark( vm->generation() ); if ( ! table->insertPage( vm->self().asObject(), page, pos ) ) { vm->raiseModError( new ParamError( ErrorParam( e_param_type, __LINE__ ) diff -Nru /tmp/qLlpeOGf0f/falconpl-0.9.1.8/core/engine/core_module/time_ext.cpp /tmp/Y4mp0W3rzG/falconpl-0.9.2/core/engine/core_module/time_ext.cpp --- falconpl-0.9.1.8/core/engine/core_module/time_ext.cpp 2009-05-15 17:28:20.000000000 +0100 +++ falconpl-0.9.2/core/engine/core_module/time_ext.cpp 2009-06-20 00:08:37.000000000 +0100 @@ -28,10 +28,6 @@ #include #include -/*# - -*/ - namespace Falcon { namespace core { @@ -42,7 +38,7 @@ The TimeStamp class can be used to retrieve the system time and date. It is also used by other entities in the RTL to return informations - about the date (i.e. the @a FileReadStats ). + about the date (i.e. the @a FileStat). @prop year Timestamp year, absolute value. @prop month Month of the year, starting from 1. @@ -56,6 +52,7 @@ /*# @init TimeStamp + @brief Intializes the time stamp. The instance is created empty and unset, unless the @b date parameter is provided. In that case, the new instance is copied from a previously @@ -445,7 +442,7 @@ shift between the @a TimeStamp.timezone member and the @b zone parameter. After the shift is performed, the new zone is set in the timezone property of this object. - In example, to convert the local time in GMT: + For example, to convert the local time in GMT: @code now = CurrentTime() > "Local time: ", now @@ -457,7 +454,7 @@ it is possible to set an arbitrary time and timezone by normal assignment, and then convert it to another time zone using this method. - In example: + For example: @code a_gmt_time = decodeTime( "..." ) // let's say we know the timestamp is GMT. diff -Nru /tmp/qLlpeOGf0f/falconpl-0.9.1.8/core/engine/core_module/tokenizer_ext.cpp /tmp/Y4mp0W3rzG/falconpl-0.9.2/core/engine/core_module/tokenizer_ext.cpp --- falconpl-0.9.1.8/core/engine/core_module/tokenizer_ext.cpp 2009-03-22 19:15:02.000000000 +0000 +++ falconpl-0.9.2/core/engine/core_module/tokenizer_ext.cpp 2009-06-19 12:01:44.000000000 +0100 @@ -167,7 +167,7 @@ @raise IoError on errors on the underlying stream. @raise CodeError if called on an unprepared Tokenizer. - This method is actually a combination of @a Tokenizer.next followed by @a Tokenizer.current. + This method is actually a combination of @a Tokenizer.next followed by @a Tokenizer.token. Sample usage: @code @@ -203,17 +203,17 @@ @raise CodeError if called on an unprepared Tokenizer. Contrarily to iterators, it is necessary to call this method at least once - before @a Tokenizer.current is available. + before @a Tokenizer.token is available. For example: @code t = Tokenizer( source|"A string to be tokenized" ) while t.next() - > "Token: ", t.current() + > "Token: ", t.token() end @endcode - @see Tokenizer.current + @see Tokenizer.token */ FALCON_FUNC Tokenizer_next ( ::Falcon::VMachine *vm ) diff -Nru /tmp/qLlpeOGf0f/falconpl-0.9.1.8/core/engine/core_module/transcode_ext.cpp /tmp/Y4mp0W3rzG/falconpl-0.9.2/core/engine/core_module/transcode_ext.cpp --- falconpl-0.9.1.8/core/engine/core_module/transcode_ext.cpp 2009-03-21 09:39:15.000000000 +0000 +++ falconpl-0.9.2/core/engine/core_module/transcode_ext.cpp 2009-06-19 12:01:44.000000000 +0100 @@ -25,14 +25,9 @@ #include #include "core_module.h" -/*# - -*/ - namespace Falcon { namespace core { - /*# @funset core_transcoding_functions Transcoding functions @brief Functions needed to transcode texts into various character sets. diff -Nru /tmp/qLlpeOGf0f/falconpl-0.9.1.8/core/engine/core_module/uri_ext.cpp /tmp/Y4mp0W3rzG/falconpl-0.9.2/core/engine/core_module/uri_ext.cpp --- falconpl-0.9.1.8/core/engine/core_module/uri_ext.cpp 2009-05-09 15:28:45.000000000 +0100 +++ falconpl-0.9.2/core/engine/core_module/uri_ext.cpp 2009-06-19 12:01:44.000000000 +0100 @@ -26,10 +26,6 @@ #include #include -/*# - -*/ - namespace Falcon { namespace core { @@ -48,7 +44,7 @@ URI elements. Setting the properties in this class immediately reflects on the - related fields; in example setting the value of the @b uri + related fields; for example setting the value of the @b uri property causes a complete re-parse of the item; setting a field as the query string will cause the uri to change. @@ -56,7 +52,7 @@ a ParseError if conformance of the URI object is broken. @prop scheme URI scheme. - @prop userInfo User, password or account specification preceding '@' host. + @prop userInfo User, password or account specification preceding '\@' host. @prop host Host specificator. @prop port Optional port specificator (following the host after a ':'). @prop path Path specificator. diff -Nru /tmp/qLlpeOGf0f/falconpl-0.9.1.8/core/engine/core_module/vminfo_ext.cpp /tmp/Y4mp0W3rzG/falconpl-0.9.2/core/engine/core_module/vminfo_ext.cpp --- falconpl-0.9.1.8/core/engine/core_module/vminfo_ext.cpp 2009-05-18 15:08:40.000000000 +0100 +++ falconpl-0.9.2/core/engine/core_module/vminfo_ext.cpp 2009-06-19 12:01:44.000000000 +0100 @@ -25,13 +25,12 @@ @brief Generic informations on the Virtual Machine. This functions are meant to provide minimal informations about the - virtual machine and its configuration. In example, they provide + virtual machine and its configuration. For example, they provide the VM version number and target architectures. */ /*# @function vmVersionInfo - @ingroup vminfo @inset vminfo @brief Returns an array containing VM version informations. @return Major, minor and revision numbers of the running virtual machine in a 3 elements array. @@ -47,7 +46,6 @@ /*# @function vmModuleVersionInfo - @ingroup vminfo @inset vminfo @brief Returns an array containing current module version informations. @return Major, minor and revision numbers of the curerntly being executed module, @@ -77,7 +75,6 @@ /*# @function vmVersionName - @ingroup vminfo @inset vminfo @brief Returns the nickname for this VM version. @return A string containing the symbolic name of this VM version. @@ -90,7 +87,6 @@ /*# @function vmSystemType - @ingroup vminfo @inset vminfo @brief Returns a descriptive name of the overall system architecture. @return A string containing a small descriptiuon of the system architecture. @@ -106,7 +102,6 @@ /*# @function vmIsMain - @ingroup vminfo @inset vminfo @brief Returns true if the calling module is the main module of the application. @return True if the calling module is the main module. @@ -118,7 +113,7 @@ to be executed at link time and a part that is menat to be executed only if the module is directly loaded and executed. - In example: + For example: @code // executes this at link time prtcode = printl @@ -152,7 +147,6 @@ /*# @function vmFalconPath - @ingroup vminfo @inset vminfo @brief Returns default system path for Falcon load requests. @return The default compiled-in load path, or the value of the @@ -176,7 +170,6 @@ /*# @function vmSearchPath - @ingroup vminfo @inset vminfo @brief Returns the application specific load path. @return A module search path as set by the application when creating the virtual machine. @@ -194,7 +187,6 @@ /*# @function vmModuleName - @ingroup vminfo @inset vminfo @brief Returns the logical name of this module. @return Logical name of this module. @@ -215,7 +207,6 @@ /* @function vmModulePath - @ingroup vminfo @inset vminfo @brief Returns the phisical path (complete URI) from which this module was loaded. @return A string representing the load URI that individuates this module. @@ -231,7 +222,6 @@ /* @function vmRelativePath - @ingroup vminfo @inset vminfo @param path A relative (or absolute) path to a target file. @brief Relativize the URI of a given file to the path of the current module. diff -Nru /tmp/qLlpeOGf0f/falconpl-0.9.1.8/core/engine/coretable.cpp /tmp/Y4mp0W3rzG/falconpl-0.9.2/core/engine/coretable.cpp --- falconpl-0.9.1.8/core/engine/coretable.cpp 2009-04-14 23:20:37.000000000 +0100 +++ falconpl-0.9.2/core/engine/coretable.cpp 2009-06-19 12:01:44.000000000 +0100 @@ -191,6 +191,13 @@ memFree( m_biddingVals ); m_biddingVals = 0; } + + for( uint32 i = 0; i < m_pages.size(); i++ ) + { + // allow the pages to get killed. + page(i)->mark( 1 ); + } + } bool CoreTable::setHeader( CoreArray *header ) @@ -353,6 +360,9 @@ // can't delete the only page left. return false; } + + // declare the page dead + page(pos)->mark(1); // are we going to remove the current page? if ( m_currentPageId == pos ) @@ -433,7 +443,7 @@ void CoreTable::gcMark( uint32 mark ) { uint32 i; - + // mark the header data... for ( i = 0; i < m_headerData.size(); i ++ ) { @@ -444,9 +454,17 @@ for( i = 0; i < m_pages.size(); i++ ) { CoreArray* page = *(CoreArray**)m_pages.at(i); - page->mark( mark ); + //page->mark( mark ); for ( uint32 iid = 0; iid < page->length(); ++iid ) - memPool->markItem( page->at( iid ) ); + { + CoreArray* row = page->at( iid ).asArray(); + row->mark(mark); + for( uint32 rid = 0; rid < row->length(); rid ++ ) + memPool->markItem( row->elements()[rid] ); + + if ( row->bindings() != 0 ) + memPool->markItem( SafeItem(row->bindings() ) ); + } } } diff -Nru /tmp/qLlpeOGf0f/falconpl-0.9.1.8/core/engine/dir_sys_unix.cpp /tmp/Y4mp0W3rzG/falconpl-0.9.2/core/engine/dir_sys_unix.cpp --- falconpl-0.9.1.8/core/engine/dir_sys_unix.cpp 2008-10-18 02:29:54.000000000 +0100 +++ falconpl-0.9.2/core/engine/dir_sys_unix.cpp 2009-06-19 12:01:44.000000000 +0100 @@ -271,7 +271,7 @@ return 0; } - return new DirEntry_unix( dir ); + return new DirEntry_unix( p, dir ); } void fal_closeDir( ::Falcon::DirEntry *entry ) diff -Nru /tmp/qLlpeOGf0f/falconpl-0.9.1.8/core/engine/dir_sys_win.cpp /tmp/Y4mp0W3rzG/falconpl-0.9.2/core/engine/dir_sys_win.cpp --- falconpl-0.9.1.8/core/engine/dir_sys_win.cpp 2008-10-19 15:57:16.000000000 +0100 +++ falconpl-0.9.2/core/engine/dir_sys_win.cpp 2009-06-19 12:01:44.000000000 +0100 @@ -349,7 +349,7 @@ } if ( handle != INVALID_HANDLE_VALUE ) - return new DirEntry_win( handle, dir_data ); + return new DirEntry_win( path, handle, dir_data ); fsError = GetLastError(); return 0; diff -Nru /tmp/qLlpeOGf0f/falconpl-0.9.1.8/core/engine/error.cpp /tmp/Y4mp0W3rzG/falconpl-0.9.2/core/engine/error.cpp --- falconpl-0.9.1.8/core/engine/error.cpp 2009-04-05 02:35:29.000000000 +0100 +++ falconpl-0.9.2/core/engine/error.cpp 2009-06-19 12:01:44.000000000 +0100 @@ -524,10 +524,13 @@ // Reflector ErrorObject::ErrorObject( const CoreClass* cls, Error *err ): - ReflectObject( cls, err ) + CRObject( cls ) { if ( err != 0 ) + { err->incref(); + setUserData( err ); + } } ErrorObject::~ErrorObject() diff -Nru /tmp/qLlpeOGf0f/falconpl-0.9.1.8/core/engine/item_co.cpp /tmp/Y4mp0W3rzG/falconpl-0.9.2/core/engine/item_co.cpp --- falconpl-0.9.1.8/core/engine/item_co.cpp 2009-05-11 10:58:57.000000000 +0100 +++ falconpl-0.9.2/core/engine/item_co.cpp 2009-06-19 12:01:44.000000000 +0100 @@ -38,7 +38,7 @@ // Generic fail void co_fail() { - throw new TypeError( ErrorParam( e_invop ) ); + throw new TypeError( ErrorParam( e_invop ).extra( "op" ) ); } //============================================================= diff -Nru /tmp/qLlpeOGf0f/falconpl-0.9.1.8/core/engine/item.cpp /tmp/Y4mp0W3rzG/falconpl-0.9.2/core/engine/item.cpp --- falconpl-0.9.1.8/core/engine/item.cpp 2009-04-10 16:11:47.000000000 +0100 +++ falconpl-0.9.2/core/engine/item.cpp 2009-06-19 12:01:44.000000000 +0100 @@ -489,7 +489,7 @@ target.writeNumber( (int64) this->asMemBuf()->length() ); target += " words long "; target.writeNumber( (int64) this->asMemBuf()->wordSize() ); - target += "bytes }"; + target += " bytes }"; break; case FLC_ITEM_STRING: diff -Nru /tmp/qLlpeOGf0f/falconpl-0.9.1.8/core/engine/livemodule.cpp /tmp/Y4mp0W3rzG/falconpl-0.9.2/core/engine/livemodule.cpp --- falconpl-0.9.1.8/core/engine/livemodule.cpp 2009-05-18 19:09:53.000000000 +0100 +++ falconpl-0.9.2/core/engine/livemodule.cpp 2009-06-19 12:01:44.000000000 +0100 @@ -73,7 +73,9 @@ for ( i = 0; i < m_globals.size(); ++i ) { - m_globals.itemAt( i ).dereference()->setNil(); + // disengage but not dereferece; we want to nil the globals here, + // not to destroy the imported symbols. + m_globals.itemAt( i ).setNil(); } for ( i = 0; i < m_wkitems.size(); ++i ) diff -Nru /tmp/qLlpeOGf0f/falconpl-0.9.1.8/core/engine/mempool.cpp /tmp/Y4mp0W3rzG/falconpl-0.9.2/core/engine/mempool.cpp --- falconpl-0.9.1.8/core/engine/mempool.cpp 2009-05-11 10:58:57.000000000 +0100 +++ falconpl-0.9.2/core/engine/mempool.cpp 2009-06-19 12:01:44.000000000 +0100 @@ -268,6 +268,7 @@ void MemPool::clearRing( GarbageableBase *ringRoot ) { + TRACE( "Entering sweep %d, allocated %d \n", gcMemAllocated(), m_allocatedItems ); // delete the garbage ring. int32 killed = 0; GarbageableBase *ring = m_garbageRoot->nextGarbage(); @@ -314,6 +315,8 @@ fassert( killed <= m_allocatedItems ); m_allocatedItems -= killed; m_mtx_newitem.unlock(); + + TRACE( "Sweeping done, allocated %d (killed %d)\n", m_allocatedItems, killed ); } @@ -500,9 +503,9 @@ } // and also the table - if ( array->table() != 0 ) + if ( array->table() != 0 && array->table()->mark() != gen ) { - array->table()->mark( gen ); + array->table()->gcMarkData( gen ); } } } @@ -515,6 +518,8 @@ { co->gcMarkData( gen ); } + else + co = 0; } break; diff -Nru /tmp/qLlpeOGf0f/falconpl-0.9.1.8/core/engine/modloader.cpp /tmp/Y4mp0W3rzG/falconpl-0.9.2/core/engine/modloader.cpp --- falconpl-0.9.1.8/core/engine/modloader.cpp 2009-05-18 15:08:40.000000000 +0100 +++ falconpl-0.9.2/core/engine/modloader.cpp 2009-06-19 12:01:44.000000000 +0100 @@ -354,7 +354,7 @@ throw new CodeError( ErrorParam( e_unknown_vfs ) .extra( uri.scheme() ) .origin( e_orig_loader ) - .module( "(loader)" ) ); + ); } // Check wether we have absolute files or files to be searched. @@ -376,7 +376,7 @@ .extra( Engine::getMessage( msg_io_curdir ) ) .origin( e_orig_loader ) .sysError( error ) - .module( "(loader)" ) ); + ); } origUri.path( curdir + "/" + origUri.path() ); } @@ -517,7 +517,7 @@ throw new CodeError( ErrorParam( e_malformed_uri ) .extra( module_path ) .origin( e_orig_loader ) - .module( "(loader)" ) ); + ); } return loadFile( origUri, type, scan ); @@ -804,7 +804,6 @@ .extra( expl ) .origin( e_orig_loader ) .sysError( fsError ) - .module( "(loader)" ) ); } diff -Nru /tmp/qLlpeOGf0f/falconpl-0.9.1.8/core/engine/runtime.cpp /tmp/Y4mp0W3rzG/falconpl-0.9.2/core/engine/runtime.cpp --- falconpl-0.9.1.8/core/engine/runtime.cpp 2009-04-19 11:38:27.000000000 +0100 +++ falconpl-0.9.2/core/engine/runtime.cpp 2009-06-19 12:01:44.000000000 +0100 @@ -110,7 +110,8 @@ } catch( Error* e) { - e->module( mod->path() ); + if ( e->module() == "" ) + e->module( mod->path() ); delete dep; throw e; } diff -Nru /tmp/qLlpeOGf0f/falconpl-0.9.1.8/core/engine/src_lexer.cpp /tmp/Y4mp0W3rzG/falconpl-0.9.2/core/engine/src_lexer.cpp --- falconpl-0.9.1.8/core/engine/src_lexer.cpp 2009-05-19 12:02:04.000000000 +0100 +++ falconpl-0.9.2/core/engine/src_lexer.cpp 2009-06-20 14:21:08.000000000 +0100 @@ -208,7 +208,7 @@ // and break from the loop so to return the string to print. break; } - else if ( chr == ' ' || chr == '\t' || chr == '\r' || chr == '\n' ) + else if ( chr == ' ' || chr == '\t' || chr == '\n' ) { // reset lead chars and eventually remove last \n m_whiteLead.size(0); @@ -282,7 +282,7 @@ break; case e_escL: - if ( chr == ' ' || chr == '\t' || chr == '\r' || chr == '\n') + if ( chr == ' ' || chr == '\t' || chr == '\n') { // reset lead chars and eventually remove last \n m_whiteLead.size(0); @@ -455,6 +455,10 @@ m_character++; + // Totally ignore '\r' + if ( chr == '\r' ) + continue; + switch ( m_state ) { case e_line: @@ -497,7 +501,7 @@ { uint32 nextChr; // we'll begin to read a string. - if ( m_in->readAhead( nextChr ) && nextChr == '\n' ) + if ( readAhead( nextChr ) && nextChr == '\n' ) { m_mlString = true; m_line++; @@ -635,7 +639,7 @@ else if ( chr == '*' ) { uint32 nextChr; - m_in->readAhead( nextChr ); + readAhead( nextChr ); if ( nextChr == '/' ) { m_in->discardReadAhead( nextChr ); @@ -650,7 +654,7 @@ { // a method on a number? uint32 nextChr; - if ( m_in->readAhead( nextChr ) && (nextChr < '0' || nextChr > '9') ) + if ( readAhead( nextChr ) && (nextChr < '0' || nextChr > '9') ) { // end m_in->unget( chr ); @@ -880,7 +884,7 @@ else if ( chr == '\'' ) { uint32 nextChar; - if ( m_in->readAhead( nextChar ) && nextChar == '\'' ) + if ( readAhead( nextChar ) && nextChar == '\'' ) { m_string.append( '\'' ); m_in->discardReadAhead(1); @@ -903,7 +907,7 @@ if ( chr == '\\' ) { uint32 nextChar; - m_in->readAhead( nextChar ); + readAhead( nextChar ); switch ( nextChar ) { case '\\': nextChar = '\\'; break; @@ -1094,7 +1098,7 @@ { // don't return at next eol: uint32 nextChr; - if ( ! m_in->readAhead( nextChr ) ) + if ( ! readAhead( nextChr ) ) { // end of file; if we're in incremental mode, // declare the opening of a temporary context @@ -1110,19 +1114,6 @@ m_character = 0; m_in->discardReadAhead( 1 ); } - else if ( nextChr == '\r' ) - { - // discard next char - m_in->discardReadAhead( 1 ); - m_in->readAhead( nextChr ); - if ( nextChr == '\n' ) - { - m_previousLine = m_line; - m_line++; - m_character = 0; - m_in->discardReadAhead( 1 ); - } - } else if ( nextChr == '\\' ) { m_in->discardReadAhead( 1 ); @@ -1183,7 +1174,7 @@ { uint32 nextChr; // we'll begin to read a string. - if ( m_in->readAhead( nextChr ) && nextChr == '\n' ) + if ( readAhead( nextChr ) && nextChr == '\n' ) { m_mlString = true; m_line++; @@ -1203,7 +1194,7 @@ { uint32 nextChr; // we'll begin to read a string. - if ( m_in->readAhead( nextChr ) && nextChr == '\n' ) + if ( readAhead( nextChr ) && nextChr == '\n' ) { m_mlString = true; m_line++; @@ -1221,7 +1212,7 @@ { uint32 nextChr; // we'll begin to read a string. - if ( m_in->readAhead( nextChr ) && nextChr == '\n' ) + if ( readAhead( nextChr ) && nextChr == '\n' ) { m_mlString = true; m_line++; @@ -1239,7 +1230,7 @@ { uint32 nextChr; // we'll begin to read a string. - if ( m_in->readAhead( nextChr ) && nextChr == '\n' ) + if ( readAhead( nextChr ) && nextChr == '\n' ) { m_mlString = true; m_line++; @@ -1930,6 +1921,18 @@ ( m_topCtx->m_ct == ct_round || m_topCtx->m_ct == ct_square ); } +bool SrcLexer::readAhead( uint32 &chr ) +{ + bool res; + + while( (res = m_in->readAhead( chr )) && chr == '\r' ) + { + m_in->discardReadAhead( 1 ); + } + + return res; +} + } diff -Nru /tmp/qLlpeOGf0f/falconpl-0.9.1.8/core/engine/src_parser.cpp /tmp/Y4mp0W3rzG/falconpl-0.9.2/core/engine/src_parser.cpp --- falconpl-0.9.1.8/core/engine/src_parser.cpp 2009-05-16 11:04:00.000000000 +0100 +++ falconpl-0.9.2/core/engine/src_parser.cpp 2009-06-19 12:01:44.000000000 +0100 @@ -913,25 +913,25 @@ 1444, 1449, 1461, 1470, 1477, 1485, 1490, 1498, 1503, 1508, 1513, 1533, 1552, 1557, 1562, 1567, 1581, 1586, 1591, 1596, 1601, 1609, 1615, 1627, 1632, 1640, 1641, 1645, 1649, 1653, - 1667, 1666, 1727, 1730, 1736, 1738, 1739, 1739, 1745, 1747, - 1751, 1752, 1756, 1780, 1781, 1782, 1789, 1791, 1795, 1796, - 1799, 1817, 1821, 1821, 1853, 1875, 1909, 1908, 1952, 1954, - 1958, 1959, 1964, 1971, 1971, 1980, 1979, 2046, 2047, 2053, - 2055, 2059, 2060, 2063, 2082, 2091, 2090, 2108, 2109, 2114, - 2119, 2120, 2127, 2143, 2144, 2145, 2155, 2156, 2157, 2158, - 2159, 2160, 2164, 2182, 2183, 2184, 2204, 2206, 2210, 2211, - 2212, 2213, 2214, 2215, 2216, 2217, 2243, 2244, 2261, 2262, - 2263, 2264, 2265, 2266, 2267, 2268, 2269, 2270, 2271, 2272, - 2273, 2274, 2275, 2276, 2277, 2278, 2279, 2280, 2281, 2282, - 2283, 2284, 2285, 2286, 2287, 2288, 2289, 2290, 2291, 2292, - 2293, 2294, 2295, 2296, 2297, 2298, 2299, 2300, 2302, 2307, - 2311, 2316, 2322, 2331, 2332, 2334, 2339, 2346, 2347, 2348, - 2349, 2350, 2351, 2352, 2353, 2354, 2355, 2356, 2357, 2362, - 2365, 2368, 2371, 2374, 2380, 2386, 2391, 2391, 2401, 2400, - 2444, 2443, 2495, 2496, 2500, 2507, 2508, 2512, 2520, 2519, - 2569, 2574, 2581, 2588, 2598, 2599, 2603, 2611, 2612, 2616, - 2625, 2626, 2627, 2635, 2636, 2640, 2641, 2644, 2645, 2648, - 2654, 2661, 2662 + 1667, 1666, 1729, 1732, 1738, 1740, 1741, 1741, 1747, 1749, + 1753, 1754, 1758, 1782, 1783, 1784, 1791, 1793, 1797, 1798, + 1801, 1819, 1823, 1823, 1857, 1879, 1913, 1912, 1956, 1958, + 1962, 1963, 1968, 1975, 1975, 1984, 1983, 2050, 2051, 2057, + 2059, 2063, 2064, 2067, 2086, 2095, 2094, 2112, 2113, 2118, + 2123, 2124, 2131, 2147, 2148, 2149, 2159, 2160, 2161, 2162, + 2163, 2164, 2168, 2186, 2187, 2188, 2208, 2210, 2214, 2215, + 2216, 2217, 2218, 2219, 2220, 2221, 2247, 2248, 2265, 2266, + 2267, 2268, 2269, 2270, 2271, 2272, 2273, 2274, 2275, 2276, + 2277, 2278, 2279, 2280, 2281, 2282, 2283, 2284, 2285, 2286, + 2287, 2288, 2289, 2290, 2291, 2292, 2293, 2294, 2295, 2296, + 2297, 2298, 2299, 2300, 2301, 2302, 2303, 2304, 2306, 2311, + 2315, 2320, 2326, 2335, 2336, 2338, 2343, 2350, 2351, 2352, + 2353, 2354, 2355, 2356, 2357, 2358, 2359, 2360, 2361, 2366, + 2369, 2372, 2375, 2378, 2384, 2390, 2395, 2395, 2405, 2404, + 2448, 2447, 2499, 2500, 2504, 2511, 2512, 2516, 2524, 2523, + 2573, 2578, 2585, 2592, 2602, 2603, 2607, 2615, 2616, 2620, + 2629, 2630, 2631, 2639, 2640, 2644, 2645, 2648, 2649, 2652, + 2658, 2665, 2666 }; #endif @@ -5327,44 +5327,46 @@ Falcon::StmtClass *cls = static_cast((yyval.fal_stat)); // if the class has no constructor, create one in case of inheritance. - if( cls->ctorFunction() == 0 ) + if( cls != 0 ) { - Falcon::ClassDef *cd = cls->symbol()->getClassDef(); - if ( cd->inheritance().size() != 0 ) + if ( cls->ctorFunction() == 0 ) { - COMPILER->buildCtorFor( cls ); - // COMPILER->addStatement( func ); should be done in buildCtorFor - // cls->ctorFunction( func ); idem + Falcon::ClassDef *cd = cls->symbol()->getClassDef(); + if ( cd->inheritance().size() != 0 ) + { + COMPILER->buildCtorFor( cls ); + // COMPILER->addStatement( func ); should be done in buildCtorFor + // cls->ctorFunction( func ); idem + } } + COMPILER->popContext(); + //We didn't pushed a context set + COMPILER->popFunction(); } - - COMPILER->popContext(); - //We didn't pushed a context set - COMPILER->popFunction(); } break; case 263: -#line 1731 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" +#line 1733 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" { COMPILER->raiseError(Falcon::e_syn_class ); } break; case 266: -#line 1739 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" +#line 1741 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" { COMPILER->tempLine( CURRENT_LINE ); } break; case 267: -#line 1740 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" +#line 1742 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" { COMPILER->raiseContextError(Falcon::e_syn_class, COMPILER->tempLine(), CTX_LINE ); } break; case 272: -#line 1757 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" +#line 1759 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" { Falcon::StmtClass *cls = static_cast( COMPILER->getContext() ); // creates or find the symbol. @@ -5387,31 +5389,31 @@ break; case 273: -#line 1780 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" +#line 1782 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" { (yyval.fal_val) = 0; } break; case 274: -#line 1781 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" +#line 1783 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" { (yyval.fal_val)=0; } break; case 275: -#line 1783 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" +#line 1785 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" { (yyval.fal_val) = (yyvsp[(2) - (3)].fal_adecl) == 0 ? 0 : new Falcon::Value( (yyvsp[(2) - (3)].fal_adecl) ); } break; case 279: -#line 1796 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" +#line 1798 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" { COMPILER->addFunction( (yyvsp[(1) - (1)].fal_stat) ); } break; case 280: -#line 1799 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" +#line 1801 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" { Falcon::StmtClass *cls = static_cast( COMPILER->getContext() ); if ( cls->initGiven() ) { @@ -5433,7 +5435,7 @@ break; case 282: -#line 1821 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" +#line 1823 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" { Falcon::StmtClass *cls = static_cast( COMPILER->getContext() ); if( cls->initGiven() ) { @@ -5449,6 +5451,7 @@ // prepare the statement allocation context COMPILER->pushContext( func ); + COMPILER->pushFunctionContext( func ); COMPILER->pushContextSet( &func->statements() ); COMPILER->pushFunction( func->symbol()->getFuncDef() ); } @@ -5456,16 +5459,17 @@ break; case 283: -#line 1845 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" +#line 1848 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" { COMPILER->popContext(); COMPILER->popContextSet(); COMPILER->popFunction(); + COMPILER->popFunctionContext(); } break; case 284: -#line 1854 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" +#line 1858 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" { COMPILER->checkLocalUndefined(); Falcon::StmtClass *cls = static_cast( COMPILER->getContext() ); @@ -5489,7 +5493,7 @@ break; case 285: -#line 1876 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" +#line 1880 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" { COMPILER->checkLocalUndefined(); Falcon::StmtClass *cls = static_cast( COMPILER->getContext() ); @@ -5517,7 +5521,7 @@ break; case 286: -#line 1909 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" +#line 1913 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" { Falcon::ClassDef *def = new Falcon::ClassDef; // the SYMBOL which names the function goes in the old symbol table, while the parameters @@ -5551,7 +5555,7 @@ break; case 287: -#line 1943 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" +#line 1947 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" { (yyval.fal_stat) = COMPILER->getContext(); @@ -5562,21 +5566,21 @@ break; case 291: -#line 1960 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" +#line 1964 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" { COMPILER->addEnumerator( *(yyvsp[(1) - (4)].stringp), (yyvsp[(3) - (4)].fal_val) ); } break; case 292: -#line 1965 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" +#line 1969 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" { COMPILER->addEnumerator( *(yyvsp[(1) - (2)].stringp) ); } break; case 295: -#line 1980 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" +#line 1984 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" { Falcon::ClassDef *def = new Falcon::ClassDef; // the SYMBOL which names the function goes in the old symbol table, while the parameters @@ -5616,7 +5620,7 @@ break; case 296: -#line 2020 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" +#line 2024 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" { (yyval.fal_stat) = COMPILER->getContext(); Falcon::StmtClass *cls = static_cast((yyval.fal_stat)); @@ -5643,21 +5647,21 @@ break; case 298: -#line 2048 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" +#line 2052 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" { COMPILER->raiseError(Falcon::e_syn_object ); } break; case 302: -#line 2060 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" +#line 2064 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" { COMPILER->addFunction( (yyvsp[(1) - (1)].fal_stat) ); } break; case 303: -#line 2063 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" +#line 2067 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" { Falcon::StmtClass *cls = static_cast( COMPILER->getContext() ); if ( cls->initGiven() ) { @@ -5680,7 +5684,7 @@ break; case 305: -#line 2091 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" +#line 2095 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" { Falcon::StmtGlobal *glob = new Falcon::StmtGlobal( CURRENT_LINE ); COMPILER->pushContext( glob ); @@ -5688,7 +5692,7 @@ break; case 306: -#line 2096 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" +#line 2100 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" { // raise an error if we are not in a local context if ( ! COMPILER->isLocalContext() ) @@ -5701,28 +5705,28 @@ break; case 308: -#line 2110 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" +#line 2114 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" { COMPILER->raiseError( Falcon::e_syn_global ); } break; case 309: -#line 2115 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" +#line 2119 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" { COMPILER->raiseError( Falcon::e_syn_global ); } break; case 311: -#line 2121 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" +#line 2125 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" { COMPILER->raiseError( Falcon::e_syn_global ); } break; case 312: -#line 2128 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" +#line 2132 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" { // we create (or retrieve) a globalized symbol Falcon::Symbol *sym = COMPILER->globalize( (yyvsp[(1) - (1)].stringp) ); @@ -5734,52 +5738,52 @@ break; case 313: -#line 2143 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" +#line 2147 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" { (yyval.fal_stat) = new Falcon::StmtReturn(LINE, 0); } break; case 314: -#line 2144 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" +#line 2148 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" { (yyval.fal_stat) = new Falcon::StmtReturn( LINE, (yyvsp[(2) - (3)].fal_val) ); } break; case 315: -#line 2145 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" +#line 2149 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" { COMPILER->raiseError(Falcon::e_syn_return ); (yyval.fal_stat) = 0; } break; case 316: -#line 2155 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" +#line 2159 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" { (yyval.fal_val) = new Falcon::Value(); } break; case 317: -#line 2156 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" +#line 2160 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" { (yyval.fal_val) = new Falcon::Value( true ); } break; case 318: -#line 2157 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" +#line 2161 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" { (yyval.fal_val) = new Falcon::Value( false ); } break; case 319: -#line 2158 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" +#line 2162 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" { (yyval.fal_val) = new Falcon::Value( (yyvsp[(1) - (1)].integer) ); } break; case 320: -#line 2159 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" +#line 2163 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" { (yyval.fal_val) = new Falcon::Value( (yyvsp[(1) - (1)].numeric) ); } break; case 321: -#line 2160 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" +#line 2164 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" { (yyval.fal_val) = new Falcon::Value( (yyvsp[(1) - (1)].stringp) ); } break; case 322: -#line 2165 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" +#line 2169 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" { Falcon::Value *val; Falcon::Symbol *sym = COMPILER->searchLocalSymbol( (yyvsp[(1) - (1)].stringp) ); @@ -5797,12 +5801,12 @@ break; case 324: -#line 2183 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" +#line 2187 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" { (yyval.fal_val) = new Falcon::Value(); (yyval.fal_val)->setSelf(); } break; case 325: -#line 2184 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" +#line 2188 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" { Falcon::StmtFunction *sfunc = COMPILER->getFunctionContext(); if ( sfunc == 0 ) { @@ -5817,32 +5821,32 @@ break; case 330: -#line 2212 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" +#line 2216 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" { (yyval.fal_val) = new Falcon::Value(); (yyval.fal_val)->setLBind( (yyvsp[(2) - (2)].stringp) ); /* do not add the symbol to the compiler */ } break; case 331: -#line 2213 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" +#line 2217 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" { char space[32]; sprintf(space, "%d", (int)(yyvsp[(2) - (2)].integer) ); (yyval.fal_val) = new Falcon::Value(); (yyval.fal_val)->setLBind( COMPILER->addString(space) ); } break; case 332: -#line 2214 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" +#line 2218 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" { (yyval.fal_val) = new Falcon::Value(); (yyval.fal_val)->setLBind( COMPILER->addString("self") ); /* do not add the symbol to the compiler */ } break; case 333: -#line 2215 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" +#line 2219 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" { (yyval.fal_val) = new Falcon::Value( new Falcon::Expression( Falcon::Expression::t_neg, (yyvsp[(2) - (2)].fal_val) ) ); } break; case 334: -#line 2216 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" +#line 2220 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" { (yyval.fal_val) = new Falcon::Value( new Falcon::Expression( Falcon::Expression::t_fbind, new Falcon::Value((yyvsp[(1) - (3)].stringp)), (yyvsp[(3) - (3)].fal_val)) ); } break; case 335: -#line 2217 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" +#line 2221 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" { // is this an immediate string sum ? if ( (yyvsp[(1) - (4)].fal_val)->isString() ) @@ -5872,12 +5876,12 @@ break; case 336: -#line 2243 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" +#line 2247 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" { (yyval.fal_val) = new Falcon::Value( new Falcon::Expression( Falcon::Expression::t_minus, (yyvsp[(1) - (4)].fal_val), (yyvsp[(4) - (4)].fal_val) ) ); } break; case 337: -#line 2244 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" +#line 2248 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" { if ( (yyvsp[(1) - (4)].fal_val)->isString() ) { @@ -5898,177 +5902,177 @@ break; case 338: -#line 2261 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" +#line 2265 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" { (yyval.fal_val) = new Falcon::Value( new Falcon::Expression( Falcon::Expression::t_divide, (yyvsp[(1) - (4)].fal_val), (yyvsp[(4) - (4)].fal_val) ) ); } break; case 339: -#line 2262 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" +#line 2266 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" { (yyval.fal_val) = new Falcon::Value( new Falcon::Expression( Falcon::Expression::t_modulo, (yyvsp[(1) - (4)].fal_val), (yyvsp[(4) - (4)].fal_val) ) ); } break; case 340: -#line 2263 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" +#line 2267 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" { (yyval.fal_val) = new Falcon::Value( new Falcon::Expression( Falcon::Expression::t_power, (yyvsp[(1) - (4)].fal_val), (yyvsp[(4) - (4)].fal_val) ) ); } break; case 341: -#line 2264 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" +#line 2268 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" { (yyval.fal_val) = new Falcon::Value( new Falcon::Expression( Falcon::Expression::t_bin_and, (yyvsp[(1) - (4)].fal_val), (yyvsp[(4) - (4)].fal_val) ) ); } break; case 342: -#line 2265 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" +#line 2269 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" { (yyval.fal_val) = new Falcon::Value( new Falcon::Expression( Falcon::Expression::t_bin_or, (yyvsp[(1) - (4)].fal_val), (yyvsp[(4) - (4)].fal_val) ) ); } break; case 343: -#line 2266 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" +#line 2270 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" { (yyval.fal_val) = new Falcon::Value( new Falcon::Expression( Falcon::Expression::t_bin_xor, (yyvsp[(1) - (4)].fal_val), (yyvsp[(4) - (4)].fal_val) ) ); } break; case 344: -#line 2267 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" +#line 2271 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" { (yyval.fal_val) = new Falcon::Value( new Falcon::Expression( Falcon::Expression::t_shift_left, (yyvsp[(1) - (4)].fal_val), (yyvsp[(4) - (4)].fal_val) ) ); } break; case 345: -#line 2268 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" +#line 2272 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" { (yyval.fal_val) = new Falcon::Value( new Falcon::Expression( Falcon::Expression::t_shift_right, (yyvsp[(1) - (4)].fal_val), (yyvsp[(4) - (4)].fal_val) ) ); } break; case 346: -#line 2269 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" +#line 2273 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" { (yyval.fal_val) = new Falcon::Value( new Falcon::Expression( Falcon::Expression::t_bin_not, (yyvsp[(2) - (2)].fal_val) ) ); } break; case 347: -#line 2270 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" +#line 2274 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" { (yyval.fal_val) = new Falcon::Value( new Falcon::Expression( Falcon::Expression::t_neq, (yyvsp[(1) - (3)].fal_val), (yyvsp[(3) - (3)].fal_val) ) ); } break; case 348: -#line 2271 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" +#line 2275 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" { (yyval.fal_val) = new Falcon::Value( new Falcon::Expression( Falcon::Expression::t_post_inc, (yyvsp[(1) - (2)].fal_val) ) ); } break; case 349: -#line 2272 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" +#line 2276 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" { (yyval.fal_val) = new Falcon::Value( new Falcon::Expression( Falcon::Expression::t_pre_inc, (yyvsp[(2) - (2)].fal_val) ) ); } break; case 350: -#line 2273 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" +#line 2277 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" { (yyval.fal_val) = new Falcon::Value( new Falcon::Expression( Falcon::Expression::t_post_dec, (yyvsp[(1) - (2)].fal_val) ) ); } break; case 351: -#line 2274 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" +#line 2278 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" { (yyval.fal_val) = new Falcon::Value( new Falcon::Expression( Falcon::Expression::t_pre_dec, (yyvsp[(2) - (2)].fal_val) ) ); } break; case 352: -#line 2275 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" +#line 2279 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" { (yyval.fal_val) = new Falcon::Value( new Falcon::Expression( Falcon::Expression::t_eq, (yyvsp[(1) - (3)].fal_val), (yyvsp[(3) - (3)].fal_val) ) ); } break; case 353: -#line 2276 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" +#line 2280 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" { (yyval.fal_val) = new Falcon::Value( new Falcon::Expression( Falcon::Expression::t_gt, (yyvsp[(1) - (3)].fal_val), (yyvsp[(3) - (3)].fal_val) ) ); } break; case 354: -#line 2277 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" +#line 2281 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" { (yyval.fal_val) = new Falcon::Value( new Falcon::Expression( Falcon::Expression::t_lt, (yyvsp[(1) - (3)].fal_val), (yyvsp[(3) - (3)].fal_val) ) ); } break; case 355: -#line 2278 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" +#line 2282 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" { (yyval.fal_val) = new Falcon::Value( new Falcon::Expression( Falcon::Expression::t_ge, (yyvsp[(1) - (3)].fal_val), (yyvsp[(3) - (3)].fal_val) ) ); } break; case 356: -#line 2279 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" +#line 2283 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" { (yyval.fal_val) = new Falcon::Value( new Falcon::Expression( Falcon::Expression::t_le, (yyvsp[(1) - (3)].fal_val), (yyvsp[(3) - (3)].fal_val) ) ); } break; case 357: -#line 2280 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" +#line 2284 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" { (yyval.fal_val) = new Falcon::Value( new Falcon::Expression( Falcon::Expression::t_and, (yyvsp[(1) - (3)].fal_val), (yyvsp[(3) - (3)].fal_val) ) ); } break; case 358: -#line 2281 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" +#line 2285 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" { (yyval.fal_val) = new Falcon::Value( new Falcon::Expression( Falcon::Expression::t_or, (yyvsp[(1) - (3)].fal_val), (yyvsp[(3) - (3)].fal_val) ) ); } break; case 359: -#line 2282 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" +#line 2286 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" { (yyval.fal_val) = new Falcon::Value( new Falcon::Expression( Falcon::Expression::t_not, (yyvsp[(2) - (2)].fal_val) ) ); } break; case 360: -#line 2283 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" +#line 2287 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" { (yyval.fal_val) = new Falcon::Value( new Falcon::Expression( Falcon::Expression::t_in, (yyvsp[(1) - (3)].fal_val), (yyvsp[(3) - (3)].fal_val) ) ); } break; case 361: -#line 2284 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" +#line 2288 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" { (yyval.fal_val) = new Falcon::Value( new Falcon::Expression( Falcon::Expression::t_notin, (yyvsp[(1) - (3)].fal_val), (yyvsp[(3) - (3)].fal_val) ) ); } break; case 362: -#line 2285 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" +#line 2289 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" { (yyval.fal_val) = new Falcon::Value( new Falcon::Expression( Falcon::Expression::t_provides, (yyvsp[(1) - (3)].fal_val), new Falcon::Value( (yyvsp[(3) - (3)].stringp) ) ) ); } break; case 363: -#line 2286 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" +#line 2290 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" { (yyval.fal_val) = new Falcon::Value( (yyvsp[(2) - (2)].fal_val) ); } break; case 364: -#line 2287 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" +#line 2291 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" { (yyval.fal_val) = new Falcon::Value( (Falcon::Value *) 0 ); } break; case 365: -#line 2288 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" +#line 2292 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" { (yyval.fal_val) = new Falcon::Value( new Falcon::Expression( Falcon::Expression::t_strexpand, (yyvsp[(2) - (2)].fal_val) ) ); } break; case 366: -#line 2289 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" +#line 2293 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" { (yyval.fal_val) = new Falcon::Value( new Falcon::Expression( Falcon::Expression::t_indirect, (yyvsp[(2) - (2)].fal_val) ) ); } break; case 367: -#line 2290 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" +#line 2294 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" { (yyval.fal_val) = new Falcon::Value( new Falcon::Expression( Falcon::Expression::t_eval, (yyvsp[(2) - (2)].fal_val) ) ); } break; case 368: -#line 2291 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" +#line 2295 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" { (yyval.fal_val) = new Falcon::Value( new Falcon::Expression( Falcon::Expression::t_oob, (yyvsp[(2) - (2)].fal_val) ) ); } break; case 369: -#line 2292 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" +#line 2296 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" { (yyval.fal_val) = new Falcon::Value( new Falcon::Expression( Falcon::Expression::t_deoob, (yyvsp[(2) - (2)].fal_val) ) ); } break; case 370: -#line 2293 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" +#line 2297 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" { (yyval.fal_val) = new Falcon::Value( new Falcon::Expression( Falcon::Expression::t_isoob, (yyvsp[(2) - (2)].fal_val) ) ); } break; case 371: -#line 2294 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" +#line 2298 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" { (yyval.fal_val) = new Falcon::Value( new Falcon::Expression( Falcon::Expression::t_xoroob, (yyvsp[(2) - (2)].fal_val) ) ); } break; case 378: -#line 2302 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" +#line 2306 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" { Falcon::Expression *exp = new Falcon::Expression( Falcon::Expression::t_array_access, (yyvsp[(1) - (2)].fal_val), (yyvsp[(2) - (2)].fal_val) ); (yyval.fal_val) = new Falcon::Value( exp ); @@ -6076,14 +6080,14 @@ break; case 379: -#line 2307 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" +#line 2311 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" { (yyval.fal_val) = new Falcon::Value( (yyvsp[(1) - (1)].fal_adecl) ); } break; case 380: -#line 2311 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" +#line 2315 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" { Falcon::Expression *exp = new Falcon::Expression( Falcon::Expression::t_array_access, (yyvsp[(1) - (4)].fal_val), (yyvsp[(3) - (4)].fal_val) ); (yyval.fal_val) = new Falcon::Value( exp ); @@ -6091,7 +6095,7 @@ break; case 381: -#line 2316 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" +#line 2320 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" { Falcon::Expression *exp = new Falcon::Expression( Falcon::Expression::t_array_byte_access, (yyvsp[(1) - (5)].fal_val), (yyvsp[(4) - (5)].fal_val) ); (yyval.fal_val) = new Falcon::Value( exp ); @@ -6099,7 +6103,7 @@ break; case 382: -#line 2322 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" +#line 2326 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" { Falcon::Expression *exp = new Falcon::Expression( Falcon::Expression::t_obj_access, (yyvsp[(1) - (3)].fal_val), new Falcon::Value( (yyvsp[(3) - (3)].stringp) ) ); if ( (yyvsp[(3) - (3)].stringp)->getCharAt(0) == '_' && ! (yyvsp[(1) - (3)].fal_val)->isSelf() ) @@ -6111,7 +6115,7 @@ break; case 385: -#line 2334 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" +#line 2338 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" { COMPILER->defineVal( (yyvsp[(1) - (3)].fal_val) ); (yyval.fal_val) = new Falcon::Value( new Falcon::Expression( Falcon::Expression::t_assign, (yyvsp[(1) - (3)].fal_val), (yyvsp[(3) - (3)].fal_val) ) ); @@ -6119,7 +6123,7 @@ break; case 386: -#line 2339 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" +#line 2343 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" { COMPILER->defineVal( (yyvsp[(1) - (5)].fal_val) ); (yyvsp[(5) - (5)].fal_adecl)->pushFront( (yyvsp[(3) - (5)].fal_val) ); @@ -6129,102 +6133,102 @@ break; case 387: -#line 2346 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" +#line 2350 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" { (yyval.fal_val) = new Falcon::Value( new Falcon::Expression( Falcon::Expression::t_aadd, (yyvsp[(1) - (3)].fal_val), (yyvsp[(3) - (3)].fal_val) ) ); } break; case 388: -#line 2347 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" +#line 2351 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" { (yyval.fal_val) = new Falcon::Value( new Falcon::Expression( Falcon::Expression::t_asub, (yyvsp[(1) - (3)].fal_val), (yyvsp[(3) - (3)].fal_val) ) ); } break; case 389: -#line 2348 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" +#line 2352 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" { (yyval.fal_val) = new Falcon::Value( new Falcon::Expression( Falcon::Expression::t_amul, (yyvsp[(1) - (3)].fal_val), (yyvsp[(3) - (3)].fal_val) ) ); } break; case 390: -#line 2349 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" +#line 2353 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" { (yyval.fal_val) = new Falcon::Value( new Falcon::Expression( Falcon::Expression::t_adiv, (yyvsp[(1) - (3)].fal_val), (yyvsp[(3) - (3)].fal_val) ) ); } break; case 391: -#line 2350 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" +#line 2354 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" { (yyval.fal_val) = new Falcon::Value( new Falcon::Expression( Falcon::Expression::t_amod, (yyvsp[(1) - (3)].fal_val), (yyvsp[(3) - (3)].fal_val) ) ); } break; case 392: -#line 2351 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" +#line 2355 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" { (yyval.fal_val) = new Falcon::Value( new Falcon::Expression( Falcon::Expression::t_apow, (yyvsp[(1) - (3)].fal_val), (yyvsp[(3) - (3)].fal_val) ) ); } break; case 393: -#line 2352 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" +#line 2356 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" { (yyval.fal_val) = new Falcon::Value( new Falcon::Expression( Falcon::Expression::t_aband, (yyvsp[(1) - (3)].fal_val), (yyvsp[(3) - (3)].fal_val) ) ); } break; case 394: -#line 2353 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" +#line 2357 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" { (yyval.fal_val) = new Falcon::Value( new Falcon::Expression( Falcon::Expression::t_abor, (yyvsp[(1) - (3)].fal_val), (yyvsp[(3) - (3)].fal_val) ) ); } break; case 395: -#line 2354 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" +#line 2358 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" { (yyval.fal_val) = new Falcon::Value( new Falcon::Expression( Falcon::Expression::t_abxor, (yyvsp[(1) - (3)].fal_val), (yyvsp[(3) - (3)].fal_val) ) ); } break; case 396: -#line 2355 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" +#line 2359 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" { (yyval.fal_val) = new Falcon::Value( new Falcon::Expression( Falcon::Expression::t_ashl, (yyvsp[(1) - (3)].fal_val), (yyvsp[(3) - (3)].fal_val) ) ); } break; case 397: -#line 2356 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" +#line 2360 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" { (yyval.fal_val) = new Falcon::Value( new Falcon::Expression( Falcon::Expression::t_ashr, (yyvsp[(1) - (3)].fal_val), (yyvsp[(3) - (3)].fal_val) ) ); } break; case 398: -#line 2357 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" +#line 2361 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" {(yyval.fal_val)=(yyvsp[(2) - (3)].fal_val);} break; case 399: -#line 2362 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" +#line 2366 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" { (yyval.fal_val) = new Falcon::Value( new Falcon::RangeDecl( new Falcon::Value( (Falcon::int64) 0 ) ) ); } break; case 400: -#line 2365 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" +#line 2369 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" { (yyval.fal_val) = new Falcon::Value( new Falcon::RangeDecl( (yyvsp[(2) - (4)].fal_val) ) ); } break; case 401: -#line 2368 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" +#line 2372 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" { (yyval.fal_val) = new Falcon::Value( new Falcon::RangeDecl( new Falcon::Value( (Falcon::int64) 0 ), (yyvsp[(3) - (4)].fal_val) ) ); } break; case 402: -#line 2371 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" +#line 2375 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" { (yyval.fal_val) = new Falcon::Value( new Falcon::RangeDecl( (yyvsp[(2) - (5)].fal_val), (yyvsp[(4) - (5)].fal_val) ) ); } break; case 403: -#line 2374 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" +#line 2378 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" { (yyval.fal_val) = new Falcon::Value( new Falcon::RangeDecl( (yyvsp[(2) - (7)].fal_val), (yyvsp[(4) - (7)].fal_val), (yyvsp[(6) - (7)].fal_val) ) ); } break; case 404: -#line 2381 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" +#line 2385 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" { (yyval.fal_val) = new Falcon::Value( new Falcon::Expression( Falcon::Expression::t_funcall, (yyvsp[(1) - (4)].fal_val), new Falcon::Value( (yyvsp[(3) - (4)].fal_adecl) ) ) ); @@ -6232,19 +6236,19 @@ break; case 405: -#line 2387 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" +#line 2391 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" { (yyval.fal_val) = new Falcon::Value( new Falcon::Expression( Falcon::Expression::t_funcall, (yyvsp[(1) - (3)].fal_val), 0 ) ); } break; case 406: -#line 2391 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" +#line 2395 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" { COMPILER->tempLine( CURRENT_LINE ); } break; case 407: -#line 2392 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" +#line 2396 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" { delete (yyvsp[(3) - (6)].fal_adecl); COMPILER->raiseContextError(Falcon::e_syn_funcall, COMPILER->tempLine(), CTX_LINE ); @@ -6253,7 +6257,7 @@ break; case 408: -#line 2401 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" +#line 2405 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" { Falcon::FuncDef *def = new Falcon::FuncDef( 0, 0 ); // set the def as a lambda. @@ -6287,7 +6291,7 @@ break; case 409: -#line 2436 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" +#line 2440 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" { COMPILER->lexer()->popContext(); (yyval.fal_val) = COMPILER->closeClosure(); @@ -6295,7 +6299,7 @@ break; case 410: -#line 2444 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" +#line 2448 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" { Falcon::FuncDef *def = new Falcon::FuncDef( 0, 0 ); // set the def as a lambda. @@ -6328,7 +6332,7 @@ break; case 411: -#line 2478 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" +#line 2482 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" { Falcon::StatementList *stmt = COMPILER->getContextSet(); if( stmt->size() == 1 && stmt->back()->type() == Falcon::Statement::t_autoexp ) @@ -6346,35 +6350,35 @@ break; case 413: -#line 2497 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" +#line 2501 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" { COMPILER->raiseContextError(Falcon::e_syn_funcdecl, LINE, CTX_LINE ); } break; case 414: -#line 2501 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" +#line 2505 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" { COMPILER->raiseError(Falcon::e_syn_funcdecl ); } break; case 416: -#line 2509 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" +#line 2513 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" { COMPILER->raiseContextError(Falcon::e_syn_funcdecl, LINE, CTX_LINE ); } break; case 417: -#line 2513 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" +#line 2517 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" { COMPILER->raiseError(Falcon::e_syn_funcdecl ); } break; case 418: -#line 2520 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" +#line 2524 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" { Falcon::FuncDef *def = new Falcon::FuncDef( 0, 0 ); // set the def as a lambda. @@ -6407,7 +6411,7 @@ break; case 419: -#line 2554 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" +#line 2558 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" { COMPILER->lexer()->popContext(); Falcon::StmtFunction *func = static_cast(COMPILER->getContext()); @@ -6419,7 +6423,7 @@ break; case 420: -#line 2570 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" +#line 2574 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" { (yyval.fal_val) = new Falcon::Value( new Falcon::Expression( Falcon::Expression::t_iif, (yyvsp[(1) - (5)].fal_val), (yyvsp[(3) - (5)].fal_val), (yyvsp[(5) - (5)].fal_val) ) ); @@ -6427,7 +6431,7 @@ break; case 421: -#line 2575 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" +#line 2579 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" { delete (yyvsp[(1) - (5)].fal_val); delete (yyvsp[(3) - (5)].fal_val); @@ -6437,7 +6441,7 @@ break; case 422: -#line 2582 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" +#line 2586 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" { delete (yyvsp[(1) - (4)].fal_val); delete (yyvsp[(3) - (4)].fal_val); @@ -6447,7 +6451,7 @@ break; case 423: -#line 2589 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" +#line 2593 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" { delete (yyvsp[(1) - (3)].fal_val); COMPILER->raiseError(Falcon::e_syn_iif, CURRENT_LINE ); @@ -6456,19 +6460,19 @@ break; case 424: -#line 2598 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" +#line 2602 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" { (yyval.fal_adecl) = new Falcon::ArrayDecl(); } break; case 425: -#line 2600 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" +#line 2604 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" { (yyval.fal_adecl) = (yyvsp[(2) - (3)].fal_adecl); } break; case 426: -#line 2604 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" +#line 2608 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" { COMPILER->raiseContextError( Falcon::e_syn_arraydecl, CURRENT_LINE, CTX_LINE ); (yyval.fal_adecl) = (yyvsp[(2) - (3)].fal_adecl); @@ -6476,19 +6480,19 @@ break; case 427: -#line 2611 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" +#line 2615 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" { (yyval.fal_val) = new Falcon::Value( new Falcon::ArrayDecl() ); } break; case 428: -#line 2613 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" +#line 2617 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" { (yyval.fal_val) = new Falcon::Value( (yyvsp[(2) - (3)].fal_adecl) ); } break; case 429: -#line 2617 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" +#line 2621 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" { COMPILER->raiseContextError( Falcon::e_syn_arraydecl, CURRENT_LINE, CTX_LINE ); (yyval.fal_val) = new Falcon::Value( (yyvsp[(2) - (3)].fal_adecl) ); @@ -6496,17 +6500,17 @@ break; case 430: -#line 2625 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" +#line 2629 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" { (yyval.fal_val) = new Falcon::Value( new Falcon::DictDecl() ); } break; case 431: -#line 2626 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" +#line 2630 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" { (yyval.fal_val) = new Falcon::Value( (yyvsp[(2) - (3)].fal_ddecl) ); } break; case 432: -#line 2628 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" +#line 2632 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" { COMPILER->raiseContextError( Falcon::e_syn_dictdecl, LINE, CTX_LINE ); (yyval.fal_val) = new Falcon::Value( (yyvsp[(2) - (4)].fal_ddecl) ); @@ -6514,27 +6518,27 @@ break; case 433: -#line 2635 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" +#line 2639 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" { (yyval.fal_adecl) = new Falcon::ArrayDecl(); (yyval.fal_adecl)->pushBack( (yyvsp[(1) - (1)].fal_val) ); } break; case 434: -#line 2636 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" +#line 2640 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" { (yyvsp[(1) - (3)].fal_adecl)->pushBack( (yyvsp[(3) - (3)].fal_val) ); (yyval.fal_adecl) = (yyvsp[(1) - (3)].fal_adecl); } break; case 435: -#line 2640 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" +#line 2644 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" { (yyval.fal_adecl) = new Falcon::ArrayDecl(); (yyval.fal_adecl)->pushBack( (yyvsp[(1) - (1)].fal_val) ); } break; case 436: -#line 2641 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" +#line 2645 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" { (yyvsp[(1) - (3)].fal_adecl)->pushBack( (yyvsp[(3) - (3)].fal_val) ); (yyval.fal_adecl) = (yyvsp[(1) - (3)].fal_adecl); } break; case 439: -#line 2648 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" +#line 2652 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" { COMPILER->defineVal( (yyvsp[(1) - (1)].fal_val) ); Falcon::ArrayDecl *ad = new Falcon::ArrayDecl(); @@ -6544,7 +6548,7 @@ break; case 440: -#line 2654 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" +#line 2658 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" { COMPILER->defineVal( (yyvsp[(3) - (3)].fal_val) ); (yyvsp[(1) - (3)].fal_adecl)->pushBack( (yyvsp[(3) - (3)].fal_val) ); @@ -6552,18 +6556,18 @@ break; case 441: -#line 2661 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" +#line 2665 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" { (yyval.fal_ddecl) = new Falcon::DictDecl(); (yyval.fal_ddecl)->pushBack( (yyvsp[(1) - (3)].fal_val), (yyvsp[(3) - (3)].fal_val) ); } break; case 442: -#line 2662 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" +#line 2666 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" { (yyvsp[(1) - (5)].fal_ddecl)->pushBack( (yyvsp[(3) - (5)].fal_val), (yyvsp[(5) - (5)].fal_val) ); (yyval.fal_ddecl) = (yyvsp[(1) - (5)].fal_ddecl); } break; /* Line 1267 of yacc.c. */ -#line 6567 "/home/gian/Progetti/falcon/core/engine/src_parser.cpp" +#line 6571 "/home/gian/Progetti/falcon/core/engine/src_parser.cpp" default: break; } YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); @@ -6777,7 +6781,7 @@ } -#line 2666 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" +#line 2670 "/home/gian/Progetti/falcon/core/engine/src_parser.yy" /* c code */ diff -Nru /tmp/qLlpeOGf0f/falconpl-0.9.1.8/core/engine/src_parser.yy /tmp/Y4mp0W3rzG/falconpl-0.9.2/core/engine/src_parser.yy --- falconpl-0.9.1.8/core/engine/src_parser.yy 2009-05-16 11:04:00.000000000 +0100 +++ falconpl-0.9.2/core/engine/src_parser.yy 2009-06-19 12:01:44.000000000 +0100 @@ -1705,20 +1705,22 @@ Falcon::StmtClass *cls = static_cast($$); // if the class has no constructor, create one in case of inheritance. - if( cls->ctorFunction() == 0 ) + if( cls != 0 ) { - Falcon::ClassDef *cd = cls->symbol()->getClassDef(); - if ( cd->inheritance().size() != 0 ) + if ( cls->ctorFunction() == 0 ) { - COMPILER->buildCtorFor( cls ); - // COMPILER->addStatement( func ); should be done in buildCtorFor - // cls->ctorFunction( func ); idem + Falcon::ClassDef *cd = cls->symbol()->getClassDef(); + if ( cd->inheritance().size() != 0 ) + { + COMPILER->buildCtorFor( cls ); + // COMPILER->addStatement( func ); should be done in buildCtorFor + // cls->ctorFunction( func ); idem + } } + COMPILER->popContext(); + //We didn't pushed a context set + COMPILER->popFunction(); } - - COMPILER->popContext(); - //We didn't pushed a context set - COMPILER->popFunction(); } ; @@ -1833,6 +1835,7 @@ // prepare the statement allocation context COMPILER->pushContext( func ); + COMPILER->pushFunctionContext( func ); COMPILER->pushContextSet( &func->statements() ); COMPILER->pushFunction( func->symbol()->getFuncDef() ); } @@ -1846,6 +1849,7 @@ COMPILER->popContext(); COMPILER->popContextSet(); COMPILER->popFunction(); + COMPILER->popFunctionContext(); } ; diff -Nru /tmp/qLlpeOGf0f/falconpl-0.9.1.8/core/engine/string.cpp /tmp/Y4mp0W3rzG/falconpl-0.9.2/core/engine/string.cpp --- falconpl-0.9.1.8/core/engine/string.cpp 2009-05-08 23:14:25.000000000 +0100 +++ falconpl-0.9.2/core/engine/string.cpp 2009-06-20 14:31:21.000000000 +0100 @@ -121,6 +121,7 @@ return str->size() / charSize(); } + uint32 Byte::getCharAt( const String *str, uint32 pos ) const { return (uint32) str->getRawStorage()[pos]; @@ -2163,7 +2164,6 @@ // unrecognized pattern, protocol error return false; } - chr |= (in & 0x3f) << count; } @@ -2175,6 +2175,64 @@ return true; } +bool String::startsWith( const String &str, bool icase ) const +{ + uint32 len = str.length(); + if ( len > length() ) return false; + + if ( icase ) + { + for ( uint32 i = 0; i < len; i ++ ) + { + uint32 chr1, chr2; + if ( (chr1 = str.getCharAt(i)) != (chr2 = getCharAt(i)) ) + { + if ( chr1 >= 'A' && chr1 <= 'z' && (chr1 | 0x20) != (chr2|0x20) ) + return false; + } + } + } + else + { + for ( uint32 i = 0; i < len; i ++ ) + if ( str.getCharAt(i) != getCharAt(i) ) + return false; + } + + return true; +} + + +bool String::endsWith( const String &str, bool icase ) const +{ + uint32 len = str.length(); + uint32 mlen = length(); + uint32 start = mlen-len; + + if ( len > mlen ) return false; + + if ( icase ) + { + for ( uint32 i = 0; i < len; ++i ) + { + uint32 chr1, chr2; + if ( (chr1 = str.getCharAt(i)) != (chr2 = getCharAt(i+start)) ) + { + if ( chr1 >= 'A' && chr1 <= 'z' && (chr1 | 0x20) != (chr2|0x20) ) + return false; + } + } + } + else + { + for ( uint32 i = 0; i < len; ++i ) + if ( str.getCharAt(i) != getCharAt(i+start) ) + return false; + } + + return true; +} + //============================================================ void string_deletor( void *data ) { diff -Nru /tmp/qLlpeOGf0f/falconpl-0.9.1.8/core/engine/vfs_file_unix.cpp /tmp/Y4mp0W3rzG/falconpl-0.9.2/core/engine/vfs_file_unix.cpp --- falconpl-0.9.1.8/core/engine/vfs_file_unix.cpp 2009-03-15 15:02:51.000000000 +0000 +++ falconpl-0.9.2/core/engine/vfs_file_unix.cpp 2009-06-19 12:01:44.000000000 +0100 @@ -102,7 +102,7 @@ return 0; } - return new DirEntry_unix( dir ); + return new DirEntry_unix( uri.path(), dir ); } diff -Nru /tmp/qLlpeOGf0f/falconpl-0.9.1.8/core/engine/vm.cpp /tmp/Y4mp0W3rzG/falconpl-0.9.2/core/engine/vm.cpp --- falconpl-0.9.1.8/core/engine/vm.cpp 2009-05-18 15:08:40.000000000 +0100 +++ falconpl-0.9.2/core/engine/vm.cpp 2009-06-19 12:01:44.000000000 +0100 @@ -3527,40 +3527,50 @@ void VMachine::postMessage( VMMessage *msg ) { // can we post now? - + /* if ( m_baton.tryAcquire() ) { processMessage( msg ); - execFrame(); + + try { + execFrame(); + } + catch( Error* err ) + { + // forward the error to this VM for sync management + msg = new VMMessage( "error" ); + msg->error( err ); + } + m_baton.release(); + return; } - else + */ + + // ok, we can't do it now; post the message + m_mtx_mesasges.lock(); + + if ( m_msg_head == 0 ) { - // ok, wa can't do it now; post the message - m_mtx_mesasges.lock(); + m_msg_head = msg; + } + else { + m_msg_tail->append( msg ); + } - if ( m_msg_head == 0 ) - { - m_msg_head = msg; - } - else { - m_msg_tail->append( msg ); - } + // reach the end of the msg list and set the new tail + while( msg->next() != 0 ) + msg = msg->next(); - // reach the end of the msg list and set the new tail - while( msg->next() != 0 ) - msg = msg->next(); - - m_msg_tail = msg; - - // also, ask for early checks. - // We're really not concerned about spurious reads here or in the other thread, - // everything would be ok even without this operation. It's just ok if some of - // the two threads sync on this asap. - m_opNextCheck = m_opCount; + m_msg_tail = msg; - m_mtx_mesasges.unlock(); - } + // also, ask for early checks. + // We're really not concerned about spurious reads here or in the other thread, + // everything would be ok even without this operation. It's just ok if some of + // the two threads sync on this asap. + m_opNextCheck = m_opCount; + + m_mtx_mesasges.unlock(); } void VMachine::processMessage( VMMessage *msg ) diff -Nru /tmp/qLlpeOGf0f/falconpl-0.9.1.8/core/engine/vmmsg.cpp /tmp/Y4mp0W3rzG/falconpl-0.9.2/core/engine/vmmsg.cpp --- falconpl-0.9.1.8/core/engine/vmmsg.cpp 2009-04-10 16:11:47.000000000 +0100 +++ falconpl-0.9.2/core/engine/vmmsg.cpp 2009-06-19 12:01:44.000000000 +0100 @@ -32,7 +32,8 @@ m_params(0), m_allocated(0), m_pcount(0), - m_next(0) + m_next(0), + m_error(0) { } @@ -47,6 +48,16 @@ } memFree( m_params ); } + + if ( m_error != 0 ) + m_error->decref(); +} + + +void VMMessage::error( Error* err ) +{ + err->incref(); + m_error = err; } diff -Nru /tmp/qLlpeOGf0f/falconpl-0.9.1.8/core/engine/vm_run.cpp /tmp/Y4mp0W3rzG/falconpl-0.9.2/core/engine/vm_run.cpp --- falconpl-0.9.1.8/core/engine/vm_run.cpp 2009-05-17 16:55:27.000000000 +0100 +++ falconpl-0.9.2/core/engine/vm_run.cpp 2009-06-19 12:01:44.000000000 +0100 @@ -260,9 +260,14 @@ m_msg_head = msg->next(); // it is ok if m_msg_tail is left dangling. m_mtx_mesasges.unlock(); - - processMessage( msg ); - //delete msg; + if ( msg->error() ) + { + the_error = msg->error(); + the_error->incref(); + delete msg; + } + else + processMessage( msg ); // do not delete msg // see if we have more messages in the meanwhile m_mtx_mesasges.lock(); @@ -840,7 +845,10 @@ Item *operand2 = vm->getOpcodeParam( 2 )->dereference(); if ( operand2->isString() ) + { operand1->setString( new CoreString( *operand2->asString() ) ); + operand1->flags( operand2->flags() ); + } else operand1->copy( *operand2 ); @@ -2081,7 +2089,7 @@ case FLC_ITEM_RANGE: if( source->asRangeIsOpen() || - source->asRangeEnd() == source->asRangeStart() || + (source->asRangeEnd() == source->asRangeStart() && source->asRangeStep() >= 0) || ( source->asRangeStep() > 0 && source->asRangeStart() > source->asRangeEnd() ) || ( source->asRangeStep() < 0 && source->asRangeStart() < source->asRangeEnd() ) ) diff -Nru /tmp/qLlpeOGf0f/falconpl-0.9.1.8/core/include/falcon/deepitem.h /tmp/Y4mp0W3rzG/falconpl-0.9.2/core/include/falcon/deepitem.h --- falconpl-0.9.1.8/core/include/falcon/deepitem.h 2009-03-15 15:02:51.000000000 +0000 +++ falconpl-0.9.2/core/include/falcon/deepitem.h 2009-06-19 12:01:44.000000000 +0100 @@ -38,7 +38,7 @@ This is always true for the VM and ancillary modules. Code directly implementing this access at lower level, - as in example, getting a character from a string, doesn't + as for example, getting a character from a string, doesn't need to be consistent with this behavior (i.e. it may just return false on set error). diff -Nru /tmp/qLlpeOGf0f/falconpl-0.9.1.8/core/include/falcon/dir_sys.h /tmp/Y4mp0W3rzG/falconpl-0.9.2/core/include/falcon/dir_sys.h --- falconpl-0.9.1.8/core/include/falcon/dir_sys.h 2009-03-17 00:11:12.000000000 +0000 +++ falconpl-0.9.2/core/include/falcon/dir_sys.h 2009-06-19 12:01:44.000000000 +0100 @@ -24,6 +24,7 @@ #include #include +#include namespace Falcon { @@ -39,10 +40,12 @@ protected: uint32 m_lastError; + String m_path; public: - DirEntry(): - m_lastError(0) + DirEntry( const String &path ): + m_lastError(0), + m_path( path ) {} virtual bool read( String &fname ) = 0; @@ -52,6 +55,8 @@ // unsupported (for now) virtual FalconData *clone() const { return 0; } virtual void gcMark( uint32 mark ) {} + + const String &path() const { return m_path; } }; namespace Sys { diff -Nru /tmp/qLlpeOGf0f/falconpl-0.9.1.8/core/include/falcon/dir_sys_unix.h /tmp/Y4mp0W3rzG/falconpl-0.9.2/core/include/falcon/dir_sys_unix.h --- falconpl-0.9.1.8/core/include/falcon/dir_sys_unix.h 2008-10-18 02:29:54.000000000 +0100 +++ falconpl-0.9.2/core/include/falcon/dir_sys_unix.h 2009-06-19 12:01:44.000000000 +0100 @@ -39,8 +39,8 @@ DIR *m_raw_dir; public: - DirEntry_unix( DIR *d ): - DirEntry(), + DirEntry_unix( const String &p, DIR *d ): + DirEntry(p), m_raw_dir( d ) {} diff -Nru /tmp/qLlpeOGf0f/falconpl-0.9.1.8/core/include/falcon/dir_sys_win.h /tmp/Y4mp0W3rzG/falconpl-0.9.2/core/include/falcon/dir_sys_win.h --- falconpl-0.9.1.8/core/include/falcon/dir_sys_win.h 2008-04-06 20:38:30.000000000 +0100 +++ falconpl-0.9.2/core/include/falcon/dir_sys_win.h 2009-06-19 12:01:44.000000000 +0100 @@ -41,8 +41,8 @@ uint32 m_lastError; public: - DirEntry_win( HANDLE handle, WIN32_FIND_DATAW dir_data ): - DirEntry(), + DirEntry_win( const String &p, HANDLE handle, WIN32_FIND_DATAW dir_data ): + DirEntry(p), m_first( true ), m_lastError( 0 ), m_handle( handle ), diff -Nru /tmp/qLlpeOGf0f/falconpl-0.9.1.8/core/include/falcon/error.h /tmp/Y4mp0W3rzG/falconpl-0.9.2/core/include/falcon/error.h --- falconpl-0.9.1.8/core/include/falcon/error.h 2009-04-05 00:08:22.000000000 +0100 +++ falconpl-0.9.2/core/include/falcon/error.h 2009-06-19 12:01:44.000000000 +0100 @@ -26,7 +26,7 @@ #include #include #include -#include +#include #include namespace Falcon { @@ -66,7 +66,7 @@ extern reflectionFuncDecl Error_pc_rto; /** Reflective class for error */ -class ErrorObject: public ReflectObject +class ErrorObject: public CRObject { public: ErrorObject( const CoreClass* cls, Error *err ); diff -Nru /tmp/qLlpeOGf0f/falconpl-0.9.1.8/core/include/falcon/format.h /tmp/Y4mp0W3rzG/falconpl-0.9.2/core/include/falcon/format.h --- falconpl-0.9.1.8/core/include/falcon/format.h 2009-03-21 09:39:15.000000000 +0000 +++ falconpl-0.9.2/core/include/falcon/format.h 2009-06-19 12:01:44.000000000 +0100 @@ -27,7 +27,7 @@ /* To be added to docs in the next version. convType -Type of conversion; determines what type of variable is expected when formatting, depending on the format string. In example, when a decimal number is indicated in the format string, it is implied that the input variable to be formatted is meant to be a numeric value. +Type of conversion; determines what type of variable is expected when formatting, depending on the format string. for example, when a decimal number is indicated in the format string, it is implied that the input variable to be formatted is meant to be a numeric value. decimalChr Unicode character used to separate decimal parts of numbers. Defaults to '.'. decimals @@ -35,7 +35,7 @@ fixedSize If true, the 'size' field is mandatory, and representation of this variable is truncated to a maximum of 'size' characters. grouping -Count of grouping characters in numeric representation. In example, a number like "1,000,000" has a grouping of 3, while Japanese stanrd representation is 4-grouping (like "10,0000"). Zero means no grouping. +Count of grouping characters in numeric representation. For example, a number like "1,000,000" has a grouping of 3, while Japanese stanrd representation is 4-grouping (like "10,0000"). Zero means no grouping. groupingChr Character using for grouping. Defaults to comma (','). misAct @@ -215,8 +215,8 @@ more character. Formats are meant to deal with different item types. A format thought - for a certain kind of object, in example, a number, may be applied to something - different, in example, a string, or the other way around. + for a certain kind of object, for example, a number, may be applied to something + different, for example, a string, or the other way around. For this reason, Falcon formats include also what to do if the given item is not thought for the given format. @@ -231,10 +231,10 @@ - Padding: the padding character is appended after the formatted size, or it is prepended before it alignment is right. To define padding character, use 'p' - followed by the character. In example, p0 to fill the field with zeroes. Of course, + followed by the character. For example, p0 to fill the field with zeroes. Of course, the character may be any Unicode character (the format string accepts standard falcon character escapes). In the special case of p0, front sign indicators - are placed at the beginning of the field; in example "4p0+" will produce "+001" + are placed at the beginning of the field; for example "4p0+" will produce "+001" "-002" and so on, while "4px+" will produce "xx+1", "xx-2" etc. - Numeric base: the way an integer should be rendered. It may be: @@ -256,7 +256,7 @@ will be rounded. - Decimal separator: a 'd' followed by any non-cipher character will be interpreted as - decimal separator setting. In example, to use central european standard for + decimal separator setting. For example, to use central european standard for decimal nubmers and limit the output to 3 decimals, write ".3d,", or "d,.3". The default value is '.'. @@ -265,7 +265,7 @@ 'g' followed by the separator character, it defaults to ','. Normally, it is not displayed; to activate it set also the integer grouping digit count; normally is 3, but it's 4 in Jpanaese and Chinese localses, while it may be useful - to set it to 2 or 4 for hexadecimal, 3 for octal and 4 or 8 for binary. In example + to set it to 2 or 4 for hexadecimal, 3 for octal and 4 or 8 for binary. For example 'g4-' would group digits 4 by 4, grouping them with a "-". Zero would disable grouping. @@ -284,12 +284,12 @@ and use the padding character in front and after positive numbers. Using parenthesis will prevent using '+', '++' or '--' formats. Format '-^' will add a - in front of padding space if the number is negative, while '+^' will add plus or minus depending - on number sign. In example, "5+" would render -12 as " -12", while "5+^" will render + on number sign. For example, "5+" would render -12 as " -12", while "5+^" will render as "- 12". If alignment is to the right, the sign will be added at the other side of the padding: "5+^r" would render -12 as "12 -". If size is not mandatory, parenthesis will be wrapped around the formatted field, while if size is mandatory they will be - wrapped around the whole field, included padding. In example "5[r" on -4 would render + wrapped around the whole field, included padding. For example "5[r" on -4 would render as " (4)", while "5*[r" would render as "( 4)". - Object specific format: Objects may accept an object specific formatting as parameter @@ -310,7 +310,7 @@ - 'nA': nil is rendered with "NA" - Action on error: Normally, if trying to format something different from - what is expected, format() the method will simply return false. In example, + what is expected, format() the method will simply return false. For example, to format a string in a number, a string using the date formatter, a number in a simple pad-and-size formatter etc. To change this behavior, use '/' followed by one of the following: @@ -319,7 +319,7 @@ the neuter member of the expected type. - 'r': raise a type error. A 'c' letter may be added after the '/' and before the specifier to try a basic conversion - into the expected type before triggering the requested effect. This will, in example, + into the expected type before triggering the requested effect. This will, for example, cause the toString() method of objects to be called if the formatting is detected to be a string-type format. diff -Nru /tmp/qLlpeOGf0f/falconpl-0.9.1.8/core/include/falcon/mempool.h /tmp/Y4mp0W3rzG/falconpl-0.9.2/core/include/falcon/mempool.h --- falconpl-0.9.1.8/core/include/falcon/mempool.h 2009-05-09 14:50:36.000000000 +0100 +++ falconpl-0.9.2/core/include/falcon/mempool.h 2009-06-19 12:01:44.000000000 +0100 @@ -141,6 +141,8 @@ /** Guard for ramp modes. */ mutable Mutex m_mtx_ramp; + + mutable Mutex m_mtx_gen; bool markVM( VMachine *vm ); void gcSweep(); @@ -169,11 +171,6 @@ void promote( uint32 oldgen, uint32 curgen ); void advanceGeneration( VMachine* vm, uint32 oldGeneration ); - enum constants { - MAX_GENERATION = 0xFFFFFFFE, - SWEEP_GENERATION = 0xFFFFFFFF - }; - RampMode* m_ramp[RAMP_MODE_COUNT]; RampMode* m_curRampMode; int m_curRampID; @@ -184,6 +181,11 @@ public: + enum constants { + MAX_GENERATION = 0xFFFFFFFE, + SWEEP_GENERATION = 0xFFFFFFFF + }; + /** Builds a memory pool. Initializes all element at 0 and set buffer sizes to the FALCON default. */ @@ -216,7 +218,10 @@ /** Returns the current generation. */ uint32 generation() const { return m_generation; } - + /* + void generation( uint32 i ); + uint32 incgen(); + */ /** Stores a garbageable instance in the pool. Called by the Garbageable constructor to ensure accounting of this item. */ diff -Nru /tmp/qLlpeOGf0f/falconpl-0.9.1.8/core/include/falcon/modloader.h /tmp/Y4mp0W3rzG/falconpl-0.9.2/core/include/falcon/modloader.h --- falconpl-0.9.1.8/core/include/falcon/modloader.h 2009-04-26 16:42:17.000000000 +0100 +++ falconpl-0.9.2/core/include/falcon/modloader.h 2009-06-19 12:01:44.000000000 +0100 @@ -195,7 +195,7 @@ search path of those already known. Directory must be expressed in Falcon standard directory notation ( forward slashes to separate subdirectories). If the path contains more than one directory - they must be separated with a semicomma; in example: + they must be separated with a semicomma; for example: \code modloader.addSearchPath( "../;/my/modules;d:/other/modules" ); @@ -228,7 +228,7 @@ search path of those already known. Directory must be expressed in Falcon standard directory notation ( forward slashes to separate subdirectories). If the path contains more than one directory - they must be separated with a semicomma; in example: + they must be separated with a semicomma; for example: \code modloader.addSearchPath( "../;/my/modules;/other/modules" ); diff -Nru /tmp/qLlpeOGf0f/falconpl-0.9.1.8/core/include/falcon/sequence.h /tmp/Y4mp0W3rzG/falconpl-0.9.2/core/include/falcon/sequence.h --- falconpl-0.9.1.8/core/include/falcon/sequence.h 2008-06-25 20:45:39.000000000 +0100 +++ falconpl-0.9.2/core/include/falcon/sequence.h 2009-06-19 12:01:44.000000000 +0100 @@ -89,7 +89,7 @@ insertion causes append on tail, and at return they must be valid and point to the last valid element (the one just inserted). - If the iterator cannot be used, in example because their owner is + If the iterator cannot be used, for example because their owner is not this item, the function must return immediately false; in the right context, an appropriate error will be raised by the caller. diff -Nru /tmp/qLlpeOGf0f/falconpl-0.9.1.8/core/include/falcon/src_lexer.h /tmp/Y4mp0W3rzG/falconpl-0.9.2/core/include/falcon/src_lexer.h --- falconpl-0.9.1.8/core/include/falcon/src_lexer.h 2009-05-16 11:04:00.000000000 +0100 +++ falconpl-0.9.2/core/include/falcon/src_lexer.h 2009-06-20 14:21:08.000000000 +0100 @@ -250,6 +250,11 @@ */ bool inParCtx(); + /** Specialized version of ReadAhead, killing unneeded \\r + \return true if the character could be read ahead + \param chr Where to place the read character + */ + bool readAhead( uint32 &chr ); }; } diff -Nru /tmp/qLlpeOGf0f/falconpl-0.9.1.8/core/include/falcon/string.h /tmp/Y4mp0W3rzG/falconpl-0.9.2/core/include/falcon/string.h --- falconpl-0.9.1.8/core/include/falcon/string.h 2009-04-30 15:07:59.000000000 +0100 +++ falconpl-0.9.2/core/include/falcon/string.h 2009-06-19 12:01:44.000000000 +0100 @@ -149,7 +149,7 @@ /** Static byte oriented string manager. Useful to instantiante and manage strings whose content is byte oriented and whose size is - known in advance; in example, symbol names in the Falcon module are easily managed with this class. + known in advance; for example, symbol names in the Falcon module are easily managed with this class. Every write operation on strings managed by this class will cause its manager to be changed into the Buffer class. @@ -1088,33 +1088,52 @@ /** Sets wether this string should be exported in international context or not. */ void exported( bool e ) { m_bExported = e; } - + /** Adds an extra '\0' terminator past the end of the string. - This makes the string data (available through getRawStorage()) suitable + This makes the string data (available through getRawStorage()) suitable to be sent to C functions compatible with the character size of this string. - + Eventually, it should be preceded by a call to setCharSize(). */ void c_ize(); - + + /** Compares a string with the beginning of this string. + If \b str is empty, returns true, if it's larger than + this string returns false. + \param str The string to be compared against the beginning of this string. + \param icase true to perform a case neutral compare + \return true on success. + */ + bool startsWith( const String &str, bool icase=false ) const; + + /** Compares a string with the end of this string. + If \b str is empty, returns true, if it's larger than + this string returns false. + \param str The string to be compared against the end of this string. + \param icase true to perform a case neutral compare + \return true on success. + */ + bool endsWith( const String &str, bool icase=false ) const; + + /** Alters the character size of this string. - + Changes the number of bytes used to represent a single character in this string. The number of byte used can be 1, 2 or 4. - + If the new character size of this string is smaller than the original one, characters that cannot be represented are substituted with a \b subst value (by default, the maximum value allowed for the given character size). - - If the original character size was different, the + + If the original character size was different, the string is bufferized into a new memory area, otherwise the string is unchanged. - + \note subst param is not currently implemented. - + @param nsize The new character size for the string. @param subst The substitute character to be used when reducing size. @return True if the nsize value is valid, false otherwise. diff -Nru /tmp/qLlpeOGf0f/falconpl-0.9.1.8/core/include/falcon/strtable.h /tmp/Y4mp0W3rzG/falconpl-0.9.2/core/include/falcon/strtable.h --- falconpl-0.9.1.8/core/include/falcon/strtable.h 2009-03-24 23:52:11.000000000 +0000 +++ falconpl-0.9.2/core/include/falcon/strtable.h 2009-06-19 12:01:44.000000000 +0100 @@ -64,7 +64,7 @@ /** Skip the string table from a stream. This is useful when i.e. you have a string table embedded in a stream - but you don't want to load it, in example because you want to use + but you don't want to load it, for example because you want to use an external string table instead. */ bool skip( Stream *in ) const; diff -Nru /tmp/qLlpeOGf0f/falconpl-0.9.1.8/core/include/falcon/vm.h /tmp/Y4mp0W3rzG/falconpl-0.9.2/core/include/falcon/vm.h --- falconpl-0.9.1.8/core/include/falcon/vm.h 2009-05-18 15:08:40.000000000 +0100 +++ falconpl-0.9.2/core/include/falcon/vm.h 2009-06-19 12:01:44.000000000 +0100 @@ -987,7 +987,7 @@ Then the routine whose name is given is searched in the top module (the one that has been added last to the runtime). If not found there, it is searched in the exported symbols of the whole runtime. If not given, the __main__ symbol of the top module is executed. If the required symbol cannot be - found an error is risen and false is returned. + found an error is raised and false is returned. The routine returns true if execution is successful; the VM may return because the routine terminates, because of an explicit END opcode and because execution limit (single step or limited step count) is @@ -1023,7 +1023,7 @@ If a symbol name is provided, then the symbol is executed retaining all the current status. The symbol is searched in the locals of the top module, and then in the - global of the runtime eaxtly as for launch(). This is useful, in example, to provide + global of the runtime eaxtly as for launch(). This is useful, for example, to provide callback entry points in scripts that must maintain their execution status between calls. In this way, each run maintain the previous status but grants execution of different entry points; also this is quite faster than having to enter the realization @@ -1996,7 +1996,7 @@ embedding application. To provide application specific per-vm data to the scripts, the best solution for embedding applications is usually to extend the VM into a subclass. Contrarily, middleware extensions, - as, in example, script plugins for applications, may prefer to use the + as, for example, script plugins for applications, may prefer to use the standard Falcon VM and use this pointer to store application specific data. The VM makes no assumption on the kind of user data. The data is not destroyed diff -Nru /tmp/qLlpeOGf0f/falconpl-0.9.1.8/core/include/falcon/vmmsg.h /tmp/Y4mp0W3rzG/falconpl-0.9.2/core/include/falcon/vmmsg.h --- falconpl-0.9.1.8/core/include/falcon/vmmsg.h 2009-04-10 16:11:47.000000000 +0100 +++ falconpl-0.9.2/core/include/falcon/vmmsg.h 2009-06-19 12:01:44.000000000 +0100 @@ -29,6 +29,8 @@ class GarbageLock; class VMachine; +class Error; + /** Asynchronous message for the Virtual Machine. When the virtual machine receives this, it executes a broadcast loop on a coroutine @@ -49,6 +51,7 @@ uint32 m_allocated; uint32 m_pcount; VMMessage *m_next; + Error* m_error; public: /** Creates a VMMessage without parameters. @@ -101,6 +104,14 @@ Should be called only by the target VM. */ VMMessage *next() const { return m_next; } + + /** Transform this message in an async error notification. + The error is inc-reffed. + */ + void error( Error* err ); + + /** Returns the error associated with this message */ + Error* error() const { return m_error; } }; } diff -Nru /tmp/qLlpeOGf0f/falconpl-0.9.1.8/core/tests/benchmarks/sieve.fal /tmp/Y4mp0W3rzG/falconpl-0.9.2/core/tests/benchmarks/sieve.fal --- falconpl-0.9.1.8/core/tests/benchmarks/sieve.fal 2009-03-15 15:02:51.000000000 +0000 +++ falconpl-0.9.2/core/tests/benchmarks/sieve.fal 2009-06-19 12:01:44.000000000 +0100 @@ -1,67 +1,67 @@ -/* - FALCON - Benchmarks - - FILE: sieve.fal - - Timed Sieve of Eratosthenes. - - Measures performance how many computational loops are performed - in a given amount of time. - - See also "sieve_mt.fal" - ------------------------------------------------------------------- - Author: Giancarlo Niccolai - Begin: - - ------------------------------------------------------------------- - (C) Copyright 2008: the FALCON developers (see list in AUTHORS file) - - See LICENSE file for licensing details. -*/ - -// Config - -const SIZE = 8092 -const BATCH = 100 -const TIME = 30 -flags = arrayBuffer( SIZE+1 ) - -//========================= -// The sieve -//========================= - -function sieve() - global count - - flags.fill(0) - for i in [1:SIZE+1] - if flags[i]: continue - - prime = 2 * i + 1 - start = prime + i - for k in [start:SIZE+1:prime] - flags[k] = 1 - end - end - count += i -end - -//========================= -// Main code -//========================= - -count = 0 -cycles = 0 -t = seconds() -//while seconds() < t + TIME // Test for TIME (30) seconds - for iter in [0:BATCH] - sieve() - end - cycles += BATCH -//end -t = seconds() - t - -f = Format( ".3" ) -> f.format( t ), " seconds." -> count, " sieves." -> f.format(count / t), " sieves per second" +/* + FALCON - Benchmarks + + FILE: sieve.fal + + Timed Sieve of Eratosthenes. + + Measures performance how many computational loops are performed + in a given amount of time. + + See also "sieve_mt.fal" + ------------------------------------------------------------------- + Author: Giancarlo Niccolai + Begin: + + ------------------------------------------------------------------- + (C) Copyright 2008: the FALCON developers (see list in AUTHORS file) + + See LICENSE file for licensing details. +*/ + +// Config + +const SIZE = 8092 +const BATCH = 100 +const TIME = 30 +flags = arrayBuffer( SIZE+1 ) + +//========================= +// The sieve +//========================= + +function sieve() + global count + + flags.fill(0) + for i in [1:SIZE+1] + if flags[i]: continue + + prime = 2 * i + 1 + start = prime + i + for k in [start:SIZE+1:prime] + flags[k] = 1 + end + end + count += i +end + +//========================= +// Main code +//========================= + +count = 0 +cycles = 0 +t = seconds() +//while seconds() < t + TIME // Test for TIME (30) seconds + for iter in [0:BATCH] + sieve() + end + cycles += BATCH +//end +t = seconds() - t + +f = Format( ".3" ) +> f.format( t ), " seconds." +> count, " sieves." +> f.format(count / t), " sieves per second" diff -Nru /tmp/qLlpeOGf0f/falconpl-0.9.1.8/core/tests/benchmarks/sieve_mt.fal /tmp/Y4mp0W3rzG/falconpl-0.9.2/core/tests/benchmarks/sieve_mt.fal --- falconpl-0.9.1.8/core/tests/benchmarks/sieve_mt.fal 2008-10-17 09:52:42.000000000 +0100 +++ falconpl-0.9.2/core/tests/benchmarks/sieve_mt.fal 2009-06-19 12:01:44.000000000 +0100 @@ -1,103 +1,103 @@ -/* - FALCON - Benchmarks - - FILE: sieve_mt.fal - - Multithreaded Sieve of Eratosthenes. - - Measures performance linearity in pure parallel calculation tasks - by summing up the computational cycles performed by each thread - in a given amount of time. - - Requires the threading module. - - Provide the number of desired threads as a parameter (defaults to 1). - - See also "sieve.fal" - ------------------------------------------------------------------- - Author: Giancarlo Niccolai - Begin: - - ------------------------------------------------------------------- - (C) Copyright 2008: the FALCON developers (see list in AUTHORS file) - - See LICENSE file for licensing details. -*/ - -load threading - -// Config - -const SIZE = 5000 -const BATCH = 20 -const TIME = 30 - -//========================= -// The sieve -//========================= - -function sieve() - count = 0 - - flags = arrayBuffer( SIZE ) - for i in [0:SIZE] - if flags[i]: continue - - prime = 2 * i + 1 - start = prime + i - for k in [start:SIZE:prime] - flags[k] = true - end - count++ - end - return count -end - -//========================= -// The thread main routine -//========================= - -function threaded() - - cycles = 0 - t = seconds() - while seconds() < t + TIME // test for TIME (30) seconds - for iter in [0:BATCH] - p = sieve() - end - cycles += BATCH - end - - // return to join() the number of completed loops - return cycles -end - -//========================= -// Main code -//========================= - -// get the argument -if args.len() - tcount = int(args[0]) - if tcount < 1: tcount = 1 -else - tcount = 1 -end - -// creates nameless threads -threads = arrayBuffer( tcount ) -t = seconds() -for i in [0:tcount] - threads[i] = Threading.start( threaded ) -end - -// wait for the threads to finish -count = 0 -for i in [0:tcount] - count += threads[i].join() -end -t = seconds() - t - -// results -f = Format( ".3" ) -> f.format(count / t), " sieves per second" +/* + FALCON - Benchmarks + + FILE: sieve_mt.fal + + Multithreaded Sieve of Eratosthenes. + + Measures performance linearity in pure parallel calculation tasks + by summing up the computational cycles performed by each thread + in a given amount of time. + + Requires the threading module. + + Provide the number of desired threads as a parameter (defaults to 1). + + See also "sieve.fal" + ------------------------------------------------------------------- + Author: Giancarlo Niccolai + Begin: + + ------------------------------------------------------------------- + (C) Copyright 2008: the FALCON developers (see list in AUTHORS file) + + See LICENSE file for licensing details. +*/ + +load threading + +// Config + +const SIZE = 5000 +const BATCH = 20 +const TIME = 30 + +//========================= +// The sieve +//========================= + +function sieve() + count = 0 + + flags = arrayBuffer( SIZE ) + for i in [0:SIZE] + if flags[i]: continue + + prime = 2 * i + 1 + start = prime + i + for k in [start:SIZE:prime] + flags[k] = true + end + count++ + end + return count +end + +//========================= +// The thread main routine +//========================= + +function threaded() + + cycles = 0 + t = seconds() + while seconds() < t + TIME // test for TIME (30) seconds + for iter in [0:BATCH] + p = sieve() + end + cycles += BATCH + end + + // return to join() the number of completed loops + return cycles +end + +//========================= +// Main code +//========================= + +// get the argument +if args.len() + tcount = int(args[0]) + if tcount < 1: tcount = 1 +else + tcount = 1 +end + +// creates nameless threads +threads = arrayBuffer( tcount ) +t = seconds() +for i in [0:tcount] + threads[i] = Threading.start( threaded ) +end + +// wait for the threads to finish +count = 0 +for i in [0:tcount] + count += threads[i].join() +end +t = seconds() - t + +// results +f = Format( ".3" ) +> f.format(count / t), " sieves per second" diff -Nru /tmp/qLlpeOGf0f/falconpl-0.9.1.8/core/tests/samples/def_params.fal /tmp/Y4mp0W3rzG/falconpl-0.9.2/core/tests/samples/def_params.fal --- falconpl-0.9.1.8/core/tests/samples/def_params.fal 2008-11-24 16:10:20.000000000 +0000 +++ falconpl-0.9.2/core/tests/samples/def_params.fal 2009-06-19 12:01:44.000000000 +0100 @@ -1,42 +1,42 @@ -/* - FALCON - Samples - - FILE: def_params.fal - - Shows the default parameter idiom. - ------------------------------------------------------------------- - Author: Giancarlo Niccolai - Begin: Sun, 13 Apr 2008 23:26:44 +0200 - - ------------------------------------------------------------------- - (C) Copyright 2004: the FALCON developers (see list in AUTHORS file) - - See LICENSE file for licensing details. -*/ - -> "Test for default parameters" -> "Will pring a string prefixed by \">>>\" below" -> "---------------------------------------------" -> - -// Let's say we have a function with two parameters, the second one -// being optional. -// -- In example, this prints p1 eventually prefixed by prefix, if given. -function prompt_print( p1, prefix ) - if prefix - > prefix, p1 - else - > p1 - end -end - -// now we create a version of the function that gives a value for prefix... -xprint =.[prompt_print prefix|">>> "] - -// ... and use it. -if args.len() == 0 - xprint( "Hello world" ) -else - for elem in args: xprint( elem ) -end - +/* + FALCON - Samples + + FILE: def_params.fal + + Shows the default parameter idiom. + ------------------------------------------------------------------- + Author: Giancarlo Niccolai + Begin: Sun, 13 Apr 2008 23:26:44 +0200 + + ------------------------------------------------------------------- + (C) Copyright 2004: the FALCON developers (see list in AUTHORS file) + + See LICENSE file for licensing details. +*/ + +> "Test for default parameters" +> "Will pring a string prefixed by \">>>\" below" +> "---------------------------------------------" +> + +// Let's say we have a function with two parameters, the second one +// being optional. +// -- In example, this prints p1 eventually prefixed by prefix, if given. +function prompt_print( p1, prefix ) + if prefix + > prefix, p1 + else + > p1 + end +end + +// now we create a version of the function that gives a value for prefix... +xprint =.[prompt_print prefix|">>> "] + +// ... and use it. +if args.len() == 0 + xprint( "Hello world" ) +else + for elem in args: xprint( elem ) +end + diff -Nru /tmp/qLlpeOGf0f/falconpl-0.9.1.8/core/tests/samples/dirlist.fal /tmp/Y4mp0W3rzG/falconpl-0.9.2/core/tests/samples/dirlist.fal --- falconpl-0.9.1.8/core/tests/samples/dirlist.fal 2009-04-08 10:35:50.000000000 +0100 +++ falconpl-0.9.2/core/tests/samples/dirlist.fal 2009-06-20 14:44:34.000000000 +0100 @@ -24,7 +24,7 @@ printl( "Directory list for: ", dir ) try - dirHandle = DirectoryOpen( dir ) + dirHandle = Directory( dir ) elem = dirHandle.read() stats = FileStat() while elem != nil diff -Nru /tmp/qLlpeOGf0f/falconpl-0.9.1.8/core/tests/samples/filecopy.fal /tmp/Y4mp0W3rzG/falconpl-0.9.2/core/tests/samples/filecopy.fal --- falconpl-0.9.1.8/core/tests/samples/filecopy.fal 2008-04-06 20:38:30.000000000 +0100 +++ falconpl-0.9.2/core/tests/samples/filecopy.fal 2009-06-20 14:44:34.000000000 +0100 @@ -36,7 +36,7 @@ source.seek(0) // first, read a block initializing a suitable variable. - block = source.read( 1024 ) + block = source.grab( 1024 ) readSize = len(block) // continue until the last read returns 0 (and this sets the EOF flag). @@ -77,7 +77,7 @@ if lastRatio == int(ratio) return else - lastRatio == int(ratio) + lastRatio = int(ratio) end gauge = strReplicate( "#", ratio ) @@ -86,4 +86,4 @@ end -/* end of filecopy.flc */ +/* end of filecopy.fal */ diff -Nru /tmp/qLlpeOGf0f/falconpl-0.9.1.8/core/tests/samples/filecopymb.fal /tmp/Y4mp0W3rzG/falconpl-0.9.2/core/tests/samples/filecopymb.fal --- falconpl-0.9.1.8/core/tests/samples/filecopymb.fal 2008-04-06 20:38:30.000000000 +0100 +++ falconpl-0.9.2/core/tests/samples/filecopymb.fal 2009-06-20 14:44:34.000000000 +0100 @@ -1,4 +1,4 @@ -#!/usr/bin/falcon +#!/usr/bin/falcons /* FALCON - Samples @@ -40,6 +40,7 @@ // continue until the last read returns 0 (and this sets the EOF flag). while not source.eof() + block.rewind() count = source.read( block ) // write the block. As memblocks are fixed length, we do NEED to // specify it @@ -78,7 +79,7 @@ if lastRatio == int(ratio) return else - lastRatio == int(ratio) + lastRatio = int(ratio) end gauge = strReplicate( "#", ratio ) @@ -87,4 +88,4 @@ end -/* end of filecopy.fal */ +/* end of filecopymb.fal */ diff -Nru /tmp/qLlpeOGf0f/falconpl-0.9.1.8/core/tests/samples/life.fal /tmp/Y4mp0W3rzG/falconpl-0.9.2/core/tests/samples/life.fal --- falconpl-0.9.1.8/core/tests/samples/life.fal 2009-03-15 15:02:51.000000000 +0000 +++ falconpl-0.9.2/core/tests/samples/life.fal 2009-06-19 12:01:44.000000000 +0100 @@ -1,133 +1,133 @@ -/***************************************************** - The life game -*/ -ALIVE=ord("O") -DEAD=ord("-") - -write = stdOut().write - -class Life( width, height ) - w = width - h = height - - thisgen = nil - nextgen = nil - - // we need an array of rows... - init - self.thisgen = arrayBuffer( height+1 ) - self.nextgen = arrayBuffer( height+1 ) - for row in [1: height+1] - self.thisgen[row] = arrayBuffer( width+1 ) - self.nextgen[row] = arrayBuffer( width+1 ) - for col in [1:width+1] - self.thisgen[row][col] = 0 - self.nextgen[row][col] = 0 - end - end - end - - function spawn( shape, left, top ) - for y in [0: shape.h] - for x in [0: shape.w] - self.thisgen[top+y][left+x] = shape[y*shape.w+x] - end - end - end - - // run the CA and produce the next generation - function evolve() - static - w = self.w - end - next = self.nextgen - data = self.thisgen - - ym1,y=self.h-1,self.h - for yp1 in [1:self.h+1] - xm1,x=w-1,w - nextRow = next[y] - for xp1 in [1:w+1] - rm1 = data[ym1] - ry = data[y] - rp1 = data[yp1] - sum = rm1[xm1] + rm1[x] + rm1[xp1] + \ - ry[xm1] + ry[xp1] + \ - rp1[xm1] + rp1[x] + rp1[xp1] - nextRow[x] = (sum==2) and ry[x] ? 1 : sum==3 ? 1 : 0 - xm1,x = x,xp1 - end - ym1,y = y,yp1 - end - - // exchange data. - self.nextgen = self.thisgen - self.thisgen = next - end - - // Display this generation - function draw() - static - out = strReplicate( " ", self.h*(self.w+1) ) // Write all at once - height = self.h+1 - width = self.w - end - - p = 0 - for y in [1:height] - row = self.thisgen[y] - for x in [0:width] - if row[x+1] - out[p+x] = ALIVE - else - out[p+x] = DEAD - end - end - p += self.w - out[p] = 10 - p++ - end - - write( out ) - end - -end - -/************************************************** - Shapes that we may want to use as tests - They are arrays with w and h bindings. -**************************************************/ -HEART = [1,0,1,1,0,1,1,1,1]; HEART.w = 3; HEART.h = 3 -GLIDER = [0,0,1,1,0,1,0,1,1]; GLIDER.w = 3; GLIDER.h = 3 -EXPLODE = [0,1,0,1,1,1,1,0,1,0,1,0]; EXPLODE.w = 3; EXPLODE.h = 4 -FISH = [0,1,1,1,1,1,0,0,0,1,0,0,0,0,1,1,0,0,1,0]; FISH.w = 5; FISH.h = 4 -BUTTERFLY = [1,0,0,0,1,0,1,1,1,0,1,0,0,0,1,1,0,1,0,1,1,0,0,0,1] - BUTTERFLY.w = 5; BUTTERFLY.h = 5 - -/**************************************************** -* Main routine -****************************************************/ - -// create some life -life = Life( 40, 20 ) - -// some spawning -/*life.spawn(GLIDER, 2, 2) -life.spawn(EXPLODE, 40, 10) -life.spawn(FISH, 10, 14)*/ - -life.spawn(GLIDER, 5,4) - life.spawn(EXPLODE, 25,10) - life.spawn(FISH, 4,12) -// run until break -gen = 0 -write("\x1b[2J") // ANSI clear screen -while gen < 2000 - life.evolve() - write("\x1b[H") // ANSI home cursor - life.draw() - write( "Life - generation " + ++gen ) - //sleep(0.05) // slight delay -end - -printl() +/***************************************************** + The life game +*/ +ALIVE=ord("O") +DEAD=ord("-") + +write = stdOut().write + +class Life( width, height ) + w = width + h = height + + thisgen = nil + nextgen = nil + + // we need an array of rows... + init + self.thisgen = arrayBuffer( height+1 ) + self.nextgen = arrayBuffer( height+1 ) + for row in [1: height+1] + self.thisgen[row] = arrayBuffer( width+1 ) + self.nextgen[row] = arrayBuffer( width+1 ) + for col in [1:width+1] + self.thisgen[row][col] = 0 + self.nextgen[row][col] = 0 + end + end + end + + function spawn( shape, left, top ) + for y in [0: shape.h] + for x in [0: shape.w] + self.thisgen[top+y][left+x] = shape[y*shape.w+x] + end + end + end + + // run the CA and produce the next generation + function evolve() + static + w = self.w + end + next = self.nextgen + data = self.thisgen + + ym1,y=self.h-1,self.h + for yp1 in [1:self.h+1] + xm1,x=w-1,w + nextRow = next[y] + for xp1 in [1:w+1] + rm1 = data[ym1] + ry = data[y] + rp1 = data[yp1] + sum = rm1[xm1] + rm1[x] + rm1[xp1] + \ + ry[xm1] + ry[xp1] + \ + rp1[xm1] + rp1[x] + rp1[xp1] + nextRow[x] = (sum==2) and ry[x] ? 1 : sum==3 ? 1 : 0 + xm1,x = x,xp1 + end + ym1,y = y,yp1 + end + + // exchange data. + self.nextgen = self.thisgen + self.thisgen = next + end + + // Display this generation + function draw() + static + out = strReplicate( " ", self.h*(self.w+1) ) // Write all at once + height = self.h+1 + width = self.w + end + + p = 0 + for y in [1:height] + row = self.thisgen[y] + for x in [0:width] + if row[x+1] + out[p+x] = ALIVE + else + out[p+x] = DEAD + end + end + p += self.w + out[p] = 10 + p++ + end + + write( out ) + end + +end + +/************************************************** + Shapes that we may want to use as tests + They are arrays with w and h bindings. +**************************************************/ +HEART = [1,0,1,1,0,1,1,1,1]; HEART.w = 3; HEART.h = 3 +GLIDER = [0,0,1,1,0,1,0,1,1]; GLIDER.w = 3; GLIDER.h = 3 +EXPLODE = [0,1,0,1,1,1,1,0,1,0,1,0]; EXPLODE.w = 3; EXPLODE.h = 4 +FISH = [0,1,1,1,1,1,0,0,0,1,0,0,0,0,1,1,0,0,1,0]; FISH.w = 5; FISH.h = 4 +BUTTERFLY = [1,0,0,0,1,0,1,1,1,0,1,0,0,0,1,1,0,1,0,1,1,0,0,0,1] + BUTTERFLY.w = 5; BUTTERFLY.h = 5 + +/**************************************************** +* Main routine +****************************************************/ + +// create some life +life = Life( 40, 20 ) + +// some spawning +/*life.spawn(GLIDER, 2, 2) +life.spawn(EXPLODE, 40, 10) +life.spawn(FISH, 10, 14)*/ + +life.spawn(GLIDER, 5,4) + life.spawn(EXPLODE, 25,10) + life.spawn(FISH, 4,12) +// run until break +gen = 0 +write("\x1b[2J") // ANSI clear screen +while gen < 2000 + life.evolve() + write("\x1b[H") // ANSI home cursor + life.draw() + write( "Life - generation " + ++gen ) + //sleep(0.05) // slight delay +end + +printl() diff -Nru /tmp/qLlpeOGf0f/falconpl-0.9.1.8/core/tests/testsuite/arr_change.fal /tmp/Y4mp0W3rzG/falconpl-0.9.2/core/tests/testsuite/arr_change.fal --- falconpl-0.9.1.8/core/tests/testsuite/arr_change.fal 2008-11-27 22:33:48.000000000 +0000 +++ falconpl-0.9.2/core/tests/testsuite/arr_change.fal 2009-06-19 12:01:44.000000000 +0100 @@ -1,197 +1,197 @@ -/**************************************************************************** -* Falcon test suite -* -* -* ID: 11k -* Category: types -* Subcategory: array -* Short: Ranged substitutions. -* Description: -* Verify that substitutions performed on arrays with ranges are correct. -* This test only checks for positive ranges. -* [/Description] -* -****************************************************************************/ - -array = [ 0, 1, 2, - 3, 4, 5, - 6, 7 - ] - -// array change 1 item -array[3:4] = "alpha" -if len( array ) != 8 : failure( "item - len" ) -if array[2] != 2 or array[4] != 4: failure( "item - surround" ) -if array[3] != "alpha": failure( "item - item" ) - -//========================================= -// Substitute with one item -// - -// array change more items - middle -array = [ 0, 1, 2, - 3, 4, 5, - 6, 7 - ] -array[3:6] = "alpha" -if len( array ) != 6 : failure( "more items - len" ) -if array[2] != 2 or array[4] != 6: failure( "more items - surround" ) -if array[3] != "alpha": failure( "more items - item" ) - -array = [ 0, 1, 2, - 3, 4, 5, - 6, 7 - ] -array[5:3] = "alpha" - -if len( array ) != 6: failure( "more items reverse - len" ) -if array[2] != 2 or array[4] != 6: failure( "more items reverse - surround" ) -if array[3] != "alpha": failure( "more items reverse - item" ) - -// array change more items - begin -array = [ 0, 1, 2, - 3, 4, 5, - 6, 7 - ] -array[0:3] = "alpha" -if len( array ) != 6 : failure( "more items (begin) - len" ) -if array[1] != 3: failure( "more items (begin) - surround" ) -if array[0] != "alpha": failure( "more items (begin) - item" ) - -array = [ 0, 1, 2, - 3, 4, 5, - 6, 7 - ] -array[2:0] = "alpha" -if len( array ) != 6 : failure( "more items (begin) reverse - len" ) -if array[1] != 3: failure( "more items (begin) reverse - surround" ) -if array[0] != "alpha": failure( "more items (begin) reverse - item" ) - -// array change more items - end -array = [ 0, 1, 2, - 3, 4, 5, - 6, 7 - ] - -array[6:] = "alpha" -if len( array ) != 7 : failure( "more items (end) - len" ) -if array[5] != 5: failure( "more items (end) - surround" ) -if array[6] != "alpha": failure( "more items (end) - item" ) - -//========================================= -// Substitute with a shorter array -// - -// in the middle -array = [ 0, 1, 2, - 3, 4, 5, - 6, 7 - ] -array[2:6] = ["a","b"] - -if len( array ) != 6 : failure( "smaller array - len" ) -if array[1] != 1 or array[4] != 6: failure( "smaller array - surround" ) -if array[2] != "a" or array[3] != "b": failure( "smaller array - items" ) - -array = [ 0, 1, 2, - 3, 4, 5, - 6, 7 - ] -array[5:2] = ["a","b"] - -if len( array ) != 6 : failure( "smaller array reverse - len" ) -if array[1] != 1 or array[4] != 6: failure( "smaller array reverse - surround" ) -if array[2] != "a" or array[3] != "b": failure( "smaller array reverse - items" ) - -// at begin the middle -array = [ 0, 1, 2, - 3, 4, 5, - 6, 7 - ] -array[0:4] = ["a","b"] - -if len( array ) != 6 : failure( "smaller array (begin) - len" ) -if array[2] != 4: failure( "smaller array (begin) - surround" ) -if array[0] != "a" or array[1] != "b": failure( "smaller array (begin) - items" ) - -array = [ 0, 1, 2, - 3, 4, 5, - 6, 7 - ] -array[3:0] = ["a","b"] - -if len( array ) != 6 : failure( "smaller array (begin) reverse - len" ) -if array[2] != 4: failure( "smaller array (begin) reverse - surround" ) -if array[0] != "a" or array[1] != "b": failure( "smaller array (begin) reverse - items" ) - -// at begin the middle -array = [ 0, 1, 2, - 3, 4, 5, - 6, 7 - ] -array[4:] = ["a","b"] - -if len( array ) != 6 : failure( "smaller array (end) - len" ) -if array[3] != 3: failure( "smaller array (end) - surround" ) -if array[4] != "a" or array[5] != "b": failure( "smaller array (end) - items" ) - -//========================================= -// Substitute with a larger array -// - -// in the middle -array = [ 0, 1, 2, - 3, 4, 5, - 6, 7 - ] -array[2:4] = ["a","b","c"] - -if len( array ) != 9 : failure( "larger array - len" ) -if array[1] != 1 or array[6] != 5: failure( "Range larger smaller array - surround" ) -if array[2] != "a" or array[4] != "c": failure( "larger array - items" ) - -array = [ 0, 1, 2, - 3, 4, 5, - 6, 7 - ] -array[3:2] = ["a","b","c"] - -if len( array ) != 9 : failure( "larger array reverse - len" ) -if array[1] != 1 or array[6] != 5: failure( "Range larger smaller array reverse - surround" ) -if array[2] != "a" or array[4] != "c": failure( "larger array reverse - items" ) - -// at begin the middle -array = [ 0, 1, 2, - 3, 4, 5, - 6, 7 - ] -array[0:2] = ["a","b","c"] - -if len( array ) != 9 : failure( "larger array (begin) - len" ) -if array[3] != 2: failure( "larger array (begin) - surround" ) -if array[0] != "a" or array[2] != "c": failure( "larger array (begin) - items" ) - -array = [ 0, 1, 2, - 3, 4, 5, - 6, 7 - ] -array[1:0] = ["a","b","c"] - -if len( array ) != 9 : failure( "larger array (begin) reverse - len" ) -if array[3] != 2: failure( "larger array (begin) reverse - surround" ) -if array[0] != "a" or array[2] != "c": failure( "larger array (begin) reverse - items" ) - -// at begin the middle -array = [ 0, 1, 2, - 3, 4, 5, - 6, 7 - ] -array[6:] = ["a","b","c"] - -if len( array ) != 9 : failure( "larger array (end) - len" ) -if array[5] != 5: failure( "larger array (end) - surround" ) -if array[6] != "a" or array[8] != "c": failure( "larger array (end) - items" ) - -success() - -/* End of file */ +/**************************************************************************** +* Falcon test suite +* +* +* ID: 11k +* Category: types +* Subcategory: array +* Short: Ranged substitutions. +* Description: +* Verify that substitutions performed on arrays with ranges are correct. +* This test only checks for positive ranges. +* [/Description] +* +****************************************************************************/ + +array = [ 0, 1, 2, + 3, 4, 5, + 6, 7 + ] + +// array change 1 item +array[3:4] = "alpha" +if len( array ) != 8 : failure( "item - len" ) +if array[2] != 2 or array[4] != 4: failure( "item - surround" ) +if array[3] != "alpha": failure( "item - item" ) + +//========================================= +// Substitute with one item +// + +// array change more items - middle +array = [ 0, 1, 2, + 3, 4, 5, + 6, 7 + ] +array[3:6] = "alpha" +if len( array ) != 6 : failure( "more items - len" ) +if array[2] != 2 or array[4] != 6: failure( "more items - surround" ) +if array[3] != "alpha": failure( "more items - item" ) + +array = [ 0, 1, 2, + 3, 4, 5, + 6, 7 + ] +array[5:3] = "alpha" + +if len( array ) != 6: failure( "more items reverse - len" ) +if array[2] != 2 or array[4] != 6: failure( "more items reverse - surround" ) +if array[3] != "alpha": failure( "more items reverse - item" ) + +// array change more items - begin +array = [ 0, 1, 2, + 3, 4, 5, + 6, 7 + ] +array[0:3] = "alpha" +if len( array ) != 6 : failure( "more items (begin) - len" ) +if array[1] != 3: failure( "more items (begin) - surround" ) +if array[0] != "alpha": failure( "more items (begin) - item" ) + +array = [ 0, 1, 2, + 3, 4, 5, + 6, 7 + ] +array[2:0] = "alpha" +if len( array ) != 6 : failure( "more items (begin) reverse - len" ) +if array[1] != 3: failure( "more items (begin) reverse - surround" ) +if array[0] != "alpha": failure( "more items (begin) reverse - item" ) + +// array change more items - end +array = [ 0, 1, 2, + 3, 4, 5, + 6, 7 + ] + +array[6:] = "alpha" +if len( array ) != 7 : failure( "more items (end) - len" ) +if array[5] != 5: failure( "more items (end) - surround" ) +if array[6] != "alpha": failure( "more items (end) - item" ) + +//========================================= +// Substitute with a shorter array +// + +// in the middle +array = [ 0, 1, 2, + 3, 4, 5, + 6, 7 + ] +array[2:6] = ["a","b"] + +if len( array ) != 6 : failure( "smaller array - len" ) +if array[1] != 1 or array[4] != 6: failure( "smaller array - surround" ) +if array[2] != "a" or array[3] != "b": failure( "smaller array - items" ) + +array = [ 0, 1, 2, + 3, 4, 5, + 6, 7 + ] +array[5:2] = ["a","b"] + +if len( array ) != 6 : failure( "smaller array reverse - len" ) +if array[1] != 1 or array[4] != 6: failure( "smaller array reverse - surround" ) +if array[2] != "a" or array[3] != "b": failure( "smaller array reverse - items" ) + +// at begin the middle +array = [ 0, 1, 2, + 3, 4, 5, + 6, 7 + ] +array[0:4] = ["a","b"] + +if len( array ) != 6 : failure( "smaller array (begin) - len" ) +if array[2] != 4: failure( "smaller array (begin) - surround" ) +if array[0] != "a" or array[1] != "b": failure( "smaller array (begin) - items" ) + +array = [ 0, 1, 2, + 3, 4, 5, + 6, 7 + ] +array[3:0] = ["a","b"] + +if len( array ) != 6 : failure( "smaller array (begin) reverse - len" ) +if array[2] != 4: failure( "smaller array (begin) reverse - surround" ) +if array[0] != "a" or array[1] != "b": failure( "smaller array (begin) reverse - items" ) + +// at begin the middle +array = [ 0, 1, 2, + 3, 4, 5, + 6, 7 + ] +array[4:] = ["a","b"] + +if len( array ) != 6 : failure( "smaller array (end) - len" ) +if array[3] != 3: failure( "smaller array (end) - surround" ) +if array[4] != "a" or array[5] != "b": failure( "smaller array (end) - items" ) + +//========================================= +// Substitute with a larger array +// + +// in the middle +array = [ 0, 1, 2, + 3, 4, 5, + 6, 7 + ] +array[2:4] = ["a","b","c"] + +if len( array ) != 9 : failure( "larger array - len" ) +if array[1] != 1 or array[6] != 5: failure( "Range larger smaller array - surround" ) +if array[2] != "a" or array[4] != "c": failure( "larger array - items" ) + +array = [ 0, 1, 2, + 3, 4, 5, + 6, 7 + ] +array[3:2] = ["a","b","c"] + +if len( array ) != 9 : failure( "larger array reverse - len" ) +if array[1] != 1 or array[6] != 5: failure( "Range larger smaller array reverse - surround" ) +if array[2] != "a" or array[4] != "c": failure( "larger array reverse - items" ) + +// at begin the middle +array = [ 0, 1, 2, + 3, 4, 5, + 6, 7 + ] +array[0:2] = ["a","b","c"] + +if len( array ) != 9 : failure( "larger array (begin) - len" ) +if array[3] != 2: failure( "larger array (begin) - surround" ) +if array[0] != "a" or array[2] != "c": failure( "larger array (begin) - items" ) + +array = [ 0, 1, 2, + 3, 4, 5, + 6, 7 + ] +array[1:0] = ["a","b","c"] + +if len( array ) != 9 : failure( "larger array (begin) reverse - len" ) +if array[3] != 2: failure( "larger array (begin) reverse - surround" ) +if array[0] != "a" or array[2] != "c": failure( "larger array (begin) reverse - items" ) + +// at begin the middle +array = [ 0, 1, 2, + 3, 4, 5, + 6, 7 + ] +array[6:] = ["a","b","c"] + +if len( array ) != 9 : failure( "larger array (end) - len" ) +if array[5] != 5: failure( "larger array (end) - surround" ) +if array[6] != "a" or array[8] != "c": failure( "larger array (end) - items" ) + +success() + +/* End of file */ diff -Nru /tmp/qLlpeOGf0f/falconpl-0.9.1.8/core/tests/testsuite/arrsubs.fal /tmp/Y4mp0W3rzG/falconpl-0.9.2/core/tests/testsuite/arrsubs.fal --- falconpl-0.9.1.8/core/tests/testsuite/arrsubs.fal 2008-11-27 22:33:48.000000000 +0000 +++ falconpl-0.9.2/core/tests/testsuite/arrsubs.fal 2009-06-19 12:01:44.000000000 +0100 @@ -1,89 +1,89 @@ -/**************************************************************************** -* Falcon test suite -* -* -* ID: 11j -* Category: types -* Subcategory: array -* Short: Ranged subscripts. -* Description: -* Check ranged subscription access to array. -* This check is complete of positive and negative ranged tests. -* [/Description] -* -****************************************************************************/ - -array = [ 0, 1, 2, - 3, 4, 5, - 6, 7 - ] - -// get an empty range -a1 = array[0:0] -if len( a1 ) != 0: failure( "Get Empty range" ) - -// Get whole open range. -a1 = array[0:] -if len( a1 ) != 8: failure( "Get Full range - len" ) -for i in [0:len(a1)] - if a1[i] != array[i]: failure( "Get Full range - item " + i ) -end - -// direct range -- 1 item -a1 = array[2:3] -if len( a1 ) != 1: failure( "Get 1 item - len" ) -if a1[0] != 2: failure( "Get 1 item - value" ) - -// direct range -- more items -a1 = array[2:5] -if len( a1 ) != 3: failure( "Get more elements - len" ) -if a1[0] != 2 or a1[-1] != 4: failure( "Get more elements - value" ) - -// Reverse range -- full -a1 = array[-1:0] -if len( a1 ) != 8: failure( "Reverse range full - len" ) -for i in [0:len(a1)] - if a1[i] != array[len(a1)-i-1]: failure( "Reverse range full - item " + i ) -end - -// Reverse range -- partial -a1 = array[5:4] -if len( a1 ) != 2: failure( "Reverse range - len" ) -if a1[0] != array[5] or a1[1] != array[4]: failure( "Reverse range - items" ) - -// Direct range with negative index -a1 = array[-5:-4] -if len( a1 ) != 1: failure( "Dirct range neg - len(1)" ) -if a1[0] != array[-5]: failure( "Dirct range - items(1)" ) - -// Direct range with negative index -a1 = array[-5:-3] -if len( a1 ) != 2: failure( "Dirct range neg - len(2)" ) -if a1[0] != array[-5] or a1[1] != array[-4]: failure( "Dirct range - items(2)" ) - -// Reverse range with negative index -a1 = array[-3:-5] -if len( a1 ) != 3: failure( "Reverse range neg - len(3)" ) -if a1[0] != array[-3] or a1[2] != array[-5]: failure( "Dirct range - items(3)" ) - -// Reverse range open -a1 = array[-5:] -if len( a1 ) != 5: failure( "Reverse range open - len" ) -if a1[4] != 7 or a1[0] != 3: failure( "Reverse range open - items" ) - -// Reverse range open -- empty -a1 = array[-1:] -if len( a1 ) != 1: failure( "Reverse range open last" ) -if a1[0] != 7: failure( "Reverse range open last - item" ) - -a1 = array[-5:-5] -if len( a1 ) != 0: failure( "Negative empty" ) -a1 = array[3:-5] -if len( a1 ) != 0: failure( "Negative empty x:-x" ) -a1 = array[-5:3] -if len( a1 ) != 0: failure( "Negative empty -x:x" ) - - -success() - -/* End of file */ +/**************************************************************************** +* Falcon test suite +* +* +* ID: 11j +* Category: types +* Subcategory: array +* Short: Ranged subscripts. +* Description: +* Check ranged subscription access to array. +* This check is complete of positive and negative ranged tests. +* [/Description] +* +****************************************************************************/ + +array = [ 0, 1, 2, + 3, 4, 5, + 6, 7 + ] + +// get an empty range +a1 = array[0:0] +if len( a1 ) != 0: failure( "Get Empty range" ) + +// Get whole open range. +a1 = array[0:] +if len( a1 ) != 8: failure( "Get Full range - len" ) +for i in [0:len(a1)] + if a1[i] != array[i]: failure( "Get Full range - item " + i ) +end + +// direct range -- 1 item +a1 = array[2:3] +if len( a1 ) != 1: failure( "Get 1 item - len" ) +if a1[0] != 2: failure( "Get 1 item - value" ) + +// direct range -- more items +a1 = array[2:5] +if len( a1 ) != 3: failure( "Get more elements - len" ) +if a1[0] != 2 or a1[-1] != 4: failure( "Get more elements - value" ) + +// Reverse range -- full +a1 = array[-1:0] +if len( a1 ) != 8: failure( "Reverse range full - len" ) +for i in [0:len(a1)] + if a1[i] != array[len(a1)-i-1]: failure( "Reverse range full - item " + i ) +end + +// Reverse range -- partial +a1 = array[5:4] +if len( a1 ) != 2: failure( "Reverse range - len" ) +if a1[0] != array[5] or a1[1] != array[4]: failure( "Reverse range - items" ) + +// Direct range with negative index +a1 = array[-5:-4] +if len( a1 ) != 1: failure( "Dirct range neg - len(1)" ) +if a1[0] != array[-5]: failure( "Dirct range - items(1)" ) + +// Direct range with negative index +a1 = array[-5:-3] +if len( a1 ) != 2: failure( "Dirct range neg - len(2)" ) +if a1[0] != array[-5] or a1[1] != array[-4]: failure( "Dirct range - items(2)" ) + +// Reverse range with negative index +a1 = array[-3:-5] +if len( a1 ) != 3: failure( "Reverse range neg - len(3)" ) +if a1[0] != array[-3] or a1[2] != array[-5]: failure( "Dirct range - items(3)" ) + +// Reverse range open +a1 = array[-5:] +if len( a1 ) != 5: failure( "Reverse range open - len" ) +if a1[4] != 7 or a1[0] != 3: failure( "Reverse range open - items" ) + +// Reverse range open -- empty +a1 = array[-1:] +if len( a1 ) != 1: failure( "Reverse range open last" ) +if a1[0] != 7: failure( "Reverse range open last - item" ) + +a1 = array[-5:-5] +if len( a1 ) != 0: failure( "Negative empty" ) +a1 = array[3:-5] +if len( a1 ) != 0: failure( "Negative empty x:-x" ) +a1 = array[-5:3] +if len( a1 ) != 0: failure( "Negative empty -x:x" ) + + +success() + +/* End of file */ diff -Nru /tmp/qLlpeOGf0f/falconpl-0.9.1.8/core/tests/testsuite/dirtest.fal /tmp/Y4mp0W3rzG/falconpl-0.9.2/core/tests/testsuite/dirtest.fal --- falconpl-0.9.1.8/core/tests/testsuite/dirtest.fal 2009-03-15 15:02:51.000000000 +0000 +++ falconpl-0.9.2/core/tests/testsuite/dirtest.fal 2009-06-19 12:01:44.000000000 +0100 @@ -48,7 +48,7 @@ filelen[ "four" ] = file.tell() file.close() - dir = DirectoryOpen( "." ) + dir = Directory( "." ) element = dir.read() stats = FileStat() while element != nil diff -Nru /tmp/qLlpeOGf0f/falconpl-0.9.1.8/core/tests/testsuite/forin_dict.fal /tmp/Y4mp0W3rzG/falconpl-0.9.2/core/tests/testsuite/forin_dict.fal --- falconpl-0.9.1.8/core/tests/testsuite/forin_dict.fal 2008-11-23 16:10:48.000000000 +0000 +++ falconpl-0.9.2/core/tests/testsuite/forin_dict.fal 2009-06-19 12:01:44.000000000 +0100 @@ -1,48 +1,48 @@ -/**************************************************************************** -* Falcon test suite -* -* -* ID: 15q -* Category: loops -* Subcategory: forin -* Short: Forin dictionary complete -* Description: -* Tests forfirst, forlast, formiddle, continue dropping and assignments -* in dictionaries all in one step. -* [/Description] -* -****************************************************************************/ - -dict = [ "alpha" => 1, - "beta" => 2, - "gamma" => 3, - "delta" => 4, - "eta" => 5 ] - - -result = "" - -for key, value in dict - forfirst: result += "f:" - - if value % 2 == 1 - continue dropping - end - - result += key + "=" + value.toString() - - .= "Changed" - - formiddle: result += "," - forlast: result += "." -end - -if result != "f:beta=2,delta=4,.": failure( "In looping" ) - -if dict.len() != 2: failure( "In dropping" ) - -for key, value in dict - if value != "Changed": failure( "In touching key: " + key ) -end - -/* end of file */ +/**************************************************************************** +* Falcon test suite +* +* +* ID: 15q +* Category: loops +* Subcategory: forin +* Short: Forin dictionary complete +* Description: +* Tests forfirst, forlast, formiddle, continue dropping and assignments +* in dictionaries all in one step. +* [/Description] +* +****************************************************************************/ + +dict = [ "alpha" => 1, + "beta" => 2, + "gamma" => 3, + "delta" => 4, + "eta" => 5 ] + + +result = "" + +for key, value in dict + forfirst: result += "f:" + + if value % 2 == 1 + continue dropping + end + + result += key + "=" + value.toString() + + .= "Changed" + + formiddle: result += "," + forlast: result += "." +end + +if result != "f:beta=2,delta=4,.": failure( "In looping" ) + +if dict.len() != 2: failure( "In dropping" ) + +for key, value in dict + if value != "Changed": failure( "In touching key: " + key ) +end + +/* end of file */ diff -Nru /tmp/qLlpeOGf0f/falconpl-0.9.1.8/core/tests/testsuite/forin_range.fal /tmp/Y4mp0W3rzG/falconpl-0.9.2/core/tests/testsuite/forin_range.fal --- falconpl-0.9.1.8/core/tests/testsuite/forin_range.fal 2008-11-23 16:10:48.000000000 +0000 +++ falconpl-0.9.2/core/tests/testsuite/forin_range.fal 2009-06-19 21:16:40.000000000 +0100 @@ -139,6 +139,20 @@ if result != -1 +1+2+3+4 : failure( "Filled range, mixed down - value" ) if count != 6: failure( "Filled range, mixed down - times" ) +//=================================================== +// Test for negative empty loop + +result = 0 +count = 0 + +for c in [5: 5:-1] + result += c + count++ +end + +if result != 5: failure( "Empty downto range - value" ) +if count != 1: failure( "Empty downto range - times" ) + success() /* End of file */ diff -Nru /tmp/qLlpeOGf0f/falconpl-0.9.1.8/core/tests/testsuite/func_brigade.fal /tmp/Y4mp0W3rzG/falconpl-0.9.2/core/tests/testsuite/func_brigade.fal --- falconpl-0.9.1.8/core/tests/testsuite/func_brigade.fal 1970-01-01 01:00:00.000000000 +0100 +++ falconpl-0.9.2/core/tests/testsuite/func_brigade.fal 2009-06-19 12:01:44.000000000 +0100 @@ -0,0 +1,48 @@ +/**************************************************************************** +* Falcon test suite +* +* ID: 63b +* Category: functional +* Subcategory: constructs +* Short: Brigade +* Description: +* Checks if the "brigade" function is correctly working. +* [/Description] +* +****************************************************************************/ + +function mean( array ) + value = 0 + for elem in array: value += elem + return value / len( array ) +end + +function dbl( array ) + for i in [0:len(array)]: array[i] *= 2 +end + +doubleMean = .[ brigade .[ + dbl + mean +]] + +if doubleMean( [1,2,3] ) != 4: failure( "Simple brigade" ) + +sum = 0 +looper = .[brigade + .[ + { val, text => sum += val; return 0} + // or even change them via out-of-band + { val, text => oob( [val+1, "Changed"] ) } + // and ask repetition via out-of-band + // or return something at the end. + { val, text => + val < 10 ? oob(1): "Completed." } + ] +] + +final = looper( 1, "Original" ) +if sum != 1+2+3+4+5+6+7+8+9: failure( "looping" ) +if final != "Completed.": failure( "return value" ) + +success() diff -Nru /tmp/qLlpeOGf0f/falconpl-0.9.1.8/core/tests/testsuite/future_eval.fal /tmp/Y4mp0W3rzG/falconpl-0.9.2/core/tests/testsuite/future_eval.fal --- falconpl-0.9.1.8/core/tests/testsuite/future_eval.fal 2009-03-25 17:42:57.000000000 +0000 +++ falconpl-0.9.2/core/tests/testsuite/future_eval.fal 2009-06-19 12:01:44.000000000 +0100 @@ -1,50 +1,50 @@ -/**************************************************************************** -* Falcon test suite -* -* ID: 73b -* Category: functional -* Subcategory: fbind -* Short: Future bindings in eval -* Description: -* Evaluation and future bindings require a slighly different management. -* Testing them here. -* [/Description] -* -****************************************************************************/ - -function makepair( zp, vp ) - return [zp, vp] -end - -// First check that everything is fine. -a = .[makepair vp|"b" zp|"a" ] -ret = a() -if ret[0] != "a" or ret[1] != "b": failure( "Smoke test" ) - -// Let's try an evaluation. -ret = eval(a) -if ret[0] != "a" or ret[1] != "b": failure( "eval basic" ) - -v = nil -b = .[let $v a] -eval( b ) -if v[0] != "a" or v[1] != "b": failure( "eval through let" ) - -// More indirect evaluation -vp = lbind( "vp", "b" ) -zp = lbind( "zp", "a" ) -a = .[makepair vp zp ] -b = .[let $v a] -eval( b ) -if v[0] != "a" or v[1] != "b": failure( "eval deep - precalc" ) - -// More indirect evaluation -v = 0 -a = .[makepair .[lbind "vp", "b"] .[lbind "zp", "a"] ] -b = .[let $v a] -eval( b ) -if v[0] != "a" or v[1] != "b": failure( "eval deep" ) - -success() - -/* end of file */ +/**************************************************************************** +* Falcon test suite +* +* ID: 73b +* Category: functional +* Subcategory: fbind +* Short: Future bindings in eval +* Description: +* Evaluation and future bindings require a slighly different management. +* Testing them here. +* [/Description] +* +****************************************************************************/ + +function makepair( zp, vp ) + return [zp, vp] +end + +// First check that everything is fine. +a = .[makepair vp|"b" zp|"a" ] +ret = a() +if ret[0] != "a" or ret[1] != "b": failure( "Smoke test" ) + +// Let's try an evaluation. +ret = eval(a) +if ret[0] != "a" or ret[1] != "b": failure( "eval basic" ) + +v = nil +b = .[let $v a] +eval( b ) +if v[0] != "a" or v[1] != "b": failure( "eval through let" ) + +// More indirect evaluation +vp = lbind( "vp", "b" ) +zp = lbind( "zp", "a" ) +a = .[makepair vp zp ] +b = .[let $v a] +eval( b ) +if v[0] != "a" or v[1] != "b": failure( "eval deep - precalc" ) + +// More indirect evaluation +v = 0 +a = .[makepair .[lbind "vp", "b"] .[lbind "zp", "a"] ] +b = .[let $v a] +eval( b ) +if v[0] != "a" or v[1] != "b": failure( "eval deep" ) + +success() + +/* end of file */ diff -Nru /tmp/qLlpeOGf0f/falconpl-0.9.1.8/core/tests/testsuite/import_alias.fal /tmp/Y4mp0W3rzG/falconpl-0.9.2/core/tests/testsuite/import_alias.fal --- falconpl-0.9.1.8/core/tests/testsuite/import_alias.fal 2008-10-17 22:20:35.000000000 +0100 +++ falconpl-0.9.2/core/tests/testsuite/import_alias.fal 2009-06-19 12:01:44.000000000 +0100 @@ -1,30 +1,30 @@ -/**************************************************************************** -* Falcon test suite -* -* -* ID: 53b -* Category: modloader -* Subcategory: import -* Short: Mixed import/from test -* Description: -* Test for importin the same symbol from a normal sub test with alias. -* [/Description] -* -****************************************************************************/ -// named import -import test1 from import_sub_1 - -// aliased import -import test1 from import_sub_1 in alias - -if import_sub_1.test1() != "Hello world" - failure( "Non aliased test" ) -end - -if alias.test1() != "Hello world" - failure( "Aliased test" ) -end - -success() - -/* End of file */ +/**************************************************************************** +* Falcon test suite +* +* +* ID: 53b +* Category: modloader +* Subcategory: import +* Short: Mixed import/from test +* Description: +* Test for importin the same symbol from a normal sub test with alias. +* [/Description] +* +****************************************************************************/ +// named import +import test1 from import_sub_1 + +// aliased import +import test1 from import_sub_1 in alias + +if import_sub_1.test1() != "Hello world" + failure( "Non aliased test" ) +end + +if alias.test1() != "Hello world" + failure( "Aliased test" ) +end + +success() + +/* End of file */ diff -Nru /tmp/qLlpeOGf0f/falconpl-0.9.1.8/core/tests/testsuite/import_double.fal /tmp/Y4mp0W3rzG/falconpl-0.9.2/core/tests/testsuite/import_double.fal --- falconpl-0.9.1.8/core/tests/testsuite/import_double.fal 2008-10-17 22:20:35.000000000 +0100 +++ falconpl-0.9.2/core/tests/testsuite/import_double.fal 2009-06-19 12:01:44.000000000 +0100 @@ -1,31 +1,31 @@ -/**************************************************************************** -* Falcon test suite -* -* -* ID: 53c -* Category: modloader -* Subcategory: import -* Short: Export discarding import/from test -* Description: -* Testing export request discarding. This program imports the same -* exported symbol from import_sub_2 and import_sub_3. -* [/Description] -* -****************************************************************************/ -// named import -import test1 from import_sub_2 in first - -// aliased import -import test1 from import_sub_3 in second - -if first.test1() != "From sub2" - failure( "import test1 from import_sub_2 = first" ) -end - -if second.test1() != "From sub3" - failure( "import test1 from import_sub_3 = second" ) -end - -success() - -/* End of file */ +/**************************************************************************** +* Falcon test suite +* +* +* ID: 53c +* Category: modloader +* Subcategory: import +* Short: Export discarding import/from test +* Description: +* Testing export request discarding. This program imports the same +* exported symbol from import_sub_2 and import_sub_3. +* [/Description] +* +****************************************************************************/ +// named import +import test1 from import_sub_2 in first + +// aliased import +import test1 from import_sub_3 in second + +if first.test1() != "From sub2" + failure( "import test1 from import_sub_2 = first" ) +end + +if second.test1() != "From sub3" + failure( "import test1 from import_sub_3 = second" ) +end + +success() + +/* End of file */ diff -Nru /tmp/qLlpeOGf0f/falconpl-0.9.1.8/core/tests/testsuite/import_simple.fal /tmp/Y4mp0W3rzG/falconpl-0.9.2/core/tests/testsuite/import_simple.fal --- falconpl-0.9.1.8/core/tests/testsuite/import_simple.fal 2008-07-29 10:21:28.000000000 +0100 +++ falconpl-0.9.2/core/tests/testsuite/import_simple.fal 2009-06-19 12:01:44.000000000 +0100 @@ -1,23 +1,23 @@ -/**************************************************************************** -* Falcon test suite -* -* -* ID: 53a -* Category: modloader -* Subcategory: import -* Short: Basic import/from test -* Description: -* This is a minimal test trying to import symbols by name from a submodule. -* [/Description] -* -****************************************************************************/ -// named import -import test1 from import_sub_1 - -if import_sub_1.test1() != "Hello world" - failure( "Module import failed" ) -end - -success() - -/* End of file */ +/**************************************************************************** +* Falcon test suite +* +* +* ID: 53a +* Category: modloader +* Subcategory: import +* Short: Basic import/from test +* Description: +* This is a minimal test trying to import symbols by name from a submodule. +* [/Description] +* +****************************************************************************/ +// named import +import test1 from import_sub_1 + +if import_sub_1.test1() != "Hello world" + failure( "Module import failed" ) +end + +success() + +/* End of file */ diff -Nru /tmp/qLlpeOGf0f/falconpl-0.9.1.8/core/tests/testsuite/import_spaced.fal /tmp/Y4mp0W3rzG/falconpl-0.9.2/core/tests/testsuite/import_spaced.fal --- falconpl-0.9.1.8/core/tests/testsuite/import_spaced.fal 2009-04-26 16:42:17.000000000 +0100 +++ falconpl-0.9.2/core/tests/testsuite/import_spaced.fal 2009-06-19 12:01:44.000000000 +0100 @@ -1,26 +1,26 @@ -/**************************************************************************** -* Falcon test suite -* -* -* ID: 53f -* Category: modloader -* Subcategory: import -* Short: Import from spaced subdir. -* Description: -* Subdirectories with spaces are escaped to "n+m" in URI format traveling in -* the modloader data. The DLL loader must back-escape it (or the module -* loader must unescape it) before system request is tried. -* -* [/Description] -* -****************************************************************************/ -// named with self -import test1 from "Import spaced/imported.fal" in imported - -if imported.test1() != "From test1" - failure( "import test1 from import_self = first" ) -end - -success() - -/* End of file */ +/**************************************************************************** +* Falcon test suite +* +* +* ID: 53f +* Category: modloader +* Subcategory: import +* Short: Import from spaced subdir. +* Description: +* Subdirectories with spaces are escaped to "n+m" in URI format traveling in +* the modloader data. The DLL loader must back-escape it (or the module +* loader must unescape it) before system request is tried. +* +* [/Description] +* +****************************************************************************/ +// named with self +import test1 from "Import spaced/imported.fal" in imported + +if imported.test1() != "From test1" + failure( "import test1 from import_self = first" ) +end + +success() + +/* End of file */ diff -Nru /tmp/qLlpeOGf0f/falconpl-0.9.1.8/core/tests/testsuite/import_sub_1.fal /tmp/Y4mp0W3rzG/falconpl-0.9.2/core/tests/testsuite/import_sub_1.fal --- falconpl-0.9.1.8/core/tests/testsuite/import_sub_1.fal 2008-07-29 10:21:28.000000000 +0100 +++ falconpl-0.9.2/core/tests/testsuite/import_sub_1.fal 2009-06-19 12:01:44.000000000 +0100 @@ -1,19 +1,19 @@ -/**************************************************************************** -* Falcon test suite -* -* -* ID: -- -* Category: modloader -* Subcategory: import -* Short: Basic import/from test (component) -* Description: -* Submodule used by import_simple and other tests. -* [/Description] -* -****************************************************************************/ - -function test1() - return "Hello world" -end - -/* End of file */ +/**************************************************************************** +* Falcon test suite +* +* +* ID: -- +* Category: modloader +* Subcategory: import +* Short: Basic import/from test (component) +* Description: +* Submodule used by import_simple and other tests. +* [/Description] +* +****************************************************************************/ + +function test1() + return "Hello world" +end + +/* End of file */ diff -Nru /tmp/qLlpeOGf0f/falconpl-0.9.1.8/core/tests/testsuite/import_sub_2.fal /tmp/Y4mp0W3rzG/falconpl-0.9.2/core/tests/testsuite/import_sub_2.fal --- falconpl-0.9.1.8/core/tests/testsuite/import_sub_2.fal 2008-07-29 10:21:28.000000000 +0100 +++ falconpl-0.9.2/core/tests/testsuite/import_sub_2.fal 2009-06-19 12:01:44.000000000 +0100 @@ -1,21 +1,21 @@ -/**************************************************************************** -* Falcon test suite -* -* -* ID: -- -* Category: modloader -* Subcategory: import -* Short: Basic import/from test (component) -* Description: -* Submodule used by import_* test. -* [/Description] -* -****************************************************************************/ - -function test1() - return "From sub2" -end - -export - -/* End of file */ +/**************************************************************************** +* Falcon test suite +* +* +* ID: -- +* Category: modloader +* Subcategory: import +* Short: Basic import/from test (component) +* Description: +* Submodule used by import_* test. +* [/Description] +* +****************************************************************************/ + +function test1() + return "From sub2" +end + +export + +/* End of file */ diff -Nru /tmp/qLlpeOGf0f/falconpl-0.9.1.8/core/tests/testsuite/import_sub_3.fal /tmp/Y4mp0W3rzG/falconpl-0.9.2/core/tests/testsuite/import_sub_3.fal --- falconpl-0.9.1.8/core/tests/testsuite/import_sub_3.fal 2008-07-29 10:21:28.000000000 +0100 +++ falconpl-0.9.2/core/tests/testsuite/import_sub_3.fal 2009-06-19 12:01:44.000000000 +0100 @@ -1,21 +1,21 @@ -/**************************************************************************** -* Falcon test suite -* -* -* ID: -- -* Category: modloader -* Subcategory: import -* Short: Basic import/from test (component) -* Description: -* Submodule used by import_* test. -* [/Description] -* -****************************************************************************/ - -function test1() - return "From sub3" -end - -export - -/* End of file */ +/**************************************************************************** +* Falcon test suite +* +* +* ID: -- +* Category: modloader +* Subcategory: import +* Short: Basic import/from test (component) +* Description: +* Submodule used by import_* test. +* [/Description] +* +****************************************************************************/ + +function test1() + return "From sub3" +end + +export + +/* End of file */ diff -Nru /tmp/qLlpeOGf0f/falconpl-0.9.1.8/core/tests/testsuite/let.fal /tmp/Y4mp0W3rzG/falconpl-0.9.2/core/tests/testsuite/let.fal --- falconpl-0.9.1.8/core/tests/testsuite/let.fal 2009-03-25 17:42:57.000000000 +0000 +++ falconpl-0.9.2/core/tests/testsuite/let.fal 2009-06-19 12:01:44.000000000 +0100 @@ -1,28 +1,28 @@ -/**************************************************************************** -* Falcon test suite -* -* ID: 70b -* Category: functional -* Subcategory: constructs -* Short: let -* Description: -* Tests for let functional operator to work correctly -* [/Description] -* -****************************************************************************/ - -v = nil -let( $v, 0 ) -if v != 0: failure( "direct let" ) - -v = nil -let( $v, .[random 1 10] ) -if v == nil: failure( "indirect let" ) - -v = nil -eval( .[ let $v .[random 1 10] ] ) -if v == nil: failure( "evaluated let" ) - -success() - -/* end of file */ +/**************************************************************************** +* Falcon test suite +* +* ID: 70b +* Category: functional +* Subcategory: constructs +* Short: let +* Description: +* Tests for let functional operator to work correctly +* [/Description] +* +****************************************************************************/ + +v = nil +let( $v, 0 ) +if v != 0: failure( "direct let" ) + +v = nil +let( $v, .[random 1 10] ) +if v == nil: failure( "indirect let" ) + +v = nil +eval( .[ let $v .[random 1 10] ] ) +if v == nil: failure( "evaluated let" ) + +success() + +/* end of file */ diff -Nru /tmp/qLlpeOGf0f/falconpl-0.9.1.8/core/tests/testsuite/list_iter2.fal /tmp/Y4mp0W3rzG/falconpl-0.9.2/core/tests/testsuite/list_iter2.fal --- falconpl-0.9.1.8/core/tests/testsuite/list_iter2.fal 2007-12-18 22:08:34.000000000 +0000 +++ falconpl-0.9.2/core/tests/testsuite/list_iter2.fal 2009-06-19 12:01:44.000000000 +0100 @@ -22,7 +22,7 @@ // head insertion list = List( "a", "b", "c" ) iter = list.first() -list.insert( iter, "z" ) +iter.insert( "z" ) if list.len() != 4 or list.front() != "z": failure( "head insertion" ) // tail nsertion @@ -34,7 +34,7 @@ // middle insertion iter = list.first() iter.next() -list.insert( iter, "w" ) +iter.insert( "w" ) list.popFront() if list.front() != "w": failure( "Insertion in the middle" ) diff -Nru /tmp/qLlpeOGf0f/falconpl-0.9.1.8/core/tests/testsuite/oob.fal /tmp/Y4mp0W3rzG/falconpl-0.9.2/core/tests/testsuite/oob.fal --- falconpl-0.9.1.8/core/tests/testsuite/oob.fal 2007-11-30 22:40:38.000000000 +0000 +++ falconpl-0.9.2/core/tests/testsuite/oob.fal 2009-06-19 12:01:44.000000000 +0100 @@ -40,4 +40,9 @@ if isoob( item ): failure( "Oob remove" ) if item != arr[2]: failure( "Equality of different oob stated data" ) +if not isoob( oob( "String" ) ): failure( "Oob immediate string" ) +l = oob( "String" ) +if not isoob(l): failure( "Oob copied string" ) + +success() /* End of file */ diff -Nru /tmp/qLlpeOGf0f/falconpl-0.9.1.8/core/tests/testsuite/override_poop_call.fal /tmp/Y4mp0W3rzG/falconpl-0.9.2/core/tests/testsuite/override_poop_call.fal --- falconpl-0.9.1.8/core/tests/testsuite/override_poop_call.fal 2009-05-11 11:01:50.000000000 +0100 +++ falconpl-0.9.2/core/tests/testsuite/override_poop_call.fal 2009-06-19 12:01:44.000000000 +0100 @@ -1,27 +1,27 @@ -/**************************************************************************** -* Falcon test suite -* -* -* ID: 28f -* Category: poop -* Subcategory: override -* Short: Poop call override -* Description: -* Tests call operator overrides on classes. -* [/Description] -* -****************************************************************************/ - -x = bless([ - "inner" => nil, - - "call__" => function( data ); - self.inner = data; - return data.len(); - end -]) - -if x( "Hello" ) != 5: failure( "Override return" ) -if x.inner != "Hello": failure( "Override setting" ) - -success() +/**************************************************************************** +* Falcon test suite +* +* +* ID: 28f +* Category: poop +* Subcategory: override +* Short: Poop call override +* Description: +* Tests call operator overrides on classes. +* [/Description] +* +****************************************************************************/ + +x = bless([ + "inner" => nil, + + "call__" => function( data ); + self.inner = data; + return data.len(); + end +]) + +if x( "Hello" ) != 5: failure( "Override return" ) +if x.inner != "Hello": failure( "Override setting" ) + +success() diff -Nru /tmp/qLlpeOGf0f/falconpl-0.9.1.8/core/tests/testsuite/override_poop_cmp.fal /tmp/Y4mp0W3rzG/falconpl-0.9.2/core/tests/testsuite/override_poop_cmp.fal --- falconpl-0.9.1.8/core/tests/testsuite/override_poop_cmp.fal 2009-05-16 11:04:00.000000000 +0100 +++ falconpl-0.9.2/core/tests/testsuite/override_poop_cmp.fal 2009-06-19 12:01:44.000000000 +0100 @@ -1,122 +1,122 @@ -/**************************************************************************** -* Falcon test suite -* -* -* ID: 28g -* Category: poop -* Subcategory: override -* Short: Poop compare override -* Description: -* Tests comparation overrides on classes. -* [/Description] -* -****************************************************************************/ - -globalCompare = compareByNum - -o = bless([ - "name" => nil, - "numval" => 0, - "array" => [], - - "compare" => { addend => - return globalCompare( self, addend ); - } -]) - - -function compareByNum( o1, o2 ) - if o2 provides numval - return o1.numval - o2.numval - elif o2.typeId() == NumericType or o2.typeId() == IntegerType - return o1.numval - o2 - end - return nil // let the VM to order us. -end - -function compareByName( o1, o2 ) - if o2 provides name - return o1.name.compare( o2.name ) - elif o2.typeId() == StringType - return o1.name.compare( o2 ) - end - return nil // let the VM to order us. -end - -globalCompare = compareByNum - -// compare on numbers -o.name = "zero" -if o > 1: failure( "o > 1" ) -if not o < 1: failure( "o < 1" ) -if o >= 1: failure( "o >= 1" ) -if not o <= 1: failure( "o <= 1" ) -if o == 1: failure( "o == 1" ) -if not o != 1: failure( "o != 1" ) - -if o > 0: failure( "o > 0" ) -if o < 0: failure( "o < 0" ) -if not o >= 0: failure( "o >= 0" ) -if not o <= 0: failure( "o <= 0" ) -if not o == 0: failure( "o == 0" ) -if o != 0: failure( "o != 0" ) - -o1 = o.clone() -o1.name = "one" -o1.numval = 1 - -if o > o1: failure( "o > o1" ) -if not o < o1: failure( "o < o1" ) -if o >= o1: failure( "o >= o1" ) -if not o <= o1: failure( "o <= o1" ) -if o == o1: failure( "o == o1" ) -if not o != o1: failure( "o != o1" ) - -// Check for VM ordering in dicts -// names and creation mixed to force randomic order in VM -o_five = o.clone() -o_five.name = "five" -o_five.numval = 5 -o_two = o.clone() -o_two.name = "two" -o_two.numval = 2 -o_four = o.clone() -o_four.name = "four" -o_four.numval = 4 -o_three = o.clone() -o_three.name = "three" -o_three.numval = 3 - -dict = [ o1 => 1, o => 0, o_five => 5, o_four => 4, o_three => 3, o_two => 2 ] -res = [] -for k,v in dict - res += k -end - -if res[0] != o or \ - res[1] != o1 or \ - res[2] != o_two or \ - res[3] != o_three or \ - res[4] != o_four or \ - res[5] != o_five - failure( "Numeric ordering" ) -end - -// Now by name -globalCompare = compareByName -dict = [ o1 => 1, o => 0, o_five => 5, o_four => 4, o_three => 3, o_two => 2 ] - -res = [] -for k,v in dict - res += k -end -if res[0] != o_five or \ - res[1] != o_four or \ - res[2] != o1 or \ - res[3] != o_three or \ - res[4] != o_two or \ - res[5] != o - failure( "Name ordering" ) -end - -success() +/**************************************************************************** +* Falcon test suite +* +* +* ID: 28g +* Category: poop +* Subcategory: override +* Short: Poop compare override +* Description: +* Tests comparation overrides on classes. +* [/Description] +* +****************************************************************************/ + +globalCompare = compareByNum + +o = bless([ + "name" => nil, + "numval" => 0, + "array" => [], + + "compare" => { addend => + return globalCompare( self, addend ); + } +]) + + +function compareByNum( o1, o2 ) + if o2 provides numval + return o1.numval - o2.numval + elif o2.typeId() == NumericType or o2.typeId() == IntegerType + return o1.numval - o2 + end + return nil // let the VM to order us. +end + +function compareByName( o1, o2 ) + if o2 provides name + return o1.name.compare( o2.name ) + elif o2.typeId() == StringType + return o1.name.compare( o2 ) + end + return nil // let the VM to order us. +end + +globalCompare = compareByNum + +// compare on numbers +o.name = "zero" +if o > 1: failure( "o > 1" ) +if not o < 1: failure( "o < 1" ) +if o >= 1: failure( "o >= 1" ) +if not o <= 1: failure( "o <= 1" ) +if o == 1: failure( "o == 1" ) +if not o != 1: failure( "o != 1" ) + +if o > 0: failure( "o > 0" ) +if o < 0: failure( "o < 0" ) +if not o >= 0: failure( "o >= 0" ) +if not o <= 0: failure( "o <= 0" ) +if not o == 0: failure( "o == 0" ) +if o != 0: failure( "o != 0" ) + +o1 = o.clone() +o1.name = "one" +o1.numval = 1 + +if o > o1: failure( "o > o1" ) +if not o < o1: failure( "o < o1" ) +if o >= o1: failure( "o >= o1" ) +if not o <= o1: failure( "o <= o1" ) +if o == o1: failure( "o == o1" ) +if not o != o1: failure( "o != o1" ) + +// Check for VM ordering in dicts +// names and creation mixed to force randomic order in VM +o_five = o.clone() +o_five.name = "five" +o_five.numval = 5 +o_two = o.clone() +o_two.name = "two" +o_two.numval = 2 +o_four = o.clone() +o_four.name = "four" +o_four.numval = 4 +o_three = o.clone() +o_three.name = "three" +o_three.numval = 3 + +dict = [ o1 => 1, o => 0, o_five => 5, o_four => 4, o_three => 3, o_two => 2 ] +res = [] +for k,v in dict + res += k +end + +if res[0] != o or \ + res[1] != o1 or \ + res[2] != o_two or \ + res[3] != o_three or \ + res[4] != o_four or \ + res[5] != o_five + failure( "Numeric ordering" ) +end + +// Now by name +globalCompare = compareByName +dict = [ o1 => 1, o => 0, o_five => 5, o_four => 4, o_three => 3, o_two => 2 ] + +res = [] +for k,v in dict + res += k +end +if res[0] != o_five or \ + res[1] != o_four or \ + res[2] != o1 or \ + res[3] != o_three or \ + res[4] != o_two or \ + res[5] != o + failure( "Name ordering" ) +end + +success() diff -Nru /tmp/qLlpeOGf0f/falconpl-0.9.1.8/core/tests/testsuite/override_poop.fal /tmp/Y4mp0W3rzG/falconpl-0.9.2/core/tests/testsuite/override_poop.fal --- falconpl-0.9.1.8/core/tests/testsuite/override_poop.fal 2009-05-16 11:04:00.000000000 +0100 +++ falconpl-0.9.2/core/tests/testsuite/override_poop.fal 2009-06-19 12:01:44.000000000 +0100 @@ -1,132 +1,132 @@ -/**************************************************************************** -* Falcon test suite -* -* ID: 28e -* Category: poop -* Subcategory: override -* Short: Basic override -* Description: -* Tests basic operator overrides on classes. -* [/Description] -* -****************************************************************************/ - -GC.enable( false ) - -o = bless([ - "numval" => 0, - "array" => [], - - "add__" => function( addend ) - if addend provides numval - self.numval += addend.numval - elif addend.typeId() == NumericType or addend.typeId() == IntegerType - self.numval += addend - else - raise Error( 10001, "Wrong operands for add__", addend ) - end - return self - end, - - "sub__" => function( addend ) - if addend provides numval - self.numval -= addend.numval - elif addend.typeId() == NumericType or addend.typeId() == IntegerType - self.numval -= addend - else - raise Error( 10001, "Wrong operands for sub__", addend ) - end - return self - end, - - "mul__" => function( addend ) - if addend provides numval - self.numval *= addend.numval - elif addend.typeId() == NumericType or addend.typeId() == IntegerType - self.numval *= addend - else - raise Error( 10001, "Wrong operands for mul__", addend ) - end - return self - end, - - "div__" => function( addend ) - if addend provides numval - self.numval /= addend.numval - elif addend.typeId() == NumericType or addend.typeId() == IntegerType - self.numval /= addend - else - raise Error( 10001, "Wrong operands for div__", addend ) - end - return self - end, - - "mod__" => function( addend ) - if addend provides numval - self.numval %= addend.numval - elif addend.typeId() == NumericType or addend.typeId() == IntegerType - self.numval %= addend - else - raise Error( 10001, "Wrong operands for mod__", addend ) - end - return self - end, - - "pow__" => function( addend ) - if addend provides numval - self.numval **= addend.numval - elif addend.typeId() == NumericType or addend.typeId() == IntegerType - self.numval **= addend - else - raise Error( 10001, "Wrong operands for mod__", addend ) - end - return self - end, - - "neg__" => function() - return -self.numval - end, - - "inc__" => function() - return ++self.numval - end, - - "dec__" => function() - return --self.numval - end, - - "incpost__" => function() - return self.numval++ - end, - - "decpost__" => function() - return self.numval-- - end -]) - - -o += 10 -if o.numval != 10: failure( "Plus override" ) -o -= 1 -if o.numval != 9: failure( "Minus override" ) -o *= 2 -if o.numval != 18: failure( "Times override" ) -o /= 2 -if o.numval != 9: failure( "Div override" ) -o %= 4 -if o.numval != 1: failure( "Mod override" ) -o.numval = 2 -o = o ** 3 -if o.numval != 8: failure( "Pow override" ) - -if -o != -8: failure( "Neg override" ) -// prefix op will have the VM return the item itself -// no matter what we return from the method -if ++o != 9: failure( "Inc override" ) -if --o != 8: failure( "Dec override" ) -if o++ != 8: failure( "Inc override post - 1" ) -if o.numval != 9: failure( "Inc override post - 2" ) -if o-- != 9: failure( "Dec override post - 1" ) -if o.numval != 8: failure( "Dec override post - 2" ) - -success() +/**************************************************************************** +* Falcon test suite +* +* ID: 28e +* Category: poop +* Subcategory: override +* Short: Basic override +* Description: +* Tests basic operator overrides on classes. +* [/Description] +* +****************************************************************************/ + +GC.enable( false ) + +o = bless([ + "numval" => 0, + "array" => [], + + "add__" => function( addend ) + if addend provides numval + self.numval += addend.numval + elif addend.typeId() == NumericType or addend.typeId() == IntegerType + self.numval += addend + else + raise Error( 10001, "Wrong operands for add__", addend ) + end + return self + end, + + "sub__" => function( addend ) + if addend provides numval + self.numval -= addend.numval + elif addend.typeId() == NumericType or addend.typeId() == IntegerType + self.numval -= addend + else + raise Error( 10001, "Wrong operands for sub__", addend ) + end + return self + end, + + "mul__" => function( addend ) + if addend provides numval + self.numval *= addend.numval + elif addend.typeId() == NumericType or addend.typeId() == IntegerType + self.numval *= addend + else + raise Error( 10001, "Wrong operands for mul__", addend ) + end + return self + end, + + "div__" => function( addend ) + if addend provides numval + self.numval /= addend.numval + elif addend.typeId() == NumericType or addend.typeId() == IntegerType + self.numval /= addend + else + raise Error( 10001, "Wrong operands for div__", addend ) + end + return self + end, + + "mod__" => function( addend ) + if addend provides numval + self.numval %= addend.numval + elif addend.typeId() == NumericType or addend.typeId() == IntegerType + self.numval %= addend + else + raise Error( 10001, "Wrong operands for mod__", addend ) + end + return self + end, + + "pow__" => function( addend ) + if addend provides numval + self.numval **= addend.numval + elif addend.typeId() == NumericType or addend.typeId() == IntegerType + self.numval **= addend + else + raise Error( 10001, "Wrong operands for mod__", addend ) + end + return self + end, + + "neg__" => function() + return -self.numval + end, + + "inc__" => function() + return ++self.numval + end, + + "dec__" => function() + return --self.numval + end, + + "incpost__" => function() + return self.numval++ + end, + + "decpost__" => function() + return self.numval-- + end +]) + + +o += 10 +if o.numval != 10: failure( "Plus override" ) +o -= 1 +if o.numval != 9: failure( "Minus override" ) +o *= 2 +if o.numval != 18: failure( "Times override" ) +o /= 2 +if o.numval != 9: failure( "Div override" ) +o %= 4 +if o.numval != 1: failure( "Mod override" ) +o.numval = 2 +o = o ** 3 +if o.numval != 8: failure( "Pow override" ) + +if -o != -8: failure( "Neg override" ) +// prefix op will have the VM return the item itself +// no matter what we return from the method +if ++o != 9: failure( "Inc override" ) +if --o != 8: failure( "Dec override" ) +if o++ != 8: failure( "Inc override post - 1" ) +if o.numval != 9: failure( "Inc override post - 2" ) +if o-- != 9: failure( "Dec override post - 1" ) +if o.numval != 8: failure( "Dec override post - 2" ) + +success() diff -Nru /tmp/qLlpeOGf0f/falconpl-0.9.1.8/core/tests/testsuite/override_poop_square.fal /tmp/Y4mp0W3rzG/falconpl-0.9.2/core/tests/testsuite/override_poop_square.fal --- falconpl-0.9.1.8/core/tests/testsuite/override_poop_square.fal 2009-05-11 11:01:50.000000000 +0100 +++ falconpl-0.9.2/core/tests/testsuite/override_poop_square.fal 2009-06-19 12:01:44.000000000 +0100 @@ -1,44 +1,44 @@ -/**************************************************************************** -* Falcon test suite -* -* -* ID: 28h -* Category: poop -* Subcategory: override -* Short: POOP square accessor override -* Description: -* Checks for overriding the [N] accessor -* [/Description] -* -****************************************************************************/ - -x = bless([ - "inner" => [nil, nil, nil], - - "setIndex__" => function( pos, data ); - if typeOf( pos ) == StringType; - self.set( pos, data ); - else; - (self.inner)[pos] = data; - end; - return data; - end, - - "getIndex__" => function( pos ); - if typeOf( pos ) == StringType; - return self.get( pos ); - else; - return self.inner[pos]; - end; - end -]) - -if (x[0] = 10) != 10: failure( "Override return" ) -if x[0] != 10: failure( "Override get" ) -if x[1] != nil: failure( "Override untouched" ) - -// test if we can add strings -x["hello"] = "world" -if x["hello"] != "world": failure( "set/get in [] accessor") - -success() +/**************************************************************************** +* Falcon test suite +* +* +* ID: 28h +* Category: poop +* Subcategory: override +* Short: POOP square accessor override +* Description: +* Checks for overriding the [N] accessor +* [/Description] +* +****************************************************************************/ + +x = bless([ + "inner" => [nil, nil, nil], + + "setIndex__" => function( pos, data ); + if typeOf( pos ) == StringType; + self.set( pos, data ); + else; + (self.inner)[pos] = data; + end; + return data; + end, + + "getIndex__" => function( pos ); + if typeOf( pos ) == StringType; + return self.get( pos ); + else; + return self.inner[pos]; + end; + end +]) + +if (x[0] = 10) != 10: failure( "Override return" ) +if x[0] != 10: failure( "Override get" ) +if x[1] != nil: failure( "Override untouched" ) + +// test if we can add strings +x["hello"] = "world" +if x["hello"] != "world": failure( "set/get in [] accessor") + +success() diff -Nru /tmp/qLlpeOGf0f/falconpl-0.9.1.8/core/tests/testsuite/path_int.fal /tmp/Y4mp0W3rzG/falconpl-0.9.2/core/tests/testsuite/path_int.fal --- falconpl-0.9.1.8/core/tests/testsuite/path_int.fal 2009-04-26 16:42:17.000000000 +0100 +++ falconpl-0.9.2/core/tests/testsuite/path_int.fal 2009-06-19 12:01:44.000000000 +0100 @@ -1,51 +1,51 @@ -/**************************************************************************** -* Falcon test suite -* -* -* ID: 117c -* Category: rtl -* Subcategory: URI -* Short: String width mix in URIs -* Description: -* This test checks if URI and PATH classes can handle mixed width -* international character sequences. -* [/Description] -****************************************************************************/ - -// Wide->small -u = URI( "/国際/filename.dat", false ) -p = Path( u.path ) -p.file = p.file + "_fm" -p.extension = "ext" -u.path = p.path -if URI.decode( u.uri ) != "/国際/filename_fm.ext": failure( "small in wide" ) - -// shortening -p.location = "/t" -u.path = p.path -if URI.decode( u.uri ) != "/t/filename_fm.ext": failure( "reducing" ) - -// re-lenghtening -p.location = "/国際" -u.path = p.path -if URI.decode( u.uri ) != "/国際/filename_fm.ext": failure( "re-enlarging" ) - - - -// Small -> wide (shortening) -u = URI( "/test_with_a_long_path/filename.dat" ) -p = Path( u.path ) -p.location = "/国際" -p.file = p.file + "_fm" -p.extension = "ext" -u.path = p.path -if URI.decode( u.uri ) != "/国際/filename_fm.ext": failure( "enlarging reduced" ) - -// SMall->wide - lengthening -u = URI( "/t/filename.dat" ) -p = Path( u.path ) -p.location = "/国際" -p.file = p.file + "_fm" -p.extension = "ext" -u.path = p.path -if URI.decode( u.uri ) != "/国際/filename_fm.ext": failure( "enlarging wide" ) +/**************************************************************************** +* Falcon test suite +* +* +* ID: 117c +* Category: rtl +* Subcategory: URI +* Short: String width mix in URIs +* Description: +* This test checks if URI and PATH classes can handle mixed width +* international character sequences. +* [/Description] +****************************************************************************/ + +// Wide->small +u = URI( "/国際/filename.dat", false ) +p = Path( u.path ) +p.file = p.file + "_fm" +p.extension = "ext" +u.path = p.path +if URI.decode( u.uri ) != "/国際/filename_fm.ext": failure( "small in wide" ) + +// shortening +p.location = "/t" +u.path = p.path +if URI.decode( u.uri ) != "/t/filename_fm.ext": failure( "reducing" ) + +// re-lenghtening +p.location = "/国際" +u.path = p.path +if URI.decode( u.uri ) != "/国際/filename_fm.ext": failure( "re-enlarging" ) + + + +// Small -> wide (shortening) +u = URI( "/test_with_a_long_path/filename.dat" ) +p = Path( u.path ) +p.location = "/国際" +p.file = p.file + "_fm" +p.extension = "ext" +u.path = p.path +if URI.decode( u.uri ) != "/国際/filename_fm.ext": failure( "enlarging reduced" ) + +// SMall->wide - lengthening +u = URI( "/t/filename.dat" ) +p = Path( u.path ) +p.location = "/国際" +p.file = p.file + "_fm" +p.extension = "ext" +u.path = p.path +if URI.decode( u.uri ) != "/国際/filename_fm.ext": failure( "enlarging wide" ) diff -Nru /tmp/qLlpeOGf0f/falconpl-0.9.1.8/core/tests/testsuite/ss_stdout.fal /tmp/Y4mp0W3rzG/falconpl-0.9.2/core/tests/testsuite/ss_stdout.fal --- falconpl-0.9.1.8/core/tests/testsuite/ss_stdout.fal 2009-05-15 16:50:31.000000000 +0100 +++ falconpl-0.9.2/core/tests/testsuite/ss_stdout.fal 2009-06-19 12:01:44.000000000 +0100 @@ -1,34 +1,34 @@ -/**************************************************************************** -* Falcon test suite -* -* -* ID: 106b -* Category: rtl -* Subcategory: streams -* Short: Stdout on string stream -* Description: -* Testing the string stream. -* This checks for the string stream to respect stream copy semantic. -* We'll redirect the output steream to string stream, and then check -* if it is still accessible. -* [/Description] -* -****************************************************************************/ - -// empty string stream -stream = StringStream() -// store it as stdout -old = stdOut( stream ) - -// write to stdout ->> "Hello world" - -// reset stdout -stdOut( old ) -if stream.closeToString() != "Hello world" - failure( "not working" ) -end - -success() - -/* End of file */ +/**************************************************************************** +* Falcon test suite +* +* +* ID: 106b +* Category: rtl +* Subcategory: streams +* Short: Stdout on string stream +* Description: +* Testing the string stream. +* This checks for the string stream to respect stream copy semantic. +* We'll redirect the output steream to string stream, and then check +* if it is still accessible. +* [/Description] +* +****************************************************************************/ + +// empty string stream +stream = StringStream() +// store it as stdout +old = stdOut( stream ) + +// write to stdout +>> "Hello world" + +// reset stdout +stdOut( old ) +if stream.closeToString() != "Hello world" + failure( "not working" ) +end + +success() + +/* End of file */ diff -Nru /tmp/qLlpeOGf0f/falconpl-0.9.1.8/core/tests/testsuite/strEndsWith.fal /tmp/Y4mp0W3rzG/falconpl-0.9.2/core/tests/testsuite/strEndsWith.fal --- falconpl-0.9.1.8/core/tests/testsuite/strEndsWith.fal 1970-01-01 01:00:00.000000000 +0100 +++ falconpl-0.9.2/core/tests/testsuite/strEndsWith.fal 2009-06-19 21:12:31.000000000 +0100 @@ -0,0 +1,105 @@ +/**************************************************************************** +* Falcon test suite +* +* +* ID: 101r +* Category: rtl +* Subcategory: string +* Short: EndsWith +* Description: +* Testing the endsWith functions and method. +* [/Description] +* +****************************************************************************/ + +//================================================= +// Starts with - positive cases. +// + +if not strEndsWith( "abc", "c" ): failure( "Minimal match endsWith func" ) +if not strEndsWith( "abc", "bc" ): failure( "Double match endsWith func" ) +if not strEndsWith( "abc", "abc" ): failure( "Complete match endsWith func" ) + +if not strEndsWith( "abc", "" ): failure( "Zero match endsWith func" ) +if not strEndsWith( "", "" ): failure( "Double zero match endsWith func" ) + +//================================================= +// Starts with - negative cases. +// +if strEndsWith( "", "a" ): failure( "False positive 1 endsWith func" ) +if strEndsWith( "bcd", "a" ): failure( "False positive 2 endsWith func" ) +if strEndsWith( "bacd", "a" ): failure( "False positive 3 endsWith func" ) +if strEndsWith( "bacd", "abcd" ): failure( "False positive 4 endsWith func" ) +if strEndsWith( "abcd", "abcde" ): failure( "False positive 5 endsWith func" ) + +//================================================= +// Starts with - mixed case positive cases. +// + +if not strEndsWith( "abc", "C", true ): failure( "Minimal match mixed 1 endsWith func" ) +if not strEndsWith( "Abc", "c", true ): failure( "Minimal match mixed 2 endsWith func" ) +if not strEndsWith( "AbC", "bC", true ): failure( "Double match mixed endsWith func" ) +if not strEndsWith( "aBc", "AbC", true ): failure( "Complete match mixed endsWith func" ) + +if not strEndsWith( "abc", "", true ): failure( "Zero match endsWith func" ) +if not strEndsWith( "", "", true ): failure( "Double zero match endsWith func" ) + + +//================================================= +// METHOD Starts with - positive cases. +//================================================= + +//================================================= +// Starts with - positive cases. +// + +if not "abc".endsWith( "c" ): failure( "Minimal match endsWith method" ) +if not "abc".endsWith( "bc" ): failure( "Double match endsWith method" ) +if not "abc".endsWith( "abc" ): failure( "Complete match endsWith method" ) + +if not "abc".endsWith( "" ): failure( "Zero match endsWith method" ) +if not "".endsWith( "" ): failure( "Double zero match endsWith method" ) + +//================================================= +// Starts with - negative cases. +// +if "".endsWith( "a" ): failure( "False positive 1 endsWith method" ) +if "bcd".endsWith( "a" ): failure( "False positive 2 endsWith method" ) +if "bacd".endsWith( "a" ): failure( "False positive 3 endsWith method" ) +if "bacd".endsWith( "abcd" ): failure( "False positive 4 endsWith method" ) +if "abcd".endsWith( "abcde" ): failure( "False positive 5 endsWith method" ) + +//================================================= +// Starts with - mixed case positive cases. +// + +if not "abc".endsWith( "C", true ): failure( "Minimal match mixed 1 endsWith method" ) +if not "abc".endsWith( "c", true ): failure( "Minimal match mixed 2 endsWith method" ) +if not "abc".endsWith( "bC", true ): failure( "Double match mixed endsWith method" ) +if not "abc".endsWith( "AbC", true ): failure( "Complete match mixed endsWith method" ) + +if not "abc".endsWith( "", true ): failure( "Zero match endsWith method" ) +if not "".endsWith( "", true ): failure( "Double zero match endsWith method" ) + +//================================================= +// Parameter error control +// +try + strEndsWith( "abc", 88, true ) + failure( "Error not rised for param error in function 1" ) +catch ParamError +end + +try + strEndsWith( 88, "abc", true ) + failure( "Error not rised for param error in function 2" ) +catch ParamError +end + +try + "abc".endsWith( 88, true ) + failure( "Error not rised for param error in method" ) +catch ParamError +end + +success() diff -Nru /tmp/qLlpeOGf0f/falconpl-0.9.1.8/core/tests/testsuite/strMerge2.fal /tmp/Y4mp0W3rzG/falconpl-0.9.2/core/tests/testsuite/strMerge2.fal --- falconpl-0.9.1.8/core/tests/testsuite/strMerge2.fal 2009-05-07 17:23:35.000000000 +0100 +++ falconpl-0.9.2/core/tests/testsuite/strMerge2.fal 2009-06-19 12:01:44.000000000 +0100 @@ -1,31 +1,31 @@ -/**************************************************************************** -* Falcon test suite -* -* -* ID: 101p -* Category: rtl -* Subcategory: string -* Short: merge method on strings -* Description: -* Test on String.merge method. -* [/Description] -* -****************************************************************************/ - -if "".merge([]) != "": failure( "Full empty merge" ) -if ",".merge([]) !="": failure( "Void merge" ) -if "".merge(["a word"]) != "a word": failure( "merge single word" ) -if "".merge( [1] ) != "1": failure( "merge toString" ) -if "x".merge( [640, 480] ) != "640x480": failure( "merge with a string" ) -if "".merge( [640, 480] ) != "640480": failure( "merge without strings" ) -if " tok ".merge( ["single"] ) != "single": failure( "merge single token" ) -if " tok ".merge( ["alpha", 1, 2, "beta"] ) != \ - "alpha tok 1 tok 2 tok beta": failure( "merge token" ) - -// Multibyte -if ",".merge( ["安心", "しました"] ) != "安心,しました": failure( "merge multi mixed" ) -if "、".merge( ["安心", "しました"] ) != "安心、しました": failure( "merge multi pure" ) - -success() - -/* End of file */ +/**************************************************************************** +* Falcon test suite +* +* +* ID: 101p +* Category: rtl +* Subcategory: string +* Short: merge method on strings +* Description: +* Test on String.merge method. +* [/Description] +* +****************************************************************************/ + +if "".merge([]) != "": failure( "Full empty merge" ) +if ",".merge([]) !="": failure( "Void merge" ) +if "".merge(["a word"]) != "a word": failure( "merge single word" ) +if "".merge( [1] ) != "1": failure( "merge toString" ) +if "x".merge( [640, 480] ) != "640x480": failure( "merge with a string" ) +if "".merge( [640, 480] ) != "640480": failure( "merge without strings" ) +if " tok ".merge( ["single"] ) != "single": failure( "merge single token" ) +if " tok ".merge( ["alpha", 1, 2, "beta"] ) != \ + "alpha tok 1 tok 2 tok beta": failure( "merge token" ) + +// Multibyte +if ",".merge( ["安心", "しました"] ) != "安心,しました": failure( "merge multi mixed" ) +if "、".merge( ["安心", "しました"] ) != "安心、しました": failure( "merge multi pure" ) + +success() + +/* End of file */ diff -Nru /tmp/qLlpeOGf0f/falconpl-0.9.1.8/core/tests/testsuite/strStartsWith.fal /tmp/Y4mp0W3rzG/falconpl-0.9.2/core/tests/testsuite/strStartsWith.fal --- falconpl-0.9.1.8/core/tests/testsuite/strStartsWith.fal 1970-01-01 01:00:00.000000000 +0100 +++ falconpl-0.9.2/core/tests/testsuite/strStartsWith.fal 2009-06-19 21:12:31.000000000 +0100 @@ -0,0 +1,105 @@ +/**************************************************************************** +* Falcon test suite +* +* +* ID: 101q +* Category: rtl +* Subcategory: string +* Short: StartsWith +* Description: +* Testing the startsWith function and method. +* [/Description] +* +****************************************************************************/ + +//================================================= +// Starts with - positive cases. +// + +if not strStartsWith( "abc", "a" ): failure( "Minimal match startsWith func" ) +if not strStartsWith( "abc", "ab" ): failure( "Double match startsWith func" ) +if not strStartsWith( "abc", "abc" ): failure( "Complete match startsWith func" ) + +if not strStartsWith( "abc", "" ): failure( "Zero match startsWith func" ) +if not strStartsWith( "", "" ): failure( "Double zero match startsWith func" ) + +//================================================= +// Starts with - negative cases. +// +if strStartsWith( "", "a" ): failure( "False positive 1 startsWith func" ) +if strStartsWith( "bcd", "a" ): failure( "False positive 2 startsWith func" ) +if strStartsWith( "bacd", "a" ): failure( "False positive 3 startsWith func" ) +if strStartsWith( "bacd", "abcd" ): failure( "False positive 4 startsWith func" ) +if strStartsWith( "abcd", "abcde" ): failure( "False positive 5 startsWith func" ) + +//================================================= +// Starts with - mixed case positive cases. +// + +if not strStartsWith( "abc", "A", true ): failure( "Minimal match mixed 1 startsWith func" ) +if not strStartsWith( "Abc", "a", true ): failure( "Minimal match mixed 2 startsWith func" ) +if not strStartsWith( "Abc", "aB", true ): failure( "Double match mixed startsWith func" ) +if not strStartsWith( "aBc", "AbC", true ): failure( "Complete match mixed startsWith func" ) + +if not strStartsWith( "abc", "", true ): failure( "Zero match startsWith func" ) +if not strStartsWith( "", "", true ): failure( "Double zero match startsWith func" ) + + +//================================================= +// METHOD Starts with - positive cases. +//================================================= + +//================================================= +// Starts with - positive cases. +// + +if not "abc".startsWith( "a" ): failure( "Minimal match startsWith method" ) +if not "abc".startsWith( "ab" ): failure( "Double match startsWith method" ) +if not "abc".startsWith( "abc" ): failure( "Complete match startsWith method" ) + +if not "abc".startsWith( "" ): failure( "Zero match startsWith method" ) +if not "".startsWith( "" ): failure( "Double zero match startsWith method" ) + +//================================================= +// Starts with - negative cases. +// +if "".startsWith( "a" ): failure( "False positive 1 startsWith method" ) +if "bcd".startsWith( "a" ): failure( "False positive 2 startsWith method" ) +if "bacd".startsWith( "a" ): failure( "False positive 3 startsWith method" ) +if "bacd".startsWith( "abcd" ): failure( "False positive 4 startsWith method" ) +if "abcd".startsWith( "abcde" ): failure( "False positive 5 startsWith method" ) + +//================================================= +// Starts with - mixed case positive cases. +// + +if not "abc".startsWith( "A", true ): failure( "Minimal match mixed 1 startsWith method" ) +if not "abc".startsWith( "a", true ): failure( "Minimal match mixed 2 startsWith method" ) +if not "abc".startsWith( "aB", true ): failure( "Double match mixed startsWith method" ) +if not "abc".startsWith( "AbC", true ): failure( "Complete match mixed startsWith method" ) + +if not "abc".startsWith( "", true ): failure( "Zero match startsWith method" ) +if not "".startsWith( "", true ): failure( "Double zero match startsWith method" ) + +//================================================= +// Parameter error control +// +try + strStartsWith( "abc", 88, true ) + failure( "Error not rised for param error in function 1" ) +catch ParamError +end + +try + strStartsWith( 88, "abc", true ) + failure( "Error not rised for param error in function 2" ) +catch ParamError +end + +try + "abc".startsWith( 88, true ) + failure( "Error not rised for param error in method" ) +catch ParamError +end + +success() diff -Nru /tmp/qLlpeOGf0f/falconpl-0.9.1.8/core/TODO /tmp/Y4mp0W3rzG/falconpl-0.9.2/core/TODO --- falconpl-0.9.1.8/core/TODO 2009-05-09 22:00:18.000000000 +0100 +++ falconpl-0.9.2/core/TODO 2009-06-20 12:25:41.000000000 +0100 @@ -6,6 +6,7 @@ - Provide Stream interface to Sockets. - Add version prefix to include/ install - [Desiderata] Submodule-loading (i.e. load core=>strings) - - [Desiderata] Extra string functions. - [MINOR] Fix GC_init workaround for pure reflections. + - Native support for big numbers. + - Type contracts. diff -Nru /tmp/qLlpeOGf0f/falconpl-0.9.1.8/debian/changelog /tmp/Y4mp0W3rzG/falconpl-0.9.2/debian/changelog --- falconpl-0.9.1.8/debian/changelog 2009-07-05 07:12:09.000000000 +0100 +++ falconpl-0.9.2/debian/changelog 2009-07-05 07:12:09.000000000 +0100 @@ -1,3 +1,10 @@ +falconpl (0.9.2-0ubuntu1) karmic; urgency=low + + * New upstream release. LP: #394602 + * Standards-Version is 3.8.2. No changes needed. + + -- Bhavani Shankar Sun, 05 Jul 2009 11:21:11 +0530 + falconpl (0.9.1.8-0ubuntu1) karmic; urgency=low * New upstream release. diff -Nru /tmp/qLlpeOGf0f/falconpl-0.9.1.8/debian/control /tmp/Y4mp0W3rzG/falconpl-0.9.2/debian/control --- falconpl-0.9.1.8/debian/control 2009-07-05 07:12:09.000000000 +0100 +++ falconpl-0.9.2/debian/control 2009-07-05 07:12:09.000000000 +0100 @@ -3,7 +3,7 @@ Priority: optional Maintainer: Ubuntu MOTU Developers XSBC-Original-Maintainer: Giancarlo Niccolai -Standards-Version: 3.8.0 +Standards-Version: 3.8.2 Build-Depends: cmake (>= 2.0), debhelper (>= 5), bison (>= 1.8), diff -Nru /tmp/qLlpeOGf0f/falconpl-0.9.1.8/modules/feathers/ChangeLog /tmp/Y4mp0W3rzG/falconpl-0.9.2/modules/feathers/ChangeLog --- falconpl-0.9.1.8/modules/feathers/ChangeLog 2009-05-12 22:05:28.000000000 +0100 +++ falconpl-0.9.2/modules/feathers/ChangeLog 2009-06-20 12:25:30.000000000 +0100 @@ -1,9 +1,10 @@ -Feathers (0.9.1.7) +Feathers (0.9.2) * major: Added property launchAtLink and optional parameter "alias" to compiler module. * fixed: The RunTime used by the reflex compiler thought it had the main module. - + * added: globals() and exported() methods to Module. + Feathers (0.9.1.6) * minor: Added getName(), setName(), getSystemID() and toString() methods to thread. diff -Nru /tmp/qLlpeOGf0f/falconpl-0.9.1.8/modules/feathers/CMakeLists.txt /tmp/Y4mp0W3rzG/falconpl-0.9.2/modules/feathers/CMakeLists.txt --- falconpl-0.9.1.8/modules/feathers/CMakeLists.txt 2009-03-30 22:02:45.000000000 +0100 +++ falconpl-0.9.2/modules/feathers/CMakeLists.txt 2009-06-20 19:11:48.000000000 +0100 @@ -93,6 +93,17 @@ ELSE( WIN32 ) LINK_DIRECTORIES( "${FALCON_LIB_DIR}" ) + + #prepare RPATH to the final destination/lib dir + SET(CMAKE_SKIP_BUILD_RPATH TRUE) + SET(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE) + SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) + + IF ("${FALCON_RPATH}" STREQUAL "") + SET(CMAKE_INSTALL_RPATH "${FALCON_FINAL_DESTINATION}/${FALCON_FINAL_DESTINATION_LIB}") + ELSE ("${FALCON_RPATH}" STREQUAL "") + SET(CMAKE_INSTALL_RPATH "${FALCON_RPATH}") + ENDIF("${FALCON_RPATH}" STREQUAL "") ENDIF( WIN32 ) #Project directories diff -Nru /tmp/qLlpeOGf0f/falconpl-0.9.1.8/modules/feathers/compiler/compiler.cpp /tmp/Y4mp0W3rzG/falconpl-0.9.2/modules/feathers/compiler/compiler.cpp --- falconpl-0.9.1.8/modules/feathers/compiler/compiler.cpp 2009-05-12 21:57:09.000000000 +0100 +++ falconpl-0.9.2/modules/feathers/compiler/compiler.cpp 2009-06-19 12:07:14.000000000 +0100 @@ -43,7 +43,7 @@ configure, alter, and execute arbitrary parts of the loaded module as if it were coded internally to the loader script. - @section Example usages + @section compiler_sample_usage Example usages The following script shows how a source module may be compiled and executed on the fly. @@ -218,7 +218,8 @@ c_module->setWKS( true ); self->addClassProperty( c_module, "name" ); self->addClassProperty( c_module, "path" ); - + self->addClassMethod( c_module, "exported", &Falcon::Ext::Module_exported ); + self->addClassMethod( c_module, "globals", &Falcon::Ext::Module_globals ); self->addClassMethod( c_module, "get", &Falcon::Ext::Module_get ).asSymbol()-> addParam("symName"); self->addClassMethod( c_module, "set", &Falcon::Ext::Module_set ).asSymbol()-> diff -Nru /tmp/qLlpeOGf0f/falconpl-0.9.1.8/modules/feathers/compiler/compiler_ext.cpp /tmp/Y4mp0W3rzG/falconpl-0.9.2/modules/feathers/compiler/compiler_ext.cpp --- falconpl-0.9.1.8/modules/feathers/compiler/compiler_ext.cpp 2009-05-19 09:15:26.000000000 +0100 +++ falconpl-0.9.2/modules/feathers/compiler/compiler_ext.cpp 2009-06-19 12:07:14.000000000 +0100 @@ -154,6 +154,7 @@ rt.addModule( mod, true ); bool ll = vm->launchAtLink(); + LiveModule* lmod = 0; // avoid a re-throw in the fast-path if ( iface->launchAtLink() != ll ) @@ -161,7 +162,7 @@ vm->launchAtLink( iface->launchAtLink() ); try { - vm->link( &rt ); + lmod = vm->link( &rt ); vm->launchAtLink( ll ); } catch( ... ) @@ -171,7 +172,7 @@ } } else - vm->link( &rt ); + lmod = vm->link( &rt ); // ok, the module is up and running. // wrap it @@ -179,7 +180,7 @@ fassert( mod_class != 0 ); CoreObject *co = mod_class->asClass()->createInstance(); // we know the module IS in the VM. - co->setUserData( new ModuleCarrier( vm->findModule( mod->name() ) ) ); + co->setUserData( new ModuleCarrier( lmod ) ); co->setProperty( "name", mod->name() ); co->setProperty( "path", mod->path() ); @@ -362,11 +363,9 @@ .extra( "S,[S]" ) ); } - CompilerIface *iface = dyncast( vm->self().asObject() ); Module *mod = 0; - try { mod = iface->loader().loadFile( *i_name->asString() ); @@ -587,6 +586,90 @@ } /*# + @method globals Module + @brief Returns the list of global symbols available in this module. + @return An array containing all the global symbols. + + This method returns an array containing a list of strings, each one + representing a name of a global symbol exposed by this module. + + The symbol names can be then fed in @a Module.set and @a Module.get methods + to manipulate the symbols in the module. +*/ +FALCON_FUNC Module_globals( ::Falcon::VMachine *vm ) +{ + CoreObject *self = vm->self().asObject(); + ModuleCarrier *modc = static_cast( self->getUserData() ); + + // if the module is not alive, raise an error and exit + if ( modc == 0 || ! modc->liveModule()->isAlive() ) + { + vm->raiseModError( new AccessError( ErrorParam( FALCOMP_ERR_UNLOADED, __LINE__ ). + desc( FAL_STR( cmp_msg_unloaded ) ) ) ); + return; + } + + const SymbolTable *symtab = &modc->liveModule()->module()->symbolTable(); + CoreArray* ret = new CoreArray( symtab->size() ); + MapIterator iter = symtab->map().begin(); + while( iter.hasCurrent() ) + { + Symbol *sym = *(Symbol **) iter.currentValue(); + if ( ! sym->isUndefined() ) + ret->append( new CoreString(sym->name()) ); + // next symbol + iter.next(); + } + + vm->retval( ret ); +} + +/*# + @method exported Module + @brief Returns the list of exported symbols available in this module. + @return An array containing all the exported symbols. + + This method returns an array containing a list of strings, each one + representing a name of a global symbol exported by this module. + + The symbol names can be then fed in @a Module.set and @a Module.get methods + to manipulate the symbols in the module. + + Notice that exported symbols are ignored by the module loader; they + are used by the Virtual Machine to fulfil @b load requests, but this + doesn't imply that they are honoured in every case. + +*/ +FALCON_FUNC Module_exported( ::Falcon::VMachine *vm ) +{ + CoreObject *self = vm->self().asObject(); + ModuleCarrier *modc = static_cast( self->getUserData() ); + + // if the module is not alive, raise an error and exit + if ( modc == 0 || ! modc->liveModule()->isAlive() ) + { + vm->raiseModError( new AccessError( ErrorParam( FALCOMP_ERR_UNLOADED, __LINE__ ). + desc( FAL_STR( cmp_msg_unloaded ) ) ) ); + return; + } + + const SymbolTable *symtab = &modc->liveModule()->module()->symbolTable(); + CoreArray* ret = new CoreArray( symtab->size() ); + MapIterator iter = symtab->map().begin(); + while( iter.hasCurrent() ) + { + Symbol *sym = *(Symbol **) iter.currentValue(); + if ( sym->exported() ) + ret->append( new CoreString(sym->name()) ); + + // next symbol + iter.next(); + } + + vm->retval( ret ); +} + +/*# @method unload Module @brief Removes the module from the running virtual machine. @return True on success, false on failure. diff -Nru /tmp/qLlpeOGf0f/falconpl-0.9.1.8/modules/feathers/compiler/compiler_ext.h /tmp/Y4mp0W3rzG/falconpl-0.9.2/modules/feathers/compiler/compiler_ext.h --- falconpl-0.9.1.8/modules/feathers/compiler/compiler_ext.h 2009-05-12 21:57:09.000000000 +0100 +++ falconpl-0.9.2/modules/feathers/compiler/compiler_ext.h 2009-06-19 12:07:14.000000000 +0100 @@ -42,6 +42,8 @@ FALCON_FUNC Compiler_addFalconPath( ::Falcon::VMachine *vm ); +FALCON_FUNC Module_globals( ::Falcon::VMachine *vm ); +FALCON_FUNC Module_exported( ::Falcon::VMachine *vm ); FALCON_FUNC Module_get( ::Falcon::VMachine *vm ); FALCON_FUNC Module_set( ::Falcon::VMachine *vm ); FALCON_FUNC Module_getReference( ::Falcon::VMachine *vm ); diff -Nru /tmp/qLlpeOGf0f/falconpl-0.9.1.8/modules/feathers/compiler/version.h /tmp/Y4mp0W3rzG/falconpl-0.9.2/modules/feathers/compiler/version.h --- falconpl-0.9.1.8/modules/feathers/compiler/version.h 2008-04-06 20:41:22.000000000 +0100 +++ falconpl-0.9.2/modules/feathers/compiler/version.h 2009-06-20 17:56:59.000000000 +0100 @@ -18,8 +18,8 @@ #define VERSION_H #define VERSION_MAJOR 1 -#define VERSION_MINOR 0 -#define VERSION_REVISION 1 +#define VERSION_MINOR 2 +#define VERSION_REVISION 0 #endif diff -Nru /tmp/qLlpeOGf0f/falconpl-0.9.1.8/modules/feathers/confparser/confparser.cpp /tmp/Y4mp0W3rzG/falconpl-0.9.2/modules/feathers/confparser/confparser.cpp --- falconpl-0.9.1.8/modules/feathers/confparser/confparser.cpp 2009-03-15 18:54:00.000000000 +0000 +++ falconpl-0.9.2/modules/feathers/confparser/confparser.cpp 2009-06-20 00:09:01.000000000 +0100 @@ -36,7 +36,7 @@ original INI file, so that it stays familiar for the user after a modify that has been caused by the Falcon module. - @section Ini file format + @section confparser_ini_fformat Ini file format The ConfParser module parses INI files in the following format: @code @@ -66,21 +66,21 @@ also after a value, if a value itself contains one of those characters it should be enclosed by quotes, or part of the value will be considered a comment. - In example: + For example: @code Key: "A complex value containing\nescapes # and comment" ; real comment @endcode - @subsection Multiple values + @subsection confparser_multiple_values Multiple values Although it would be possible to put arbitrary lists into strings to save them on configuration files, and expand them in the program when reading them back, it is possible to store array of values in configuration files by declaring multiple times the same key. + For example: @code - In example: Key = value1 Key = value2 Key = value3 @@ -89,7 +89,7 @@ This will result in the three values to be returned in an array when the value of "Key" is asked. - @subsection Key categories + @subsection confparser_key_cat Key categories Keys can be categorized; tree-like or even recursive key groups can be represented with dots separating the key hierarchy elements. diff -Nru /tmp/qLlpeOGf0f/falconpl-0.9.1.8/modules/feathers/confparser/confparser_ext.cpp /tmp/Y4mp0W3rzG/falconpl-0.9.2/modules/feathers/confparser/confparser_ext.cpp --- falconpl-0.9.1.8/modules/feathers/confparser/confparser_ext.cpp 2009-03-22 15:28:18.000000000 +0000 +++ falconpl-0.9.2/modules/feathers/confparser/confparser_ext.cpp 2009-06-20 00:09:01.000000000 +0100 @@ -30,6 +30,10 @@ #include "confparser_mod.h" #include "confparser_st.h" +/*# + @beginmodule feather_configparser +*/ + namespace Falcon { namespace Ext { @@ -43,7 +47,7 @@ @optparam filename The name of the ini file to be parsed, if it exists. @optparam encoding An optional non default encoding which is used for that file. - @section Adding, setting or removing keys + @section confparser_key_manage Adding, setting or removing keys The most direct way to add a new key in an ini configuration file is to use the @a ConfParser.add method. @@ -76,7 +80,7 @@ be used to remove the main section; in fact, even if empty, that section always exists. To clear every key in that, use the clearMain() method. - @section Categorized keys + @section confparser_categorized_keys Categorized keys Categories are separated from the keys by dots "."; a complete categorized key may contain any amount of dots, or in other words, the categories can have an @@ -91,7 +95,7 @@ category only, or it can be arbitrarily deep. Only the keys in deeper categories will be returned. - In example; if the configuration file contains the following entries: + For example; if the configuration file contains the following entries: @code Key.cat1 = 1 @@ -141,7 +145,7 @@ ordinary get() or getOne() methods, a whole category tree can be imported with the method getCategory(). - In example, consider the same configuration structure we have used before. If + For example, consider the same configuration structure we have used before. If the category parameter of getCategory() is set to "Key", all the entries will be returned. If it's set to "cat1", the first entry won't be returned, as it's consider a key cat1 in category Key. If category is set to "key.cat1.subcat1", @@ -152,7 +156,7 @@ stripped of their category part by adding an asterisk at the end of the first parameter. - In example: + For example: @code category = "Key.cat1" @@ -181,6 +185,8 @@ /*# @init ConfParser + + @brief Prepares the confparser, and eventually opens a config file. The constructor of this class allows to set up a filename for the configuration file that is going to be read and/or written. If the name is not diff -Nru /tmp/qLlpeOGf0f/falconpl-0.9.1.8/modules/feathers/confparser/version.h /tmp/Y4mp0W3rzG/falconpl-0.9.2/modules/feathers/confparser/version.h --- falconpl-0.9.1.8/modules/feathers/confparser/version.h 2008-04-06 20:41:22.000000000 +0100 +++ falconpl-0.9.2/modules/feathers/confparser/version.h 2009-06-20 17:56:59.000000000 +0100 @@ -18,7 +18,7 @@ #define VERSION_H #define VERSION_MAJOR 1 -#define VERSION_MINOR 0 +#define VERSION_MINOR 2 #define VERSION_REVISION 0 #endif diff -Nru /tmp/qLlpeOGf0f/falconpl-0.9.1.8/modules/feathers/docs/faldoc.fd /tmp/Y4mp0W3rzG/falconpl-0.9.2/modules/feathers/docs/faldoc.fd --- falconpl-0.9.1.8/modules/feathers/docs/faldoc.fd 2009-03-27 23:24:15.000000000 +0000 +++ falconpl-0.9.2/modules/feathers/docs/faldoc.fd 2009-06-19 12:07:14.000000000 +0100 @@ -10,7 +10,7 @@ Title = Falcon Feathers - The Standard Modules Reference. Author = The Falcon Committee -Version = 0.9.0 +Version = 0.9.2 ################################################ # Faldoc Input settings @@ -37,6 +37,7 @@ ################################################ Output.module=html +Output.module=list ################################################ # Faldoc HTML Output settings @@ -44,7 +45,16 @@ # Output.. configs ################################################ -Output.html.directory=Falcon-feathers-docs.0.9.0 +Output.html.directory=Falcon-feathers-docs.0.9.2 Output.html.url=. Output.html.doctitle=Falcon Feathers Function Reference +################################################ +# Faldoc listing Output settings +################################################ + +Output.list.file=Falcon-feathers-0.9.2.lst +Output.list.doctitle=Falcon Feather Modules - Function List +Output.list.bytype=true +Output.list.members=true +Output.list.brief=true diff -Nru /tmp/qLlpeOGf0f/falconpl-0.9.1.8/modules/feathers/docs/main.fd /tmp/Y4mp0W3rzG/falconpl-0.9.2/modules/feathers/docs/main.fd --- falconpl-0.9.1.8/modules/feathers/docs/main.fd 2008-05-04 23:57:22.000000000 +0100 +++ falconpl-0.9.2/modules/feathers/docs/main.fd 2009-06-20 00:09:01.000000000 +0100 @@ -4,4 +4,4 @@ The Falcon Standard Module Suite goes under the name of "feathers". This module set is the one officially distributed together with the standrad installation of Falcon. -*/ \ No newline at end of file +*/ diff -Nru /tmp/qLlpeOGf0f/falconpl-0.9.1.8/modules/feathers/mxml/mxml_ext.cpp /tmp/Y4mp0W3rzG/falconpl-0.9.2/modules/feathers/mxml/mxml_ext.cpp --- falconpl-0.9.1.8/modules/feathers/mxml/mxml_ext.cpp 2009-03-15 20:56:11.000000000 +0000 +++ falconpl-0.9.2/modules/feathers/mxml/mxml_ext.cpp 2009-06-19 12:07:14.000000000 +0100 @@ -81,7 +81,7 @@ an XML document must still be valid as an XML element of another document, but it implements some data specific for handling documents. - @section MXML document structure. + @section mxml_doc_struct MXML document structure. The XML document, as seen by the MXML module, is a tree of nodes. Some nodes have meta-informative value, and are meant to be used by the XML parser programs to diff -Nru /tmp/qLlpeOGf0f/falconpl-0.9.1.8/modules/feathers/process/process_ext.cpp /tmp/Y4mp0W3rzG/falconpl-0.9.2/modules/feathers/process/process_ext.cpp --- falconpl-0.9.1.8/modules/feathers/process/process_ext.cpp 2009-03-22 15:28:18.000000000 +0000 +++ falconpl-0.9.2/modules/feathers/process/process_ext.cpp 2009-06-19 12:07:14.000000000 +0100 @@ -785,7 +785,7 @@ } /*# - @method Process_getAux Process + @method getAux Process @brief Returns the process auxiliary output stream. @return The child process auxiliary output stream (read-only) diff -Nru /tmp/qLlpeOGf0f/falconpl-0.9.1.8/modules/feathers/README /tmp/Y4mp0W3rzG/falconpl-0.9.2/modules/feathers/README --- falconpl-0.9.1.8/modules/feathers/README 2009-04-25 11:15:47.000000000 +0100 +++ falconpl-0.9.2/modules/feathers/README 2009-06-20 12:25:30.000000000 +0100 @@ -31,7 +31,7 @@ To build the Falcon Feathers, you'll need a well setup Falcon Development Environment, as specified in the relative document at - http://www.falconpl.org/wiki/tiki-index.php?page=The+build+environment + http://old.falconpl.org/wiki/tiki-index.php?page=The+build+environment The core must be built and installed in the active tree before starting feathers configuration. diff -Nru /tmp/qLlpeOGf0f/falconpl-0.9.1.8/modules/feathers/regex/regex_ext.cpp /tmp/Y4mp0W3rzG/falconpl-0.9.2/modules/feathers/regex/regex_ext.cpp --- falconpl-0.9.1.8/modules/feathers/regex/regex_ext.cpp 2009-05-04 20:19:37.000000000 +0100 +++ falconpl-0.9.2/modules/feathers/regex/regex_ext.cpp 2009-06-20 17:29:02.000000000 +0100 @@ -88,8 +88,8 @@ match "abdabc" starting from character 3, but if anchored option is set it won't match, as "abc" will start to match at the beginning of string, but then will fail when "d" is met. - @b i: ignore case while matching. Case ignoring is currently supported only for Unicode - characters below 128; this means that accented latin case ignoring is not supported. In - example, "�" and "�" won't match even if "i" option is set. + characters below 128; this means that accented latin case ignoring is not supported. For + example, "è" and "È" won't match even if "i" option is set. - @b m: multiline match. Usually, the special characters "^" and "$" matches respectively the begin and the end of the string, so that "^pattern$" will match only "pattern", and not "this is a pattern". With "m" option, "^" and "$" matches the begin and the end of a line, @@ -103,7 +103,7 @@ - @b f: first line. Match must start before or at the first "\n", or else it will fail. - @b g: ungreedy match. Repetition patterns behave normally in a way that is defined "greedy", unless followed by a question mark. Greedy matching will force quantifiers to - match as many characters as possible in the target string. In example, normally + match as many characters as possible in the target string. For example, normally 'field:\s*(.*);', if applied to a string with two ";" after "field" will return the longest possible match. If applied to "field: a; b; c; and the rest" would return "a; b; c" as first submatch. Using a question mark would force to match the shortest alternative: diff -Nru /tmp/qLlpeOGf0f/falconpl-0.9.1.8/modules/feathers/socket/socket_ext.cpp /tmp/Y4mp0W3rzG/falconpl-0.9.2/modules/feathers/socket/socket_ext.cpp --- falconpl-0.9.1.8/modules/feathers/socket/socket_ext.cpp 2009-03-22 15:28:18.000000000 +0000 +++ falconpl-0.9.2/modules/feathers/socket/socket_ext.cpp 2009-06-20 00:09:01.000000000 +0100 @@ -88,7 +88,7 @@ method will resolve the target address on its own. This function can be used on the value returned by @a getHostName, or using - "localhost" as the @a address parameter, to receive a + "localhost" as the @b address parameter, to receive a list of the interfaces that are available under the network name of the host the VM is running on. This is useful to i.e. bind some services only to one of the available interfaces. @@ -169,15 +169,16 @@ /*# @class Socket - @brief TCP/IP networking base class, + @brief TCP/IP networking base class. + The Socket class is the base class for both UDP and TCP socket. It provides common methods and properties, and so it should not be directly instantiated. - @prop timedout True if the last operation has timed out. See @a Socket.setTimeout.. + @prop timedout True if the last operation has timed out. See @a Socket.setTimeout. @prop lastError Numeric value of system level error that has occoured on the socket. - @a getErrorDescription may be used to get a human-readable description of the error. + Standard Function @b socketErrorDesc may be used to get a human-readable description of the error. The error is usually also written in the fsError field of the exceptions, if case they are caught. */ @@ -191,6 +192,7 @@ /*# @method setTimeout Socket + @brief Sets the default timeout for lengthy operations. @param timeout Timeout in seconds and fractions. This function sets a default timeout for the read/write operations, or for other @@ -653,9 +655,9 @@ case the sent data may get corrupted as a transmission may deliver only part of a character or of a number stored in a memory buffer. - If a @a size parameter is not specified, the method will try to send the whole + If a @b size parameter is not specified, the method will try to send the whole content of the buffer, otherwise it will send at maximum size bytes. If a - @a start parameter is specified, then the data sent will be taken starting + @b start parameter is specified, then the data sent will be taken starting from that position in the buffer (counting in bytes from the start). This is useful when sending big buffers in several steps, so that @@ -720,7 +722,7 @@ @method recv TCPSocket @brief Reads incoming data. @param bufOrSize A pre-allocated buffer to fill, or a maximum size in bytes to be read. - @optParam size Maximum size in bytes to be read. + @optparam size Maximum size in bytes to be read. @return If @b bufOrSize is a size, returns a filled string buffer, otherwise it returns the amount of bytes actually read. @raise NetError on network error. @@ -1059,6 +1061,7 @@ /*# @method sendTo UDPSocket + @brief Sends a datagram to a given address. @param host Remote host where to send the datagram. @param service Remote service or port number where to send the datagram. @param buffer The buffer to be sent. @@ -1072,11 +1075,11 @@ filled before being sent, provided that the specified size does not exceed datagram size limits. - The @a host parameter may be an host name to be resolved or an address; + The @b host parameter may be an host name to be resolved or an address; if the @a UDPSocket.broadcast method has been successfully called, it may be also a multicast or broadcast address. - The @a service parameter is a string containing either a service name + The @b service parameter is a string containing either a service name (i.e. "http") or a numeric port number (i.e. "80", as a string). The @b buffer may be a byte-only string or a @@ -1161,7 +1164,7 @@ @method recv UDPSocket @brief Reads incoming data. @param bufOrSize A pre-allocated buffer to fill, or a maximum size in bytes to be read. - @optParam size Maximum size in bytes to be read. + @optparam size Maximum size in bytes to be read. @return If @b bufOrSize is a size, returns a filled string buffer, otherwise it returns the amount of bytes actually read. @raise NetError on network error. diff -Nru /tmp/qLlpeOGf0f/falconpl-0.9.1.8/modules/feathers/threading/threading.cpp /tmp/Y4mp0W3rzG/falconpl-0.9.2/modules/feathers/threading/threading.cpp --- falconpl-0.9.1.8/modules/feathers/threading/threading.cpp 2009-05-03 20:44:18.000000000 +0100 +++ falconpl-0.9.2/modules/feathers/threading/threading.cpp 2009-06-19 12:07:14.000000000 +0100 @@ -52,7 +52,7 @@ /*# @page threading_model Falcon multithreading model. - @section Forewords + @section threading_fore Forewords This document is by no mean an exhaustive explanation of multithreading in general. Concepts as "mutex", "synchronization primitive", "thread", @@ -61,7 +61,7 @@ document just deals with the specificities of Falcon approach to multithreading. - @section Basic Principles + @section threading_basics Basic Principles Falcon multithreading is amied to maximize the efficiency of the VM running in a multithreading context, and of the execution of the scripts @@ -106,7 +106,7 @@ to be used, and in example, it is possible to share plain memory which can be directly manipulated by each thread as it prefers. - @section Multithreading implementation + @section mt_impl Multithreading implementation The Falcon threading module provides each agent with a new Virtual Machine created on the spot. Those VMs are created "empty", that is, they will @@ -173,7 +173,7 @@ available, known and controllable by the topmost level, the overall agent-based model is not broken. - @section Synchronization structures + @section threading_sync_struct Synchronization structures Falcon agent-based model leverages on the concept of non-primitive structures used to synchronize and coordinate threads. Each structure has a different working principle which @@ -197,7 +197,7 @@ /*# @page threading_warnings Multithreading safety - @section Multithreading can break things + @section tw_threading_can_break Multithreading can break things Falcon won't try to recover from multithreading errors done by the scripts. This means that an ill designed script can deadlock, mess up embedding application data and break in the most @@ -287,7 +287,7 @@ automatically "fix" (hide) them, it is that to cure the program generating them so that they don't happen anymore. - @section Multithreading can break things (again) + @section tw_threading_can_break2 Multithreading can break things (again) We said that that an ill designed script can deadlock, mess up embedding application data and break in the most diff -Nru /tmp/qLlpeOGf0f/falconpl-0.9.1.8/modules/feathers/threading/threading_ext.cpp /tmp/Y4mp0W3rzG/falconpl-0.9.2/modules/feathers/threading/threading_ext.cpp --- falconpl-0.9.1.8/modules/feathers/threading/threading_ext.cpp 2009-05-19 09:15:26.000000000 +0100 +++ falconpl-0.9.2/modules/feathers/threading/threading_ext.cpp 2009-06-20 00:09:01.000000000 +0100 @@ -27,6 +27,10 @@ #include "threading_mod.h" #include "threading_st.h" +/*# + @beginmodule feathers_threading +*/ + namespace Falcon { namespace Ext { @@ -979,7 +983,7 @@ Actually, this class represents the interface exposed by synchronization structures to script. Objects derived from this class can be used in functions and methods in - the group "@a waiting_funcs". Usually, the Waitable class is implemented by + the group @a waiting_funcs. Usually, the Waitable class is implemented by Structures, but any object providing a mean to be acquired, released and waited for a change in the acquirability state can be derived from this class. diff -Nru /tmp/qLlpeOGf0f/falconpl-0.9.1.8/modules/feathers/threading/version.h /tmp/Y4mp0W3rzG/falconpl-0.9.2/modules/feathers/threading/version.h --- falconpl-0.9.1.8/modules/feathers/threading/version.h 2009-03-15 22:41:05.000000000 +0000 +++ falconpl-0.9.2/modules/feathers/threading/version.h 2009-06-20 17:56:59.000000000 +0100 @@ -17,8 +17,8 @@ #define VERSION_H #define VERSION_MAJOR 1 -#define VERSION_MINOR 2 -#define VERSION_REVISION 1 +#define VERSION_MINOR 4 +#define VERSION_REVISION 0 #endif diff -Nru /tmp/qLlpeOGf0f/falconpl-0.9.1.8/README /tmp/Y4mp0W3rzG/falconpl-0.9.2/README --- falconpl-0.9.1.8/README 2009-03-22 21:48:39.000000000 +0000 +++ falconpl-0.9.2/README 2009-06-20 12:25:41.000000000 +0100 @@ -12,7 +12,7 @@ To build the currently working version from the active repository, please refer to this document: - http://www.falconpl.org/wiki/tiki-index.php?page=The+build+environment + http://old.falconpl.org/wiki/tiki-index.php?page=The+build+environment Instructions on how to build the released source packages are contained in the "BUILDING" document. diff -Nru /tmp/qLlpeOGf0f/falconpl-0.9.1.8/RELNOTES /tmp/Y4mp0W3rzG/falconpl-0.9.2/RELNOTES --- falconpl-0.9.1.8/RELNOTES 2009-05-19 09:20:07.000000000 +0100 +++ falconpl-0.9.2/RELNOTES 2009-06-20 12:25:41.000000000 +0100 @@ -1,42 +1,116 @@ RELEASE NOTES for Falcon - Crane-RC2 Release + Crane Release - 0.9.1.8 - - Version 0.9.1.8 is the second release candidate for final public 0.9.2. -This version is intended for all developers and wilful users to test -and squeeze the last bugs that we weren't able to find out. It's supposed -to be pretty stable, with all the blockesrs for final 0.9.2 gone. + 0.9.2 "Crane" marks the birth of the new development effort towards the final -1.0 release. This development release is meant as a pre-release for developers, -willful users, and module designers so that they can install it on their -systems and test it, use it and develop the new modules on it. In short, it's -a stabilization of the 0.9 branch, which is released as a package so that -the surrounding modules and applications can be developed and tested. - - While Albatross (0.9.0) was a totally experimental version, this release is -already usable, and has already been employed to port relevant applications and -embeddings from version 0.8. While still not "official", and still bearing -some known issues, it is usable enough to drive Falcon official site and -run through our set of applications without any particular problems. +1.0 release. The main news with respect to 0.8 branch are: + + - Native multithreading integrated in the engine. + - Cooperative parallel Garbage Collector. + - Extended support for message oriented programming. + - Completing of Base Object Model through type-specialized metaclasses. + - Integration of Functional Paradigm with crucial functions as + brigade(), and introduction of the concept of "parametric evaluation". + - Introduction of cached streams, incrementing I/O performances of + several times. + - Virtualization of the loading and stream services provided by the + engine (now URI driven). + - Introduction of operator overloading for objects and blessed + dictionaries. + - Added support for circular references in loaded modules. + + The most prominent changes that require attention in porting Falcon +scripts from 0.8 are: + + - The attribute keyword has been removed. Message oriented programming + is now performed through the VM assisted class VMSlot. With that, + give, has and hasnt keyword has been removed as well. + - The sender keyword has been removed. Instead, the fself keyword (pointing + to the function or method currently executed) has been introduced, + and it is possible to discover the calling entity (be it a method, + of which it is possible to retrieve the caller object that would have + been available through sender, or a normal function) through the + caller() method of the Function BOM metaclass. + - Multiline string declaration has been changed. Now, a single " or ' + at the end of a line opens a multiline block which is closed by + the corresponding " or '. It is illegal to break a string across + lines except if the string was opened this way. + - Strings are not automatically concatenated anymore. Now, "a" "b" represent + two separate tokens; however, the '+' operator on literal string is + calculate at compile time. This obviated the need for the dot-quote + operator that has been removed. + - If math operators are the last token in a line, the instruction can + continue on the next line without the need of a terminal backslash. + - Single quote strings perform no escape whatsoever. The only sequence + specially processed is the repeated single quote (''), which is expanded + in a single quote, so that a string declared as 'what''s that' expands + into "what's that". + - The loop keyword doesn't accept a statement on its line anymore, while the + corresponding end keyword accepts an optional terminal condition (similar + to repeat->until loops). + - The lambda keyword has been removed; in its place, + { p1...pn => } + nameless function declaration has been added. contrarily to + function(p1...pn); ...; end + nameless function declaration, and similarly to the lambda keyword, if the + statements to the right of => consists in just one expression, its value + is automatically returned. {=>} notation is called "code block". + + Other than that, a couple of relevant script level functions and classes has +been changed; mainly the Directory class and serialization functions. It is +advisable to read the change log for a complete overview of the work. + + +Future plans +============ + + We'll concentrate mainly in three aspect in the next releases: + + - Optimization: starting from this version, we're beginning to optimize + various aspects of the engine, and to employ state-of-the-art + programming techniques to boost performances in critical areas as + concurrency, memory pooling, stack compression, dictionary search + caching and method early binding. Also, we'll start introducing compile + time optimizations to boost the performance of the generated code using + the best possible sequence of Virtual Machine opcodes, and we may + extend the VM model to allow for more effective optimizations (as local + caching of frequently used objects). + - Completion: Message programming and Tabular programming are growing more + solid, but their employ out in the wild showed some uncovered area that + requires work. For example, messages could be excellent means to have + coroutines, and possibly threads, to cooperate if just integrated with + the wait functions. + - Extension: three are the issues that must be covered before reaching the + 1.0 stage: logic programming, type contracts (or optional typing) and + native support for arbitrary precision math. We'll try to introduce all + the three as soon as possible, so that they are involved since the + beginning in the optimization and completion steps. + Short term plans ================ - As planned, we're releasing 0.9.2 (the first official version) in 30-45 -days from 0.9.0; this is an in-between version which we decided to release -as a package to simplify the effort of developers moving to the 0.9 branch. + As this is the first official release after more than six months, and as +the changes in the engine are quite extensive, we expect that the release +out on the wild will expose unspotted problems. This, and the need to +integrate logic programming, type contracts and arbitrary precision math +fast has made us plan an official release 0.9.4 in 45-60 days. + + The development group will concentrate in updating and releasing critical +modules as DBI, DynLib and SDL, plus critical projects as the embedding +sample suite and Faldoc as soon as possible, possibly in 1-2 weeks. Usage tips ========== Although the new Garbage Collector is relatively efficient in determining -the actual needs of applications and in reclaiming -unused memory, the detection algorithm is still rudimentary and experimental. -If your application is memory-intensive, be sure to read the Core Module +the actual needs of applications and in reclaiming unused memory, the standard +detection algorithms are still a bit naive. + + If your application is memory-intensive, be sure to read the Core Module Documentation about the new GC object, which provides four default collection strategies and also allows you to implement your own. A finely tuned GC strategy can boost the performance of your application and reduce its memory diff -Nru /tmp/qLlpeOGf0f/falconpl-0.9.1.8/versioninfo /tmp/Y4mp0W3rzG/falconpl-0.9.2/versioninfo --- falconpl-0.9.1.8/versioninfo 2009-05-19 09:20:07.000000000 +0100 +++ falconpl-0.9.2/versioninfo 2009-06-20 12:25:41.000000000 +0100 @@ -1,9 +1,9 @@ FALCON_VERSION_MAJOR=0 FALCON_VERSION_MINOR=9 -FALCON_VERSION_REVISION=1 -FALCON_VERSION_PATCH=8 +FALCON_VERSION_REVISION=2 +FALCON_VERSION_PATCH=0 -FALCON_VERSION_NAME="crane-RC2" +FALCON_VERSION_NAME="crane" FALCON_SONAME_VERSION=1 FALCON_SONAME_REVISION=17