Handle comments in N-Quad documents and REPL
The parser rejects an N-Quad with a comment, so we filter those out ahead of time. This simplifies the grammar and code generated by the parser.
This commit is contained in:
parent
dc17ccae80
commit
d76213fb2d
3 changed files with 71 additions and 6 deletions
|
|
@ -99,6 +99,11 @@ func Repl(ts graph.TripleStore, queryLanguage string, cfg *config.Config) error
|
|||
if len(line) == 0 {
|
||||
continue
|
||||
}
|
||||
line = bytes.TrimSpace(line)
|
||||
if len(line) == 0 || line[0] == '#' {
|
||||
line = line[:0]
|
||||
continue
|
||||
}
|
||||
if bytes.HasPrefix(line, []byte(":debug")) {
|
||||
ses.ToggleDebug()
|
||||
fmt.Println("Debug Toggled")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue