git.iko.soy/rowtype-yoga/purescript-protobuf
on master help sign in
Polishing
commit9cbb972fde9191dad19583cf7eed7f611b8f567f authorJames Brock <jamesbrock@gmail.com> dateMon 19 Apr 2021, 16:52 (5 years ago) parenta01b8be
10 files changed+16−17
README.md+5−5 src/Protobuf/Common.purs+1−1 src/Protobuf/Decode.purs+1−1 src/Protobuf/Decode32.purs+1−1 src/Protobuf/Decode64.purs+1−1 src/Protobuf/Encode.purs+1−1 src/Protobuf/Encode32.purs+1−1 src/Protobuf/Encode64.purs+1−1 src/Protobuf/Library.purs+1−1 src/Protobuf/Runtime.purs+3−4
README.md+5−5
@@ -44,7 +44,7 @@ We also have our own unit tests, see `test/README.md` in this repository.
4444
4545The `shell.nix` environment provides
4646
47−* The Purescript toolchain: *purs*, *spago*, and *npm*.
47+* The Purescript toolchain: `purs`, `spago`, and `npm`.
4848* The [`protoc`](https://developers.google.com/protocol-buffers/docs/proto3?hl=en#generating) compiler
4949* The `protoc-gen-purescript` executable plugin for `protoc` on the `PATH` so that
5050 [`protoc` can find it](https://developers.google.com/protocol-buffers/docs/reference/cpp/google.protobuf.compiler.plugin).
@@ -72,10 +72,10 @@ to your `PATH`.
7272
7373## Writing programs with the generated code
7474
75−The code generator will use the `package` import statement in the schema `.proto` file
75+The code generator will use the `package` import statement in the `.proto` file
7676and the base `.proto` file name as the Purescript module name for that file.
7777
78−A message in a `shapes.proto` file declared as
78+A message in a `shapes.proto` descriptor file declared as
7979
8080```
8181package interproc;
@@ -96,8 +96,8 @@ generated `shapes.Interproc.purs` file.
9696 ```
9797
9898 The message data type will also include an `__unknown_fields` array field for
99− holding received fields which were not in the schema `.proto` file. We can
100− completely ignore this field if we want to.
99+ holding received fields which were not in the descriptor `.proto` file. We can
100+ completely ignore `__unknown_fields` if we want to.
101101
1021022. A message maker which constructs a message from a `Record`
103103 with some message fields
src/Protobuf/Common.purs+1−1
@@ -1,4 +1,4 @@
1−-- | Do not import this module.
1+-- | You almost never need to `import` this module.
22-- | See package README for explanation.
33module Protobuf.Common
44( FieldNumber
src/Protobuf/Decode.purs+1−1
@@ -1,6 +1,6 @@
11-- | Primitive parsers for decoding Google Protocol Buffers.
22-- |
3−-- | Do not import this module.
3+-- | You almost never need to import this module.
44-- | See package README for explanation.
55module Protobuf.Decode
66( double
src/Protobuf/Decode32.purs+1−1
@@ -1,6 +1,6 @@
11-- | Primitive `UInt`-based parsers for decoding Google Protocol Buffers.
22-- |
3−-- | Do not import this module.
3+-- | You almost never need to import this module.
44-- | See package README for explanation.
55-- |
66-- | There is no `varint32` in the Protbuf spec, this is
src/Protobuf/Decode64.purs+1−1
@@ -1,6 +1,6 @@
11-- | Primitive `Long`-based parsers for decoding Google Protocol Buffers.
22-- |
3−-- | Do not import this module.
3+-- | You almost never need to import this module.
44-- | See package README for explanation.
55module Protobuf.Decode64
66( zigzag64
src/Protobuf/Encode.purs+1−1
@@ -1,6 +1,6 @@
11-- | Primitive builders for encoding Google Protocol Buffers.
22-- |
3−-- | Do not import this module.
3+-- | You almost never need to import this module.
44-- | See package README for explanation.
55-- |
66-- | Primed (') encoder functions encode without the tag, for packed
src/Protobuf/Encode32.purs+1−1
@@ -1,6 +1,6 @@
11-- | Primitive `UInt`-based builders for encoding Google Protocol Buffers.
22-- |
3−-- | Do not import this module.
3+-- | You almost never need to import this module.
44-- | See package README for explanation.
55-- |
66-- | There is no `varint32` in the Protbuf spec, this is
src/Protobuf/Encode64.purs+1−1
@@ -1,6 +1,6 @@
11-- | Primitive `Long`-based builders for encoding Google Protocol Buffers.
22-- |
3−-- | Do not import this module.
3+-- | You almost never need to import this module.
44-- | See package README for explanation.
55module Protobuf.Encode64
66( zigzag64
src/Protobuf/Library.purs+1−1
@@ -15,7 +15,7 @@ import Control.Monad.Trans.Class (lift)
1515import Data.Either (Either(..))
1616import Data.Maybe (Maybe(..))
1717import Protobuf.Common (Bytes(..), class Default, default, isDefault, fromDefault, toDefault)
18−import Protobuf.Runtime (label, UnknownField(..), manyLength)
18+import Protobuf.Runtime (label, manyLength)
1919import Text.Parsing.Parser (ParserT, fail)
2020
2121-- | Lift an `ExceptT String m` computation into a `ParserT`.
src/Protobuf/Runtime.purs+3−4
@@ -1,6 +1,6 @@
11-- | This module is for import by the generated .purs message modules.
22-- |
3−-- | Do not import this module.
3+-- | You almost never need to import this module.
44-- | See package README for explanation.
55module Protobuf.Runtime
66( parseMessage
@@ -79,8 +79,8 @@ parseMessage construct default parseField length = do
7979-- | Parse position, zero-based, unlike Text.Parsing.Parser.Position which is one-based.
8080type Pos = Int
8181
82−-- | We want Int FieldNumber to pass to parseField so that we can pattern
83−-- | match on Int literals. UInt doesn't export any constructors, so can't
82+-- | We want an Int FieldNumber to pass to parseField so that we can pattern
83+-- | match on Int literals. UInt doesn't export any constructors, so we can’t
8484-- | pattern match on it.
8585type FieldNumberInt = Int
8686
@@ -253,7 +253,6 @@ putEnum' x = Encode.varint64 (fromLowHighBits x_low x_high :: Long Unsigned)
253253 x_high = highBits x_slong
254254 x_low = lowBits x_slong
255255
256−
257256parseEnum :: forall m a. MonadEffect m => BoundedEnum a => ParserT DataView m a
258257parseEnum = do
259258 -- “Enumerator constants must be in the range of a 32-bit integer.”