MCPcopy Index your code
hub / github.com/Shopify/go-lua / skipComment

Function skipComment

auxiliary.go:462–482  ·  view source on GitHub ↗
(r *bufio.Reader)

Source from the content-addressed store, hash-verified

460}
461
462func skipComment(r *bufio.Reader) (bool, error) {
463 bom := "\xEF\xBB\xBF"
464 if ba, err := r.Peek(len(bom)); err != nil && err != io.EOF {
465 return false, err
466 } else if string(ba) == bom {
467 _, _ = r.Read(ba)
468 }
469 if c, _, err := r.ReadRune(); err != nil {
470 if err == io.EOF {
471 err = nil
472 }
473 return false, err
474 } else if c == '#' {
475 _, err = r.ReadBytes('\n')
476 if err == io.EOF {
477 err = nil
478 }
479 return true, err
480 }
481 return false, r.UnreadRune()
482}
483
484func LoadFile(l *State, fileName, mode string) error {
485 var f *os.File

Callers 1

LoadFileFunction · 0.85

Calls 1

ReadMethod · 0.80

Tested by

no test coverage detected