Changeset 96d0882 in serd


Ignore:
Timestamp:
Sep 23, 2017, 4:52:34 AM (8 weeks ago)
Author:
David Robillard <d@…>
Branches:
master, serd1
Children:
3344262
Parents:
cf44ecc
Message:

Simplify syntax support checking

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/reader.c

    rcf44ecc r96d0882  
    9494
    9595static inline bool
    96 supports_fancy_literals(const SerdReader* reader)
    97 {
    98     return reader->syntax == SERD_TURTLE || reader->syntax == SERD_TRIG;
    99 }
    100 
    101 static inline bool
    102 supports_relative_iris(const SerdReader* reader)
     96fancy_syntax(const SerdReader* reader)
    10397{
    10498    return reader->syntax == SERD_TURTLE || reader->syntax == SERD_TRIG;
     
    616610    }
    617611
    618     if (!supports_fancy_literals(reader)) {
     612    if (!fancy_syntax(reader)) {
    619613        return r_err(reader, SERD_ERR_BAD_SYNTAX,
    620614                     "syntax does not support long literals\n");
     
    844838    TRY_RET(eat_byte_check(reader, '<'));
    845839    Ref ref = push_node(reader, SERD_URI, "", 0);
    846     if (!supports_relative_iris(reader) && !read_IRIREF_scheme(reader, ref)) {
     840    if (!fancy_syntax(reader) && !read_IRIREF_scheme(reader, ref)) {
    847841        return pop_node(reader, ref);
    848842    }
     
    12211215    uint32_t      flags    = 0;
    12221216    const uint8_t c        = peek_byte(reader);
    1223     if (!supports_fancy_literals(reader)) {
     1217    if (!fancy_syntax(reader)) {
    12241218        switch (c) {
    12251219        case '"': case ':': case '<': case '_': break;
Note: See TracChangeset for help on using the changeset viewer.