MCPcopy Create free account
hub / github.com/Singular/Singular / input

Function input

Singular/scanner.cc:1793–1860  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1791static int yyinput()
1792#else
1793static int input()
1794#endif
1795 {
1796 int c;
1797
1798 *yy_c_buf_p = yy_hold_char;
1799
1800 if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
1801 {
1802 /* yy_c_buf_p now points to the character we want to return.
1803 * If this occurs *before* the EOB characters, then it's a
1804 * valid NUL; if not, then we've hit the end of the buffer.
1805 */
1806 if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] )
1807 /* This was really a NUL. */
1808 *yy_c_buf_p = '\0';
1809
1810 else
1811 { /* need more input */
1812 int offset = yy_c_buf_p - yytext_ptr;
1813 ++yy_c_buf_p;
1814
1815 switch ( yy_get_next_buffer() )
1816 {
1817 case EOB_ACT_LAST_MATCH:
1818 /* This happens because yy_g_n_b()
1819 * sees that we've accumulated a
1820 * token and flags that we need to
1821 * try matching the token before
1822 * proceeding. But for input(),
1823 * there's no matching to consider.
1824 * So convert the EOB_ACT_LAST_MATCH
1825 * to EOB_ACT_END_OF_FILE.
1826 */
1827
1828 /* Reset buffer status. */
1829 yyrestart( yyin );
1830
1831 /* fall through */
1832
1833 case EOB_ACT_END_OF_FILE:
1834 {
1835 if ( yywrap() )
1836 return EOF;
1837
1838 if ( ! yy_did_buffer_switch_on_eof )
1839 YY_NEW_FILE;
1840#ifdef __cplusplus
1841 return yyinput();
1842#else
1843 return input();
1844#endif
1845 }
1846
1847 case EOB_ACT_CONTINUE_SCAN:
1848 yy_c_buf_p = yytext_ptr + offset;
1849 break;
1850 }

Callers

nothing calls this directly

Calls 2

yywrapFunction · 0.85
yy_get_next_bufferFunction · 0.70

Tested by

no test coverage detected