Skip to content

Commit

Permalink
compiler: Do not output empty grammars (#4001)
Browse files Browse the repository at this point in the history
  • Loading branch information
Vicent Martí authored Jan 25, 2018
1 parent 60f748d commit 8438c6c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tools/grammars/compiler/converter.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,10 @@ func (conv *Converter) ConvertGrammars(update bool) error {
repo.FixRules(knownScopes)

if update {
conv.grammars[source] = repo.Scopes()
scopes := repo.Scopes()
if len(scopes) > 0 {
conv.grammars[source] = scopes
}
} else {
expected := conv.grammars[source]
repo.CompareScopes(expected)
Expand Down

0 comments on commit 8438c6c

Please sign in to comment.