(nextRunes []rune, curEncoding byte)
| 21 | } |
| 22 | |
| 23 | func shouldUseCTable(nextRunes []rune, curEncoding byte) bool { |
| 24 | requiredDigits := 4 |
| 25 | if curEncoding == startCSymbol { |
| 26 | requiredDigits = 2 |
| 27 | } |
| 28 | if len(nextRunes) < requiredDigits { |
| 29 | return false |
| 30 | } |
| 31 | for i := 0; i < requiredDigits; i++ { |
| 32 | if i%2 == 0 && nextRunes[i] == FNC1 { |
| 33 | requiredDigits++ |
| 34 | if len(nextRunes) < requiredDigits { |
| 35 | return false |
| 36 | } |
| 37 | continue |
| 38 | } |
| 39 | if nextRunes[i] < '0' || nextRunes[i] > '9' { |
| 40 | return false |
| 41 | } |
| 42 | } |
| 43 | return true |
| 44 | } |
| 45 | |
| 46 | func tableContainsRune(table string, r rune) bool { |
| 47 | return strings.ContainsRune(table, r) || r == FNC1 || r == FNC2 || r == FNC3 || r == FNC4 |
no outgoing calls