-
Notifications
You must be signed in to change notification settings - Fork 0
/
steps-version.go
67 lines (60 loc) · 1.26 KB
/
steps-version.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
package scanner //nolint:dupl
import (
"github.com/jsightapi/jsight-api-core/jerr"
)
func stateV(s *Scanner, c byte) *jerr.JApiError {
switch c {
case 'e':
s.step = stateVe
return nil
default:
return s.japiErrorUnexpectedChar("in directive Version", "e")
}
}
func stateVe(s *Scanner, c byte) *jerr.JApiError {
switch c {
case 'r':
s.step = stateVer
return nil
default:
return s.japiErrorUnexpectedChar("in keyword Version", "r")
}
}
func stateVer(s *Scanner, c byte) *jerr.JApiError {
switch c {
case 's':
s.step = stateVers
return nil
default:
return s.japiErrorUnexpectedChar("in keyword Version", "s")
}
}
func stateVers(s *Scanner, c byte) *jerr.JApiError {
switch c {
case 'i':
s.step = stateVersi
return nil
default:
return s.japiErrorUnexpectedChar("in keyword Version", "i")
}
}
func stateVersi(s *Scanner, c byte) *jerr.JApiError {
switch c {
case 'o':
s.step = stateVersio
return nil
default:
return s.japiErrorUnexpectedChar("in keyword Version", "o")
}
}
func stateVersio(s *Scanner, c byte) *jerr.JApiError {
switch c {
case 'n':
s.found(KeywordEnd)
s.stepStack.Push(stateExpectKeyword)
s.step = stateParameterOrAnnotation
return nil
default:
return s.japiErrorUnexpectedChar("in keyword Version", "n")
}
}