MCPcopy Create free account
hub / github.com/Achain-Dev/Achain / skipcomment

Function skipcomment

src/Chain/libraries/glua/lauxlib.cpp:694–704  ·  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

692** a first-line comment).
693*/
694static int skipcomment(LoadF *lf, int *cp) {
695 int c = *cp = skipBOM(lf);
696 if (c == '#') { /* first line is a comment (Unix exec. file)? */
697 do { /* skip first line */
698 c = getc(lf->f);
699 } while (c != EOF && c != '\n');
700 *cp = getc(lf->f); /* skip end-of-line, if present */
701 return 1; /* there was a comment */
702 }
703 else return 0; /* no comment */
704}
705
706static lua_State *globalL = nullptr;
707static const char *progname = "thinkyoung_lua";

Callers 3

luaL_is_bytecode_fileFunction · 0.85
luaL_loadfilexFunction · 0.85
lua_compilefile_preloadFunction · 0.85

Calls 1

skipBOMFunction · 0.85

Tested by

no test coverage detected