]> git.saurik.com Git - cycript.git/blobdiff - Scanner.lpp.in
Implement toPointer for CString, Pointer, Functor.
[cycript.git] / Scanner.lpp.in
index 6d79127ed9aba86290632c19604c3d0085b740be..235dc8052285d9ba7e844fff0459f19178b5d38e 100644 (file)
@@ -184,15 +184,9 @@ static unsigned U(char *&local, const char *text, yy_size_t &i) {
     I(type, Type(P.strmemdup(yyextra->buffer_.data(), yyextra->buffer_.size()), yyextra->buffer_.size()), value, highlight); \
 } while (false)
 
-#define YY_INPUT(data, value, size) { \
-    if (yyextra->data_.eof()) \
-        value = YY_NULL; \
-    else { \
-        yyextra->data_.read(data, size); \
-        size_t copy(yyextra->data_.gcount()); \
-        value = copy == 0 ? YY_NULL : copy; \
-    } \
-}
+#define YY_INPUT(data, value, size) do { \
+    value = yyextra->data_.sgetn(data, size) ?: YY_NULL; \
+} while (false)
 
 %}