Skip to content

Commit

Permalink
Support comments at the end of a proto file (#907)
Browse files Browse the repository at this point in the history
  • Loading branch information
AriehSchneier authored Jan 8, 2024
1 parent 0a0ae64 commit 54b376c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
Binary file modified internal/bundles/assets/import_proto_cli.arraiz
Binary file not shown.
2 changes: 1 addition & 1 deletion pkg/importer/proto/proto_parser.arrai
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ let (:includeImport, :primitiveTypes, ...) = //{./util};
# https://developers.google.com/protocol-buffers/docs/reference/proto2-spec
let grammar = {://grammar.lang.wbnf:

file -> c* syntax stmt=(import | package | option | topLevelDef | emptyStatement)* \n*;
file -> c* syntax stmt=(import | package | option | topLevelDef | emptyStatement)* c* \n*;

syntax -> "syntax" "=" quote proto quote ";" ($ | c)?;

Expand Down
4 changes: 3 additions & 1 deletion pkg/importer/proto/proto_parser_test.arrai
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,9 @@ let (:evalConstant, :parseFile, ...) = //{./proto_parser};
// Comment
]
// Comment
};`);
};
// Comment
`);
let expected = {'(foo.java_package).bar': (fields: {'foo': [(s: 'bar')]})};
let actual = file.options;
//test.assert.equal(expected, actual),
Expand Down

0 comments on commit 54b376c

Please sign in to comment.