*** empty log message ***
authorClaus Gittinger <cg@exept.de>
Fri, 11 Sep 2009 15:06:21 +0200
changeset 2194 46cb5c8810b2
parent 2193 9416fc17ee62
child 2195 2996fe27c2f8
*** empty log message ***
Parser.st
--- a/Parser.st	Tue Sep 08 17:58:35 2009 +0200
+++ b/Parser.st	Fri Sep 11 15:06:21 2009 +0200
@@ -6162,21 +6162,32 @@
 !
 
 literalInlineObjectFor:namesAndValues
-    |class instance names values|
+    |class instance names values inlineObjectsAreReadonly|
+
+    inlineObjectsAreReadonly := true.
 
     names := namesAndValues collect:[:each | each key].
     values := namesAndValues collect:[:each | each value].
 
-    class := ClassDescription new.
+    class := InlineObjectClassDescription new.
     class setSuperclass: InlineObject.
     class setInstanceVariableString:(names asStringWith:Character space).
     class instSize: names size.
 
     names keysAndValuesDo:[:idx :instVarName | 
-"/        Compiler compile:('%1 ^%1' bindWith:instVarName) forClass:class.
-"/        Compiler compile:('%1:something %1 := something' bindWith:instVarName) forClass:class.
-        class basicAddSelector:(instVarName asSymbol) withMethod:(InlineObjectPrototype compiledMethodAt:('i%1' bindWith:idx) asSymbol). 
-        class basicAddSelector:((instVarName,':') asSymbol) withMethod:(InlineObjectPrototype compiledMethodAt:('i%1:' bindWith:idx) asSymbol). 
+        idx <= InlineObjectPrototype instSize ifTrue:[
+            class basicAddSelector:(instVarName asSymbol) withMethod:(InlineObjectPrototype compiledMethodAt:('i%1' bindWith:idx) asSymbol). 
+            inlineObjectsAreReadonly ifFalse:[
+                class basicAddSelector:((instVarName,':') asSymbol) withMethod:(InlineObjectPrototype compiledMethodAt:('i%1:' bindWith:idx) asSymbol). 
+            ].
+        ] ifFalse:[
+            Class withoutUpdatingChangesDo:[
+                Compiler compile:('%1 ^%1' bindWith:instVarName) forClass:class.
+                inlineObjectsAreReadonly ifFalse:[
+                    Compiler compile:('%1:something %1 := something' bindWith:instVarName) forClass:class.
+                ].
+            ].
+        ].
     ].
 
     instance := class new.
@@ -7102,7 +7113,7 @@
 
 qualifiedNameOrInlineObject
     "either a vw3.x (and later) QualifiedName #{ id ... id }
-     or an ST&X experimental inline object #{ name: value. ... name: value }
+     or an ST/X experimental inline object #{ name: value. ... name: value }
      The initial #{ is skipped here, but the position passed down."
 
     |pos1|
@@ -9577,7 +9588,7 @@
 !Parser class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libcomp/Parser.st,v 1.604 2009-09-08 15:55:59 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libcomp/Parser.st,v 1.605 2009-09-11 13:06:21 cg Exp $'
 ! !
 
 Parser initialize!