| 56 | } |
| 57 | |
| 58 | UInt8 ScriptReader::followingType() { |
| 59 | if (_current == _end) |
| 60 | return END; |
| 61 | |
| 62 | switch (lua_type(_pState, _current)) { |
| 63 | case LUA_TSTRING: |
| 64 | return STRING; |
| 65 | case LUA_TBOOLEAN: |
| 66 | return BOOLEAN; |
| 67 | case LUA_TNUMBER: |
| 68 | return NUMBER; |
| 69 | case LUA_TNIL: |
| 70 | return NIL; |
| 71 | case LUA_TTABLE: { |
| 72 | lua_getfield(_pState, _current, "__raw"); |
| 73 | if (lua_isstring(_pState, -1)) { |
| 74 | lua_pop(_pState, 1); |
| 75 | return BYTES; |
| 76 | } |
| 77 | lua_pop(_pState, 1); |
| 78 | |
| 79 | lua_getfield(_pState, _current, "__time"); |
| 80 | if (lua_isnumber(_pState, -1)) { |
| 81 | lua_pop(_pState, 1); |
| 82 | return DATE; |
| 83 | } |
| 84 | lua_pop(_pState, 1); |
| 85 | } |
| 86 | } |
| 87 | return OTHER; |
| 88 | } |
| 89 | |
| 90 | bool ScriptReader::readOne(UInt8 type,DataWriter& writer) { |
| 91 |
nothing calls this directly
no outgoing calls
no test coverage detected