ResourcePack.st
changeset 4670 d4053f688cdb
parent 4656 e7746815918b
child 4673 e469f094c7e3
equal deleted inserted replaced
4669:ea716a51e589 4670:d4053f688cdb
   453 
   453 
   454 processResourceLine:lineString encoding:encodingSymbolOrEncoder file:fileName printErrorWith:printError for:aResourcePack keepUselessTranslations:keepUselessTranslations
   454 processResourceLine:lineString encoding:encodingSymbolOrEncoder file:fileName printErrorWith:printError for:aResourcePack keepUselessTranslations:keepUselessTranslations
   455     "process a single valid line (i.e. #ifdef & #include has already been processed)"
   455     "process a single valid line (i.e. #ifdef & #include has already been processed)"
   456 
   456 
   457     |name decodedLine lineStream idx rest macroName value 
   457     |name decodedLine lineStream idx rest macroName value 
   458      conditional hasError decoder oldValue ignoreTranslation|
   458      conditional hasError decoder oldValue ignoreTranslation indirect|
   459 
   459 
   460     encodingSymbolOrEncoder notNil ifTrue:[
   460     encodingSymbolOrEncoder notNil ifTrue:[
   461         encodingSymbolOrEncoder isSymbol ifTrue:[
   461         encodingSymbolOrEncoder isSymbol ifTrue:[
   462             decoder := CharacterEncoder encoderFor:encodingSymbolOrEncoder ifAbsent:nil.
   462             decoder := CharacterEncoder encoderFor:encodingSymbolOrEncoder ifAbsent:nil.
   463             decoder isNil ifTrue:[ decoder := CharacterEncoder::NullEncoder ].
   463             decoder isNil ifTrue:[ decoder := CharacterEncoder::NullEncoder ].
   511         lineStream skipThrough:$>.
   511         lineStream skipThrough:$>.
   512         lineStream skipSeparators.
   512         lineStream skipSeparators.
   513         idx := lineStream position1Based + 1.
   513         idx := lineStream position1Based + 1.
   514     ].
   514     ].
   515 
   515 
   516     conditional := false.
   516     conditional := indirect := false.
   517     lineStream peek == $? ifTrue:[
   517     lineStream peek == $? ifTrue:[
       
   518         conditional := true.
   518         lineStream next.
   519         lineStream next.
   519         lineStream skipSeparators.
   520         lineStream skipSeparators.
   520         conditional := true.
   521     ].
       
   522 
       
   523     lineStream peek == $@ ifTrue:[
       
   524         indirect := true.
       
   525         lineStream next.
       
   526         lineStream skipSeparators.
   521     ].
   527     ].
   522 
   528 
   523     lineStream peek == $= ifTrue:[
   529     lineStream peek == $= ifTrue:[
   524         lineStream next.
   530         lineStream next.
   525 
   531 
   590                         printError value:('newValue: ' , value printString).
   596                         printError value:('newValue: ' , value printString).
   591                     ] ifFalse:[
   597                     ] ifFalse:[
   592                         printError value:('duplicate resource: "' , name , '"').
   598                         printError value:('duplicate resource: "' , name , '"').
   593                     ].
   599                     ].
   594                 ].
   600                 ].
       
   601                 indirect ifTrue:[
       
   602                     value := aResourcePack string:value.
       
   603                 ].
   595                 aResourcePack at:name put:value.
   604                 aResourcePack at:name put:value.
   596             ]
   605             ]
   597         ]
   606         ]
   598     ]
   607     ]
   599 
   608 
   600     "Modified: / 18-09-2006 / 20:33:49 / cg"
   609     "Modified: / 23-10-2006 / 23:11:22 / cg"
   601 ! !
   610 ! !
   602 
   611 
   603 !ResourcePack methodsFor:'accessing'!
   612 !ResourcePack methodsFor:'accessing'!
   604 
   613 
   605 array:anArray
   614 array:anArray
  1255 ! !
  1264 ! !
  1256 
  1265 
  1257 !ResourcePack class methodsFor:'documentation'!
  1266 !ResourcePack class methodsFor:'documentation'!
  1258 
  1267 
  1259 version
  1268 version
  1260     ^ '$Header: /cvs/stx/stx/libview/ResourcePack.st,v 1.119 2006-10-20 10:15:40 cg Exp $'
  1269     ^ '$Header: /cvs/stx/stx/libview/ResourcePack.st,v 1.120 2006-10-23 21:11:08 cg Exp $'
  1261 ! !
  1270 ! !
  1262 
  1271 
  1263 ResourcePack initialize!
  1272 ResourcePack initialize!