(l *State, fieldIndex int)
| 51 | } |
| 52 | |
| 53 | func fieldArguments(l *State, fieldIndex int) (uint, uint) { |
| 54 | f, w := CheckInteger(l, fieldIndex), OptInteger(l, fieldIndex+1, 1) |
| 55 | ArgumentCheck(l, 0 <= f, fieldIndex, "field cannot be negative") |
| 56 | ArgumentCheck(l, 0 < w, fieldIndex+1, "width must be positive") |
| 57 | if f+w > bitCount { |
| 58 | Errorf(l, "trying to access non-existent bits") |
| 59 | } |
| 60 | return uint(f), uint(w) |
| 61 | } |
| 62 | |
| 63 | var bitLibrary = []RegistryFunction{ |
| 64 | {"arshift", func(l *State) int { |
no test coverage detected