CharacterArray.st
changeset 17442 eccdc56fffa4
parent 17371 cbb00370b456
child 17468 dea693453518
equal deleted inserted replaced
17441:c2c709b7c981 17442:eccdc56fffa4
   261 
   261 
   262     "
   262     "
   263      String fromIntegerArray: #[8 127]
   263      String fromIntegerArray: #[8 127]
   264     "
   264     "
   265 ! !
   265 ! !
   266 
       
   267 
   266 
   268 !CharacterArray class methodsFor:'Signal constants'!
   267 !CharacterArray class methodsFor:'Signal constants'!
   269 
   268 
   270 decodingFailedSignal
   269 decodingFailedSignal
   271     "return the signal, raised when decoding of a string is not possible
   270     "return the signal, raised when decoding of a string is not possible
  1647      'hello' quote unquote
  1646      'hello' quote unquote
  1648 
  1647 
  1649      JavaScriptParser evaluate:'''hello''.quote.unquote' 
  1648      JavaScriptParser evaluate:'''hello''.quote.unquote' 
  1650     "
  1649     "
  1651 ! !
  1650 ! !
  1652 
       
  1653 
  1651 
  1654 
  1652 
  1655 !CharacterArray methodsFor:'character searching'!
  1653 !CharacterArray methodsFor:'character searching'!
  1656 
  1654 
  1657 includesMatchCharacters
  1655 includesMatchCharacters
  7066     |state|
  7064     |state|
  7067 
  7065 
  7068     state := #initial.
  7066     state := #initial.
  7069     self do:[:char |
  7067     self do:[:char |
  7070         (state == #initial or:[ state == #gotColon]) ifTrue:[
  7068         (state == #initial or:[ state == #gotColon]) ifTrue:[
  7071             (char isLetter or:[ char == $_ ]) ifFalse:[^ false].
  7069             (char isLetterOrUnderline) ifFalse:[^ false].
  7072             state := #gotCharacter.
  7070             state := #gotCharacter.
  7073         ] ifFalse:[
  7071         ] ifFalse:[
  7074             char == $: ifTrue:[
  7072             char == $: ifTrue:[
  7075                 state := #gotColon.
  7073                 state := #gotColon.
  7076             ] ifFalse:[
  7074             ] ifFalse:[
  7154 !
  7152 !
  7155 
  7153 
  7156 isUnarySelector
  7154 isUnarySelector
  7157     "Answer true if the receiver contains only chars in an ANSI unary method selector, false otherwise."
  7155     "Answer true if the receiver contains only chars in an ANSI unary method selector, false otherwise."
  7158 
  7156 
  7159     ^ (self first isLetter or:[ self first == $_ ])
  7157     ^ (self first isLetterOrUnderline)
  7160       and:[ self conform: [ :chr | chr isLetterOrDigit or:[chr == $_] ]]
  7158       and:[ self conform: [ :chr | chr isLetterOrDigit or:[chr == $_] ]]
  7161 
  7159 
  7162     "Modified: / 13-09-2006 / 11:35:15 / cg"
  7160     "Modified: / 13-09-2006 / 11:35:15 / cg"
  7163 !
  7161 !
  7164 
  7162 
  7294 ! !
  7292 ! !
  7295 
  7293 
  7296 !CharacterArray class methodsFor:'documentation'!
  7294 !CharacterArray class methodsFor:'documentation'!
  7297 
  7295 
  7298 version
  7296 version
  7299     ^ '$Header: /cvs/stx/stx/libbasic/CharacterArray.st,v 1.566 2015-02-03 13:32:43 cg Exp $'
  7297     ^ '$Header: /cvs/stx/stx/libbasic/CharacterArray.st,v 1.567 2015-02-07 15:37:53 cg Exp $'
  7300 !
  7298 !
  7301 
  7299 
  7302 version_CVS
  7300 version_CVS
  7303     ^ '$Header: /cvs/stx/stx/libbasic/CharacterArray.st,v 1.566 2015-02-03 13:32:43 cg Exp $'
  7301     ^ '$Header: /cvs/stx/stx/libbasic/CharacterArray.st,v 1.567 2015-02-07 15:37:53 cg Exp $'
  7304 ! !
  7302 ! !
  7305 
  7303 
  7306 
  7304 
  7307 CharacterArray initialize!
  7305 CharacterArray initialize!