2013-06-30 Wolfgang Lux * STSourceReader.m (-lineNumberForIndex:, -readNextToken): Tidy source. * STSourceReader.m (-readNextToken): Bug fixes: - Prevent out of range accesses for the input string. - Exponent of a real number must contain at least one digit. - Incorrect token range for character literals. 2013-05-26 Wolfgang Lux * STGrammar.y (temporaries): Allow empty list. * STGrammar.m: Regenerated. 2013-05-26 Wolfgang Lux * NSNumber+additions.h: * NSNumber+additions.m: * STBlock.h: * STBlock.m: * STBlockContext.h: * STBlockContext.m: * STBytecodeInterpreter.h: * STBytecodeInterpreter.m: * STBytecodes.h: * STBytecodes.m: * STCompiledCode.h: * STCompiledCode.m: * STCompiledMethod.h: * STCompiledMethod.m: * STCompiledScript.m: * STCompiler.h: * STCompiler.m: * STExecutionContext.h: * STExecutionContext.m: * STLiterals.h: * STLiterals.m: * STMethodContext.h: * STMethodContext.m: * STSmalltalkScriptObject.m: * STSourceReader.h: * STSourceReader.m: * STStack.h: * STStack.m: int->NSInteger transition 2013-04-06 Wolfgang Lux * STSourceReader.m (-readNextToken): Fix bug where the last character of an identifier was dropped when the assignment operator ':=' follows it immediately. 2013-04-03 Wolfgang Lux * NSArray+additions.m (-collect:): Properly handle nil results from block. 2013-04-03 Wolfgang Lux * STSourceReader.m (-lineNumberForIndex:): Revert broken fix and replace it by code that now works correctly for all kinds of line endings. 2013-03-25 Wolfgang Lux * STBytecodeInterpreter.m (-returnValue:): Fix bug where the STInterpreterReturnException was not handled when a block returns nil. 2013-03-24 Wolfgang Lux * STCompiler.m (-compileMethod:): Follow Smalltalk convention to return the receiver from a method without an explicit return statement. * STCompiler.m (-compileStatements:blockFlag:): Return nil from an empty block and the receiver from an empty method. 2013-03-24 Wolfgang Lux * STExecutionContext.h: Change type of instruction pointer attribute to NSUInteger. * STExecutionContext.m (-invalidate, -isValid): Invalidate an execution context by setting its instruction pointer to NSNotFound. * STMethodContext.m (-invalidate, -isValid): * STBlockContext.m (-invalidate, -isValid): Delete method implementations so that the method and home context attributes of a method context and block context, respectively, are not destroyed when the method or block returns. Together these changes make it possible to use blocks even after the method containing their definition has returned. 2013-03-24 Wolfgang Lux * Externs.h (STInterpreterReturnException): * Externs.m (STInterpreterReturnException): * STCompiler.m (-compileStatements:blockFlag:): * STBytecodeInterpreter.m (-interpretMethod:forReceiver:arguments: -returnValue:, -returnBlockValue:, -dispatchBytecode:): An explicit return statement in a block returns from the method context containing the block's definition. This is achieved by throwing a STInterpreterReturnException. * STBlock.m (-handler:): Don't let user code handle STInterpreterReturnException. * STBytecodeInterpreter.m (-interpret): Fix incorrect logging levels. 2013-03-23 Wolfgang Lux * STCompiler.m (-compileStatements:blockFlag:): Fix compiler bug: The value of a Smalltalk statement sequence is the value of its last statement and not that of the first. 2013-03-23 Wolfgang Lux * STBlock.m (-initWithInterpreter:...): * STBlockContext.m (initWithInterpreter:initialIP:stackSize:): * STBytecodeInterpreter.m (-initWithEnvironment:): * STBytecodes.m (-initWithData:, -initWithCoder:): * STCompiledMethod.m (-initWihtSelector:argumentCount:bytecodeData:...) -initWithCoder:): * STCompiledScript.m (-initWithVariableNames:): * STCompiler.m (-initWithEnvironment:, -init): * STCompilerUtils.m(STCMethod) (-initWithPattern:statements:): * STCompilerUtils.m(STCMessage) (-init): * STCompilerUtils.m(STCMessageExpression) (-initWithTarget:message:): * STCompilerUtils.m(STCPrimaryExpression) (-initWithObject:): * STCompilerUtils.m(STCPrimary) (-initWithType:object:): * STExecutionContext.m (-initWithStackSize:): * STLiterals.m(STObjectReferenceLiteral) (initWithObjectName:poolName:): * STLiterals.m(STBlockLiteral) (-initWithArgumentCount:): * STMessage.m (-initWithSelector:arguments:): * STMethodContext.m (-initWithMethod:environment:): * STSmalltalkScriptObject.m (-initWithEnvironment:compiledScript:): * STSourceReader.m (initWithString:range:): * STStack.m (-initWithSize:): Check the result of the super class initializer and assign it to self. * STBlock.m (-initWithInterpreter:..., -dealloc): Retain and release the homeContext and interpreter attributes. * STBytecodeInterpreter.m (-delloc): Release environment attribute to fix space leak. * STBytecodeInterpreter.m (createBlockWithArgumentCount:stackSize:): * STCompiledMethod.m (+methodWithCode:messagePattern:): * STCompilerUtils.m (+primaryWithVariable:, +primaryWithLiteral:, +primaryWithBlock:, +primaryWithExpression:): Use idiomatic Objective-C code, which never assigns the result of an +alloc method to a local variable. 2013-03-02 Wolfgang Lux * STSourceReader.m (_STNormalizeStringToken): Unescape two successive single quote characters inside literal string tokens. 2013-02-08 Wolfgang Lux * STBlock.h (value:,value:value:,value:value:value:,valueWithArguments:): * STBlock.m (value:,value:value:,value:value:value:,valueWithArguments:): Define standard Smalltalk methods for invoking blocks with arguments. * STBlock.m (valueWith:,valueWith:with:,valueWith:with:with:, valueWith:with:with:with:,valueWithArgs:,handler:): * NSArray+additions.m (do:,select:,reject:,collect:,detect:): * NSNumber+additions.m (to:do:,to:step:do:): Use the new standard methods instead of the old non-standard ones. 2012-12-02 Wolfgang Lux * STCompiler.m (compileString:): Fix syntax error reporting to properly show the error context. * STCompiler.m (compileMethodFromSource:forReceiver:): Fix space leak when an exception other than a syntax error is raised. * STCompiler.m (compileStatements:): Autorelease compiled code here ... * STCompiler.m (compileMethod:): ... instead of here. 2012-10-26 Wolfgang Lux * STCompilerUtils.m (STCPrimaryExpression): Remove repeated attribute declaration from the implementation. 2012-02-07 Wolfgang Lux * STSourceReader.m (-lineNumberForIndex:): Fix unintended fall through in a switch statement detected by clang. 2012-02-07 Wolfgang Lux * STCompiledScript.m (-executedInEnvironment:): * STSmalltalkScriptObject.m (-forwardInvocation:): Fix potential space leak detected by clang. 2012-01-15 Wolfgang Lux * STCompiledScript.m (+initialize, -executeInEnvironment:): Rename finalize selector to shutDown to avoid conflict with the NSObject -finalize method. 2012-01-15 Wolfgang Lux * STCompiler.m (-indexOfTemporaryVariable, -indexOfNamedReference, -compilePrimary:, -compileExpression:): Minimal set of changes to accomodate to large NSNotFound value on 64-bit machines. 2012-01-15 Wolfgang Lux * STCompiler.m (-exceptionInfo): Return exceptionInfo dictionary. * STCompiler.m (-compileMethodFromSource:forReceiver:, -compileString:, -indexOfNamedReference:): Remove unneeded variables reported by gcc 4.6. 2012-01-15 Wolfgang Lux * STBytecodes.h (-data, -length): Declare public methods. * STMethodContext.h: Remove declaration of unused methods, which were not implemented. * STCompiler.h (STCompiler, -compiledMethodFromSource:forReceiver:): * STCompiler.m (-compiledMethodFromSource:forReceiver:): STCompiler expects its receiver attribute to be a STScriptObject not just an object that satisfies the weaker STScriptObject protocol. * STSmalltalkScriptObject.m: Import NSDictionary and NSKeyValueCoding, whose methods are used in the implementation. * STCompiledMethod.h: Import definition of STMethod protocol instead of just declaring it. Gcc 4.6 complains if a protocol whose definition is not visible is used in an interface declaration. 2012-01-15 Wolfgang Lux * STBytecodeInterpreter.m: Remove unnecessary include of Objective-C runtime header. 2011-01-20 Wolfgang Lux * SmalltalkInfo.plist: Add missing semicolons at end of plist dictionaries. 2011-01-20 Wolfgang Lux * STSourceReader.m (-readNextToken): Fix bug where an incorrect token range was set for a string token that ends at the end of the input string. 2005 Aug 17 Stefan Urbanek * NSObject+additions: new file, new method ifNil:block 2005 June 24 Stefan Urbanek * STCompiler: Fixed STUndefinedKeyException name as it was fixed in -base 2005 June 20 Stefan Urbanek * Rewritten parts of STCompiler, STBytecodeInterpreter, STCompiled* and ' ST*Context: Smalltalk now refers to instance variables by name not by index. This should allow creation of STActor class and final implementation of instance variables in STScriptObject. Instance variables are accessed by their name through Key-Value-Coding protocol. 2005 Mar 9 Stefan Urbanek * Patch by Matthew D Swank: patch that keeps the temp space allocated to a particular block, while avoiding naming conflicts by storing empty strings as placeholders _after_ the block has been compiled (and the names are no longer needed). 2004 Nov 9 Stefan Urbanek * Remove STMethodSignatureForSelector as it was deprecated because of inportability to OSX. 2004 Nov 2 Stefan Urbanek * Changed super of STBytecodes from NSData to NSObject - there were some OSX issues 2004 Jul 10 Stefan Urbanek * Applied patch from Alexander V. Diemand (fixed bug #9595) - fixed maximum number of literals, fixed longjmp 2004 Jun 28 Stefan Urbanek * Fixed expresion duplicating. 2004 Jun 27 Stefan Urbanek * Version 0.8.1 2004 Jun 20 Stefan Urbanek * Added a fix to the compiler from Mateu Batle 2004 May 27 Stefan Urbanek * Fixed bug with signed/unsigned bytecode, which made StepTalk to crash if has more than 127 literals in the array. (patch by Mateu Batle) 2003 Sep 28 Stefan Urbanek * NSNumber: fixed -NSNumber to:step:do: - now accepts negative step. (Patch by Alexander Diemand) 2003 Sep 24 Stefan Urbanek * Guard compilation with an autorelease pool 2003 Sep 23 Stefan Urbanek * STBytecodeInterpreter: fixed memory leak (reported by Alexander Diemand) 2003 Aug 5 Stefan Urbanek * STScriptObject renamed to STSmalltalkScriptObject, because of steptalk core change. 2003 May 17 Stefan Urbanek * STSourceReader: treat decimal point followed by whitespace as '.' dot - end of statement. 2003 May 9 Stefan Urbanek * NSString+additions: added 2003 May 4 Stefan Urbanek * SmalltalkEngine: remove exception guard to allow debugging 2003 Apr 29 Stefan Urbanek * STSourceReader: fixed reading of identifiers at the end of source 2003 Apr 21 Stefan Urbanek * Version 0.7.1 2003 Apr 6 Stefan Urbanek * STCompiler: compileString: fixed exception reporting. 2003 Apr 04 David Ayers * GNUmakefile: Added flags to show all warnings except for import. * STBlock.m: Initialzed variables to supress compiler warnings. * STCompiledMethod.m: Added needed import. * STCompiler.m: Added missing declaration. Wrapped declarations only needed for DEBUG into #ifdefs to supress compiler warnings. Initialzed variables to supress compiler warnings. * STExecutionContext.m: Unified name for private categories. 2003 Mar 25 Stefan Urbanek * STSourceReader: added missing [super dealloc] * STCompiledCode: do not retain bytecode data * STCompiler: various memory leak fixes * SmalltalkEngine: guard compilation exception and release the compiler 2003 Mar 23 Stefan Urbanek * STSourceReader: added some end of string checks 2003 Feb 3 Stefan Urbanek * Version 0.7.0 2003 Feb 3 Stefan Urbanek * STSourceReader: fixed reading of a number terminated with '.', we treat it as an integer. Reader was complaining about i := 1.; fixed reading of var:=something. It was terating 'var:' as a selector keyword. 2003 Jan 30 Stefan Urbanek * ChangeLog, STBlock.m, STBytecodes.h, STBytecodes.m, STCompiledMethod.m, STCompiler.h, STCompiler.m, STCompilerUtils.h, STCompilerUtils.m, STExecutionContext.m, STGrammar.m, STGrammar.y, STLiterals.h, STLiterals.m, STMethodContext.h, STSourceReader.h, SmalltalkEngine.m: Cleanup of compiler warnings 2002 Dec 25 Stefan Urbanek * Version 0.6.2 2002 Dec 21 Stefan Urbanek * STSourceReader, STCompiler, STGrammar: Added real number parsing 2002 Sep 15 Stefan Urbanek * Version 0.6.1 2002 Aug 30 Stefan Urbanek * Code cleanup. 2002 Jun 14 Stefan Urbanek * STMethodContext: Raise exception on invalid reference, not on undefined object 2002 Jun 13 Stefan Urbanek * STCompiledMethod: Removed unused methods * STBytecodeInterpreter: rewritten context handling; removed unused methods * STBlockContext: rewritten context handling; cleaned exception handler * STGrammar.y: fixed empty arrays #() * STExecutionContext: removed parent context as it is longer used 2002 Jun 7 Stefan Urbanek * STBytecodeInterpreter: fixed debug-log bug 2002 Jun 6 Stefan Urbanek * STSourceReader: fixed bug in reading number token type and binary selectors beginning with the '-' character. * Moved NSObject-additions to the StepTalk sources 2002 May 29 Stefan Urbanek * STCompiledScript: assign return value on executing single-method script 2002 May 15 Stefan Urbanek * STCompiler, Externs, STGrammar: fixed undefined exceptions (reported by Björn Gohla ) 2002 Mar 17 Stefan Urbanek * STCompiler, STGrammar: changed grammar to be able to have "methods" or "just statements" in source 2002 Feb 14 Stefan Urbanek * STSourceReader: Retain character sets 2002 Feb 5 Stefan Urbanek * STSelector+additions.[hm]: new files * STCompiler: use STSelector class for symbol literals 2002 Feb 3 Stefan Urbanek * STScriptObject: handle special method 'exit' * STBytecodeInterpreter: added code to halt the interpreter and return from all contexts 2002 Jan 31 Stefan Urbanek * STBlock: small speed improvements * STBlockContext: removed evaluateWithArguments:count:, and moved code into STBLock 2002 Jan 23 Stefan Urbanek * NSNumber+additions: moved arithmetic code to the library 2002 Jan 22 Stefan Urbanek * STCompiler: create one more duplicate of stack top when assigning to a variable. 2002 Jan 9 Stefan Urbanek * SmalltalkEngine: implemented executeScript:inEnvironment: 2001 Dec 8 Stefan Urbanek * Fixed temporary variable compilation * Added special handling of nil, YES and NO constants; added corresponding bytecodes 2001 Dec 8 Stefan Urbanek * CahgeLog started