Changeset 8d954ab in serd


Ignore:
Timestamp:
Sep 23, 2017, 12:30:52 PM (8 weeks ago)
Author:
David Robillard <d@…>
Branches:
master, serd1
Children:
f1d036c
Parents:
7300526
Message:

Add basic error tolerant parsing for line-based formats

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • NEWS

    r7300526 r8d954ab  
    11serd (0.29.3) unstable;
    22
     3  * Add basic error tolerant parsing for line-based formats
    34  * Support strict parsing of prefixed names
    45  * Report errors for all failing test cases
     
    78  * Fix building with MSVC
    89
    9  -- David Robillard <d@drobilla.net>  Sat, 23 Sep 2017 15:03:52 +0200
     10 -- David Robillard <d@drobilla.net>  Sat, 23 Sep 2017 20:33:19 +0200
    1011
    1112serd (0.28.0) stable;
  • src/reader.c

    r7300526 r8d954ab  
    16701670}
    16711671
     1672static void
     1673skip_until(SerdReader* reader, uint8_t byte)
     1674{
     1675    for (uint8_t c = 0; (c = peek_byte(reader)) && c != byte;) {
     1676        eat_byte_safe(reader, c);
     1677    }
     1678}
     1679
    16721680static bool
    16731681read_turtleTrigDoc(SerdReader* reader)
    16741682{
    16751683    while (!reader->eof) {
    1676         TRY_RET(read_statement(reader));
     1684        if (!read_statement(reader)) {
     1685            if (reader->strict) {
     1686                return 0;
     1687            }
     1688            skip_until(reader, '\n');
     1689            reader->status = SERD_ERR_BAD_SYNTAX;
     1690        }
    16771691    }
    16781692    return reader->status <= SERD_FAILURE;
Note: See TracChangeset for help on using the changeset viewer.