aboutsummaryrefslogtreecommitdiffstats
path: root/src/n3.c
AgeCommit message (Collapse)AuthorFilesLines
2022-01-14Factor out UTF-8 reading utilitiesDavid Robillard1-86/+6
2022-01-14Reduce complexity of blank node reading functionsDavid Robillard1-17/+33
2022-01-14Remove SERD_CURIE node datatype entirelyDavid Robillard1-6/+7
2022-01-14Expand URIs in readerDavid Robillard1-13/+110
This expands relative and prefixed URIs in the reader on the stack, rather than passing them to the caller to be dealt with. This pushes these context-full forms to the edge of the system as much as possible to minimise the headaches they can cause. Towards having stricter guarantees about nodes and eliminating the CURIE node type altogether.
2022-01-14Move SerdEnv mutation from writer to readerDavid Robillard1-0/+6
Writing having side-effects seems questionable in general, and this prepares things for expanding URIs in the reader.
2022-01-14Add extensible logging APIDavid Robillard1-58/+55
2022-01-13Add SERD_READ_EXACT_BLANKS flagDavid Robillard1-1/+1
This allows suppressing the blank node ID clashing mechanism to read blank IDs exactly as they appear in the input, even if they match the scheme used to generate blank node IDs internally.
2022-01-13Add support for parsing variablesDavid Robillard1-5/+76
This adds a reader flag and serdi option for extending a syntax with support for SPARQL-like variables, for storing things like patterns or simple queries.
2022-01-13Make Reader always read from a ByteSourceDavid Robillard1-2/+2
2022-01-13Support reading lone lists in lax modeDavid Robillard1-1/+1
This allows parsing documents like "(42) ."
2022-01-13Fix hang when skipping an error at EOF when lax parsingDavid Robillard1-1/+1
2022-01-13Be precise about the meaning of node "length" and "size"David Robillard1-2/+3
2022-01-13Handle read errors more preciselyDavid Robillard1-25/+23
2022-01-13Split up serd_internal.hDavid Robillard1-1/+1
2022-01-13Factor out TRY macroDavid Robillard1-7/+1
2022-01-13Simplify streaming API and improve pretty printingDavid Robillard1-22/+22
This removes the obligation from the caller to correctly maintain flags to describe the current anonymous context, instead making the writer handle this itself as much as possible. Flags remain for the cases the writer can not infer from context: the start of anonymous subject and object nodes.
2022-01-13Improve reader error handlingDavid Robillard1-124/+170
2022-01-13Set flags directly when reading literal nodesDavid Robillard1-61/+43
2022-01-13Zero node padding before passing to reader sinksDavid Robillard1-1/+4
2022-01-13Remove datatype and language from reader contextDavid Robillard1-36/+31
2022-01-13Simplify stack management by popping in bulk at higher levelsDavid Robillard1-61/+31
Since all memory used by the reader is POD in the stack, there is no benefit to forcing code to explicitly pop everything pushed to the stack, since any function can record an offset and pop back down to it regardless of what its callers pushed if it knows that it does not need those items.
2022-01-13Use a fixed-size reader stackDavid Robillard1-126/+147
2022-01-13Simplify reader interfaceDavid Robillard1-1/+2
2022-01-13Add SerdSink interface and hide implementationsDavid Robillard1-11/+4
2022-01-13Merge datatype/language into nodeDavid Robillard1-18/+19
This moves closer to the sord API, and is more convenient in most cases.
2022-01-13Make nodes opaqueDavid Robillard1-16/+19
2022-01-13Rename function types for consistencyDavid Robillard1-6/+6
2022-01-13Use char* for strings in public APIDavid Robillard1-7/+5
The constant casting just makes user code a mess, for no benefit.
2022-01-13Remove support for Turtle named inline nodes extensionDavid Robillard1-21/+0
2021-05-31Make most function parameters constDavid Robillard1-69/+102
More const never hurts in general, but in particular this allows the compiler to make better nullability deductions, which reduces the amount of manual nullability casting required.
2021-05-31Remove "static inline" for functions in implementation filesDavid Robillard1-12/+12
This is just noise since these are static functions local to a C compilation unit.
2021-05-31Fix unannotated switch fallthroughsDavid Robillard1-4/+19
Unfortunately, clang does not support doing this with comments, requiring yet more preprocessor gunk.
2021-05-31Fix some conversion warningsDavid Robillard1-2/+2
2021-05-16Avoid else after breakDavid Robillard1-3/+3
2021-04-09Write statements with invalid URI characters in lax modeDavid Robillard1-9/+9
2021-01-02Use email address instead of website for attributionDavid Robillard1-1/+1
2020-12-31Format all code with clang-formatDavid Robillard1-1295/+1373
2020-12-31Avoid "else" after "break" and "return"David Robillard1-13/+33
2020-11-13Improve IRI reading performanceDavid Robillard1-10/+13
This allows the compiler to construct a jump table, and avoids a branch.
2020-11-13Remove use of C character class functions that may use localeDavid Robillard1-2/+1
Some of these cause warnings, and should never have been used in the first place since they depend on locale.
2020-08-16Fix handling of bad syntax that ends a collectionDavid Robillard1-1/+2
2020-08-16Fix EOF and null byte handlingDavid Robillard1-3/+6
This is a bit questionable, but the null byte support is needed for streaming over a socket where some delimiter is required. This caused a bug where serdi would hang forever on corrupt files that contain a null byte. Fix this by consuming the byte, but otherwise behaving as before.
2020-08-15Clean up reader error handlingDavid Robillard1-279/+319
2020-08-15Make read_String() return a statusDavid Robillard1-42/+47
2020-08-15Make read_IRIREF_scheme() return a statusDavid Robillard1-15/+11
2020-08-15Make r_err() return a statusDavid Robillard1-52/+74
2020-08-15Make read_PrefixedName() return a statusDavid Robillard1-12/+17
2020-08-15Make read_PERCENT() return a statusDavid Robillard1-8/+4
2020-08-15Make read_UCHAR() and read_ECHAR() return a statusDavid Robillard1-21/+21
2020-08-15Exploit push_byte return statusDavid Robillard1-2/+1