Skip to content
This repository has been archived by the owner on Feb 8, 2022. It is now read-only.

Parser functions are not discoverable #41

Closed
jhugard opened this issue Jun 15, 2016 · 2 comments
Closed

Parser functions are not discoverable #41

jhugard opened this issue Jun 15, 2016 · 2 comments

Comments

@jhugard
Copy link
Collaborator

jhugard commented Jun 15, 2016

The primary parser functions - which parse strings, streams, and files - are very hard to discover in the current namespaces:

Current names:

  • Froto.Parser.Proto.parseFile
  • Froto.Parser.Proto.parseStream
  • Froto.Parser.Proto.parseString

Unfortunately, all the internal parse functions also live in Froto.Parser.Proto, making these primary functions very hard to discover.

Recommending that the primary parsing functions above get moved into a Parse module, and that the Proto parsers get moved into a Parse.Parsers module. Further, the parser parameter should be removed from those functions, so the user does not need to supply the pProto parser to these functions.

This simplifies client code down to the following:

open Froto.Parser

let statements = Parse.fromFile fileName
@jhugard
Copy link
Collaborator Author

jhugard commented Jun 15, 2016

Further, the Froto.Parser.Model module should probably get renamed to Froto.Parser.ClassModel, to indicate it is not the only means of representing a parsed protobuf file. In fact, the primary means of parsing should probably be via a Froto.Parser.Ast.PStatement list, as returned by Parse.fromFile.

@jhugard
Copy link
Collaborator Author

jhugard commented Jun 15, 2016

Note: the reason for these changes is that I went to use the NuGet package in a new project, and couldn't myself figure out how to parse a file without looking at the source code!

jhugard added a commit that referenced this issue Jun 15, 2016
* Make parser functions more discoverable (#41)
@jhugard jhugard closed this as completed Jun 15, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant