ChangeDeltaInformation.st
author Jan Vrany <jan.vrany@fit.cvut.cz>
Sun, 29 Jan 2012 12:51:41 +0000
branchjv
changeset 3011 1997ff6e7e55
parent 2493 457dd1375734
child 3012 4f40b8304d54
permissions -rw-r--r--
trunk branched into /branches/jv

"{ Package: 'stx:libbasic3' }"

Object subclass:#ChangeDeltaInformation
	instanceVariableNames:'shortDeltaSymbol'
	classVariableNames:'Unknown Identical Different Added Removed IdenticalButWhiteSpace
		IdenticalButFormat IdenticalSemantically'
	poolDictionaries:''
	category:'System-Changes'
!

!ChangeDeltaInformation class methodsFor:'documentation'!

documentation
"
    delta used to return a symbol (#=, #~, #+ or #-);
    for more detail, use instances of me:
        Unknown                 delta is unknown
        Identical               exactly the same
        IdenticalButWhiteSpace  code is formatted different, but AST is the same
        SemanticallyIdentical   code is different, but semantically the same
                                (for example, ifNil: -> isNil ifTrue:)
        Different               code is different
        Added                   method/class is added by change
        Removed                 method/class is removed by change
"
! !

!ChangeDeltaInformation class methodsFor:'initialization'!

initialize
    Unknown                 := self new shortDeltaSymbol:#'?'.    "/ delta is unknown
    Identical               := self new shortDeltaSymbol:#'='.    "/ exactly the same
    IdenticalButWhiteSpace  := self new shortDeltaSymbol:#'W'.    "/ code is the same except for indentation
    IdenticalButFormat      := self new shortDeltaSymbol:#'F'.    "/ code is formatted different, but AST is the same
    IdenticalSemantically   := self new shortDeltaSymbol:#'%'.    "/ code is different, but semantically the same
                                                                  "/ (for example, ifNil: -> isNil ifTrue:)
    Different               := self new shortDeltaSymbol:#'~'.    "/ code is different
    Added                   := self new shortDeltaSymbol:#'+'.    "/ method/class is added by change
    Removed                 := self new shortDeltaSymbol:#'-'.    "/ method/class is removed by change

    "Created: / 31-08-2011 / 10:09:24 / cg"
! !

!ChangeDeltaInformation class methodsFor:'accessing'!

added
    "method/class is added by change"

    ^ Added

    "Modified (comment): / 31-08-2011 / 10:20:51 / cg"
!

different
    "code is different"

    ^ Different

    "Modified (comment): / 31-08-2011 / 10:21:07 / cg"
!

identical
    "exactly the same"

    ^ Identical

    "Modified (comment): / 31-08-2011 / 10:21:18 / cg"
!

identicalButFormat
    "code is formatted different, but AST is the same"

    ^ IdenticalButFormat

    "Created: / 31-08-2011 / 10:23:18 / cg"
!

identicalButWhiteSpace
    "code is the same except for indentation"

    ^ IdenticalButWhiteSpace

    "Modified (comment): / 31-08-2011 / 10:23:49 / cg"
!

identicalSemantically
    "code is different, but semantically the same.
     (for example, ifNil: -> isNil ifTrue:)"

    ^ IdenticalSemantically

    "Modified (comment): / 31-08-2011 / 10:24:04 / cg"
!

removed
    "method/class is removed by change"

    ^ Removed

    "Modified (comment): / 31-08-2011 / 10:24:14 / cg"
!

unknown
    "another change / cannot figure out what has changed"

    ^ Unknown

    "Created: / 31-08-2011 / 10:20:13 / cg"
! !

!ChangeDeltaInformation methodsFor:'accessing'!

shortDeltaSymbol
    ^ shortDeltaSymbol

    "Created: / 31-08-2011 / 10:39:01 / cg"
!

shortDeltaSymbol:something
    shortDeltaSymbol := something.

    "Created: / 31-08-2011 / 10:39:05 / cg"
! !

!ChangeDeltaInformation class methodsFor:'documentation'!

version
    ^ '$Header: /cvs/stx/stx/libbasic3/ChangeDeltaInformation.st,v 1.1 2011/08/31 09:45:27 cg Exp $'
!

version_CVS
    ^ '§Header: /cvs/stx/stx/libbasic3/ChangeDeltaInformation.st,v 1.1 2011/08/31 09:45:27 cg Exp §'
! !

ChangeDeltaInformation initialize!