ResourcePack.st
changeset 3807 ddb031431ff6
parent 3769 4b0f188d7f5c
child 3808 b2e08ce8e918
--- a/ResourcePack.st	Tue Feb 25 10:30:46 2003 +0100
+++ b/ResourcePack.st	Tue Feb 25 12:46:18 2003 +0100
@@ -543,17 +543,17 @@
     lineString := aLine withoutSeparators.
     name := nil.
     (lineString at:1) == $' ifTrue:[
-	stream := ReadStream on:lineString.
-	stream signalAtEnd:false.
-	name := String 
-		    readFrom:stream 
-		    onError:[('ResourcePack [warning]: invalid line <'
-			     ,lineString
-			     ,'> in file:'
-			     , fileName
-			    ) errorPrintCR. nil].
+        stream := ReadStream on:lineString.
+        stream signalAtEnd:false.
+        name := String 
+                    readFrom:stream 
+                    onError:[('ResourcePack [warning]: invalid line <'
+                             ,lineString
+                             ,'> in file:'
+                             , fileName
+                            ) errorPrintCR. nil].
 "/ OLD: l := stream position
-	l := stream position + 1.
+        l := stream position1Based + 1.
 
 "/                          l := lineString indexOf:$' startingAt:2.
 "/                          l ~~ 0 ifTrue:[
@@ -561,79 +561,79 @@
 "/                              l := l + 1
 "/                          ]
     ] ifFalse:[
-	l := lineString indexOfSeparatorStartingAt:1.
-	l ~~ 0 ifTrue:[
-	    name := lineString copyFrom:1 to:l-1.
-	]
+        l := lineString indexOfSeparatorStartingAt:1.
+        l ~~ 0 ifTrue:[
+            name := lineString copyFrom:1 to:l-1.
+        ]
     ].
     name notNil ifTrue:[
-	hasError := false.
+        hasError := false.
 
-	rest := (lineString copyFrom:l) withoutSeparators.
-	"
-	 skip <type> if present
-	"
-	(rest startsWith:$<) ifTrue:[
-	     l := lineString indexOf:$> startingAt:l.
-	     rest := (lineString copyFrom:l+1) withoutSeparators.
-	].
+        rest := (lineString copyFrom:l) withoutSeparators.
+        "
+         skip <type> if present
+        "
+        (rest startsWith:$<) ifTrue:[
+             l := lineString indexOf:$> startingAt:l.
+             rest := (lineString copyFrom:l+1) withoutSeparators.
+        ].
 
-	conditional := false.
-	(rest startsWith:$?) ifTrue:[
-	    rest := (rest copyFrom:2) withoutSeparators.
-	    conditional := true.
-	].
+        conditional := false.
+        (rest startsWith:$?) ifTrue:[
+            rest := (rest copyFrom:2) withoutSeparators.
+            conditional := true.
+        ].
 
-	(rest startsWith:$=) ifTrue:[
-	    rest := rest copyFrom:2.
-	    stream := ReadStream on:rest.
-	    macroName := stream nextAlphaNumericWord.
-	    [stream peek == $.] whileTrue:[
-		stream next.
-		stream peek notNil ifTrue:[
-		    macroName := macroName , '.' , (stream nextAlphaNumericWord)
-		]
-	    ].
-	    rest := stream upToEnd.
-	    value := self at:macroName ifAbsent:nil.
-	    (value isNil) ifTrue:[
-		hasError := true.
-		('ResourcePack [warning]: bad (nil-valued) macro: ' , macroName) errorPrintCR.
-		('ResourcePack [warning]: in line: ' , lineString) errorPrintCR.
-		('ResourcePack [warning]: in file: ' , fileName) errorPrintCR.
-	    ].
-	    value isBlock ifTrue:[
-		value := value value
-	    ].
-	    value := Compiler evaluate:('self ' , rest)
-			      receiver:value
-			      notifying:nil
-			      compile:false.
-	    (value == #Error) ifTrue:[
-		hasError := true.
-		('ResourcePack [warning]: error in line: "self ' , rest , '"') errorPrintCR.
-		('ResourcePack [warning]: in file: ' , fileName) errorPrintCR.
-	    ]
-	] ifFalse:[
-	    value := Compiler evaluate:rest compile:false.
-	    (value == #Error) ifTrue:[
-		hasError := true.
-		('ResourcePack [warning]: error in line: "' , rest , '"') errorPrintCR.
-		('ResourcePack [warning]: in file: ' , fileName) errorPrintCR.
-	    ] ifFalse:[
-		encoding notNil ifTrue:[
-		    value isString ifTrue:[
-			value := value decodeFrom:encoding
-		    ]
-		]
-	    ]
-	].
-	hasError ifFalse:[
-	    (conditional not
-	    or:[(self includesKey:name) not]) ifTrue:[
-		self at:name put:value.
-	    ]
-	]
+        (rest startsWith:$=) ifTrue:[
+            rest := rest copyFrom:2.
+            stream := ReadStream on:rest.
+            macroName := stream nextAlphaNumericWord.
+            [stream peek == $.] whileTrue:[
+                stream next.
+                stream peek notNil ifTrue:[
+                    macroName := macroName , '.' , (stream nextAlphaNumericWord)
+                ]
+            ].
+            rest := stream upToEnd.
+            value := self at:macroName ifAbsent:nil.
+            (value isNil) ifTrue:[
+                hasError := true.
+                ('ResourcePack [warning]: bad (nil-valued) macro: ' , macroName) errorPrintCR.
+                ('ResourcePack [warning]: in line: ' , lineString) errorPrintCR.
+                ('ResourcePack [warning]: in file: ' , fileName) errorPrintCR.
+            ].
+            value isBlock ifTrue:[
+                value := value value
+            ].
+            value := Compiler evaluate:('self ' , rest)
+                              receiver:value
+                              notifying:nil
+                              compile:false.
+            (value == #Error) ifTrue:[
+                hasError := true.
+                ('ResourcePack [warning]: error in line: "self ' , rest , '"') errorPrintCR.
+                ('ResourcePack [warning]: in file: ' , fileName) errorPrintCR.
+            ]
+        ] ifFalse:[
+            value := Compiler evaluate:rest compile:false.
+            (value == #Error) ifTrue:[
+                hasError := true.
+                ('ResourcePack [warning]: error in line: "' , rest , '"') errorPrintCR.
+                ('ResourcePack [warning]: in file: ' , fileName) errorPrintCR.
+            ] ifFalse:[
+                encoding notNil ifTrue:[
+                    value isString ifTrue:[
+                        value := value decodeFrom:encoding
+                    ]
+                ]
+            ]
+        ].
+        hasError ifFalse:[
+            (conditional not
+            or:[(self includesKey:name) not]) ifTrue:[
+                self at:name put:value.
+            ]
+        ]
     ]
 
     "Created: / 30.8.1998 / 12:35:37 / cg"
@@ -813,7 +813,7 @@
 !ResourcePack class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libview/ResourcePack.st,v 1.74 2002-11-20 09:56:43 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libview/ResourcePack.st,v 1.75 2003-02-25 11:46:18 cg Exp $'
 ! !
 
 ResourcePack initialize!