print_grammar to stderr (#1052)

This commit is contained in:
Joseph Turian 2024-01-10 02:46:03 -05:00 committed by GitHub
parent 431cb3ec81
commit 2ddce7294e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -72,7 +72,7 @@ class LlamaGrammar:
)
if verbose:
print(f"{cls.from_string.__name__} grammar:", file=sys.stderr)
print_grammar(sys.stdout, parsed_grammar)
print_grammar(sys.stderr, parsed_grammar)
print(file=sys.stderr)
return cls(parsed_grammar)