hashgraph / hashgraph/pbj

Option comment parsing has issues

Open
#818 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
44
Forks
15
Avg merge
1d 15h
Merged PRs (30d)
12

Description

The `optionComment` defined in the Protobuf grammar can apply to individual top-level objects (such as a message definition), as well as to sub-items (e.g. individual fields inside the message.) However, it can also be a top-level option comment. For example, many test models define `pbj.java_package`. Example:

```
syntax = "proto3";

package proto;

option java_package = "com.hedera.pbj.test.proto.java";
option java_multiple_files = true;
// <<>> This comment is special code for setting PBJ Compiler java package

message NotCacheableAccountID {
```

The intention of the above code is to have the `pbj.java_package` be a "top-level option comment." However, per the parser grammar it actually applies to the `NotCacheableAccountID` message instead.

Need to see how to differentiate between the two...

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.