MCPcopy Create free account
hub / github.com/ObEngine/ObEngine / compat53_skipcomment

Function compat53_skipcomment

extlibs/sol3/include/sol/sol.hpp:2901–2911  ·  view source on GitHub ↗

** reads the first character of file 'f' and skips an optional BOM mark ** in its beginning plus its first line if it starts with '#'. Returns ** true if it skipped the first line. In any case, '*cp' has the ** first "valid" character of the file (after the optional BOM and ** a first-line comment). */

Source from the content-addressed store, hash-verified

2899** a first-line comment).
2900*/
2901static int compat53_skipcomment(compat53_LoadF *lf, int *cp) {
2902 int c = *cp = compat53_skipBOM(lf);
2903 if (c == '#') { /* first line is a comment (Unix exec. file)? */
2904 do { /* skip first line */
2905 c = getc(lf->f);
2906 } while (c != EOF && c != '\n');
2907 *cp = getc(lf->f); /* skip end-of-line, if present */
2908 return 1; /* there was a comment */
2909 }
2910 else return 0; /* no comment */
2911}
2912
2913COMPAT53_API int luaL_loadfilex(lua_State *L, const char *filename, const char *mode) {
2914 compat53_LoadF lf;

Callers 1

luaL_loadfilexFunction · 0.85

Calls 1

compat53_skipBOMFunction · 0.85

Tested by

no test coverage detected