Skip to content

Commit acc5fe1

Browse files
committed
improved wording
1 parent bfbd966 commit acc5fe1

File tree

1 file changed

+18
-17
lines changed

1 file changed

+18
-17
lines changed

README.md

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -54,29 +54,30 @@ standard of the C programming language. It includes the following features:
5454

5555
### Parsing NestedText #########################################################
5656

57-
To parse a NestedText document, include `nt4c.h` directly in your codebase as
58-
the parser is implemented in a single C header file.
57+
To parse a NestedText document, you can include the [nt4c.h](nt4c.h) header file
58+
directly in your codebase. The parser is implemented in a single C header file
59+
for easy integration.
5960

60-
The main function provided is `nt_parse()`, which takes a text in NestedText
61-
syntax and a pointer to the `NT_PARSER` structure for fine-tuning the
61+
The main function to use is `nt_parse()`, which takes a text in NestedText
62+
syntax and a pointer to the `NT_PARSER` structure for customizing the
6263
deserialization process.
6364

64-
The parser structure stores parsing configuration and the parsing process state.
65-
By default, it can hold up to `NT_PARSER_NCOUNT` nodes in its internal memory,
66-
but `nt_parser_set_memory` function allows using an arbitrary array of `NT_NODE`
67-
structures.
65+
The `NT_PARSER` structure stores parsing configuration and the parsing process
66+
state. By default, it can handle up to `NT_PARSER_NCOUNT` nodes in its internal
67+
memory. However, you can use the `nt_parser_set_memory` function to work with a
68+
custom array of `NT_NODE` structures.
6869

69-
During `nt_parse()` execution, the deserialization graph of the document is
70-
populated with nodes. The parser continues processing even if the output buffer
71-
becomes full.
70+
When you call `nt_parse()`, the parser populates the deserialization graph of
71+
the document with nodes. It continues processing even if the output buffer
72+
reaches its capacity.
7273

73-
Upon successful parsing, `nt_parse()` returns the number of nodes in the input
74-
text, which can help determine the memory needed for storing the deserialization
75-
graph. On failure, the function returns a negative number.
74+
After a successful parsing operation, `nt_parse()` returns the number of nodes
75+
in the input text. This information can help you determine the memory required
76+
for storing the deserialization graph. If parsing fails, the function returns a
77+
negative value.
7678

77-
The deserialization graph is considered fully stored only when the value
78-
returned by `nt_parse()` is non-negative and less than or equal to the output
79-
buffer capacity.
79+
The deserialization graph is considered fully stored when the value returned by
80+
`nt_parse()` is non-negative and does not exceed the output buffer's capacity.
8081

8182

8283
### Examples ###################################################################

0 commit comments

Comments
 (0)