comment/format in: #primary_dolphinComputedLiteral
authorClaus Gittinger <cg@exept.de>
Thu, 22 Oct 2009 12:30:54 +0200
changeset 2224 07830bba4407
parent 2223 50b76baab48b
child 2225 caacd294cddc
comment/format in: #primary_dolphinComputedLiteral changed: #checkSelector:for:inClass:
Parser.st
--- a/Parser.st	Tue Oct 20 10:41:26 2009 +0200
+++ b/Parser.st	Thu Oct 22 12:30:54 2009 +0200
@@ -2346,7 +2346,7 @@
                 ]
             ]
         ] ifFalse:[
-            (mthd sends:#subclassResponsibility) ifTrue:[
+            ((mthd sends:#subclassResponsibility) or:[ mthd sends:#subclassResponsibility: ]) ifTrue:[
                 allowed := (cls == classToCompileFor).      "methods in abstract classes may send messages to abstract methods in the same class"
                 allowed ifFalse:[
                     "methods in abstract classes may send messages to abstract methods in meta class"
@@ -6454,8 +6454,12 @@
      and create a literal constant for the expressions value.
      Right now, only a subset is supported - Strings, ByteArrays and Characters.
      WARNING: this is only supported to allow filing in dolphin code.
-     since stc cannot handle this (at the moment), you should rewrite the code
-     if you ever plan to stc-compile it into a shared library"
+     Since stc cannot handle this (at the moment), you should rewrite the code
+     if you ever plan to stc-compile it into a shared library.
+     The question is still: how should stc ever be able to do this, as it cannot execute
+     smalltalk code; it could generate code to execute it at initialization time of the
+     generated code, but then, it is no longer a compile-time constant (for example, generating
+     a compilation-Date constant is then not possible...)"
 
     |pos expr val|
 
@@ -6498,7 +6502,15 @@
         self parseError:'must be representable as a literal (for now)' position:pos.
         ^ #Error
     ].
-self shouldImplement.
+
+    self shouldImplement.
+
+    "
+     ParserFlags allowDolphinExtensions:true.
+     Parser evaluate:' ##( 5 * 7) '.
+     ParserFlags allowDolphinExtensions:false.
+    "
+
 "/    "/ make it an array creation expression ...
 "/    expr := MessageNode 
 "/            receiver:(VariableNode globalNamed:#Array)
@@ -9647,11 +9659,11 @@
 !Parser class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libcomp/Parser.st,v 1.612 2009-10-20 08:41:09 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libcomp/Parser.st,v 1.613 2009-10-22 10:30:54 cg Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libcomp/Parser.st,v 1.612 2009-10-20 08:41:09 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libcomp/Parser.st,v 1.613 2009-10-22 10:30:54 cg Exp $'
 ! !
 
 Parser initialize!