Revert "Use go-ansiterm version matching docker/pkg/term/windows v1.11"

This reverts commit 72044a11a1.
This commit is contained in:
Jeff Grafton
2017-07-14 17:33:21 -07:00
parent 226b39c6b5
commit f52615894f
26 changed files with 333 additions and 697 deletions

View File

@@ -1,41 +1,41 @@
package ansiterm
type CsiEntryState struct {
BaseState
type csiEntryState struct {
baseState
}
func (csiState CsiEntryState) Handle(b byte) (s State, e error) {
func (csiState csiEntryState) Handle(b byte) (s state, e error) {
logger.Infof("CsiEntry::Handle %#x", b)
nextState, err := csiState.BaseState.Handle(b)
nextState, err := csiState.baseState.Handle(b)
if nextState != nil || err != nil {
return nextState, err
}
switch {
case sliceContains(Alphabetics, b):
return csiState.parser.Ground, nil
case sliceContains(CsiCollectables, b):
return csiState.parser.CsiParam, nil
case sliceContains(Executors, b):
case sliceContains(alphabetics, b):
return csiState.parser.ground, nil
case sliceContains(csiCollectables, b):
return csiState.parser.csiParam, nil
case sliceContains(executors, b):
return csiState, csiState.parser.execute()
}
return csiState, nil
}
func (csiState CsiEntryState) Transition(s State) error {
func (csiState csiEntryState) Transition(s state) error {
logger.Infof("CsiEntry::Transition %s --> %s", csiState.Name(), s.Name())
csiState.BaseState.Transition(s)
csiState.baseState.Transition(s)
switch s {
case csiState.parser.Ground:
case csiState.parser.ground:
return csiState.parser.csiDispatch()
case csiState.parser.CsiParam:
case csiState.parser.csiParam:
switch {
case sliceContains(CsiParams, csiState.parser.context.currentChar):
case sliceContains(csiParams, csiState.parser.context.currentChar):
csiState.parser.collectParam()
case sliceContains(Intermeds, csiState.parser.context.currentChar):
case sliceContains(intermeds, csiState.parser.context.currentChar):
csiState.parser.collectInter()
}
}
@@ -43,7 +43,7 @@ func (csiState CsiEntryState) Transition(s State) error {
return nil
}
func (csiState CsiEntryState) Enter() error {
func (csiState csiEntryState) Enter() error {
csiState.parser.clear()
return nil
}