Changeset 3344262 in serd


Ignore:
Timestamp:
Sep 23, 2017, 6:59:22 AM (8 weeks ago)
Author:
David Robillard <d@…>
Branches:
master, serd1
Children:
7f965c4
Parents:
96d0882
git-author:
David Robillard <d@…> (09/23/17 04:53:02)
git-committer:
David Robillard <d@…> (09/23/17 06:59:22)
Message:

Report errors for directives or abbreviations in NTriples or NQuads

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • NEWS

    r96d0882 r3344262  
    22
    33  * Support strict parsing of prefixed names
     4  * Report errors for directives or abbreviations in NTriples or NQuads
    45  * Report errors for prematurely terminated statements
    56  * Fix building with MSVC
    67
    7  -- David Robillard <d@drobilla.net>  Mon, 28 Aug 2017 12:39:47 +0200
     8 -- David Robillard <d@drobilla.net>  Sat, 23 Sep 2017 13:54:10 +0200
    89
    910serd (0.28.0) stable;
  • src/reader.c

    r96d0882 r3344262  
    12941294{
    12951295    TRY_RET(read_object(reader, &ctx, true, ate_dot));
     1296    if (!fancy_syntax(reader) && peek_delim(reader, ',')) {
     1297        return r_err(reader, SERD_ERR_BAD_SYNTAX,
     1298                     "syntax does not support abbreviation\n");
     1299    }
     1300
    12961301    while (!*ate_dot && eat_delim(reader, ',')) {
    12971302        TRY_RET(read_object(reader, &ctx, true, ate_dot));
     
    16031608        return reader->status <= SERD_FAILURE;
    16041609    case '@':
     1610        if (!fancy_syntax(reader)) {
     1611            return r_err(reader, SERD_ERR_BAD_SYNTAX,
     1612                         "syntax does not support directives\n");
     1613        }
    16051614        TRY_RET(read_directive(reader));
    16061615        read_ws_star(reader);
     
    16111620            read_ws_star(reader);
    16121621        } else {
    1613             return r_err(reader, SERD_ERR_BAD_SYNTAX, "graph in Turtle\n");
     1622            return r_err(reader, SERD_ERR_BAD_SYNTAX,
     1623                         "syntax does not support graphs\n");
    16141624        }
    16151625        break;
     
    16801690            reader->eof = true;
    16811691            break;
     1692        } else if (peek_byte(reader) == '@') {
     1693            return r_err(reader, SERD_ERR_BAD_SYNTAX,
     1694                         "syntax does not support directives\n");
    16821695        }
    16831696
Note: See TracChangeset for help on using the changeset viewer.