#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for libfyaml 0.7.11.
+# Generated by GNU Autoconf 2.69 for libfyaml 0.7.12.
#
# Report bugs to <pantelis.antoniou@konsulko.com>.
#
# Identity of this package.
PACKAGE_NAME='libfyaml'
PACKAGE_TARNAME='libfyaml'
-PACKAGE_VERSION='0.7.11'
-PACKAGE_STRING='libfyaml 0.7.11'
+PACKAGE_VERSION='0.7.12'
+PACKAGE_STRING='libfyaml 0.7.12'
PACKAGE_BUGREPORT='pantelis.antoniou@konsulko.com'
PACKAGE_URL=''
HAVE_SPHINX_TRUE
PIP3
SPHINX
+HAVE_DEVMODE_FALSE
+HAVE_DEVMODE_TRUE
+HAVE_DEVMODE
HAVE_NETWORK_FALSE
HAVE_NETWORK_TRUE
HAVE_NETWORK
with_sysroot
enable_libtool_lock
enable_network
+enable_devmode
enable_shave
'
ac_precious_vars='build_alias
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures libfyaml 0.7.11 to adapt to many kinds of systems.
+\`configure' configures libfyaml 0.7.12 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of libfyaml 0.7.11:";;
+ short | recursive ) echo "Configuration of libfyaml 0.7.12:";;
esac
cat <<\_ACEOF
optimize for fast installation [default=yes]
--disable-libtool-lock avoid locking (might break parallel builds)
--disable-network Disable tests requiring network access
+ --enable-devmode Enable development mode only debugging
--enable-shave use shave to make the build pretty [[default=yes]]
Optional Packages:
https://github.com/yaml/yaml-test-suite)
TESTSUITECHECKOUT
Testsuite checkout (default:
- 80f289435a56189bbc5ca2f318574e48dbeef8aa)
+ 6e6c296ae9c9d2d5c4134b4b64d01b29ac19ff6f)
JSONTESTSUITEURL
JSON Testsuite git repo URL (default:
https://github.com/nst/JSONTestSuite)
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-libfyaml configure 0.7.11
+libfyaml configure 0.7.12
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by libfyaml $as_me 0.7.11, which was
+It was created by libfyaml $as_me 0.7.12, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
# Define the identity of the package.
PACKAGE='libfyaml'
- VERSION='0.7.11'
+ VERSION='0.7.12'
cat >>confdefs.h <<_ACEOF
# increase current, set revision and age to 0
-LIBTOOL_VERSION=1:1:0
+LIBTOOL_VERSION=1:2:0
fi
+# Check whether --enable-devmode was given.
+if test "${enable_devmode+set}" = set; then :
+ enableval=$enable_devmode;
+fi
+
+
+if test "x$enable_devmode" != "xno" ; then
+ HAVE_DEVMODE=1
+else
+ HAVE_DEVMODE=0
+fi
+
+ if test x$HAVE_DEVMODE = x1 ; then
+ HAVE_DEVMODE_TRUE=
+ HAVE_DEVMODE_FALSE='#'
+else
+ HAVE_DEVMODE_TRUE='#'
+ HAVE_DEVMODE_FALSE=
+fi
+
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DEVMODE $HAVE_DEVMODE
+_ACEOF
+
+
# check for sphinx
# Extract the first word of "sphinx-build", so it can be a program name with args.
set dummy sphinx-build; ac_word=$2
if test "x$TESTSUITECHECKOUT" == "x" ; then
- TESTSUITECHECKOUT="80f289435a56189bbc5ca2f318574e48dbeef8aa"
+ TESTSUITECHECKOUT="6e6c296ae9c9d2d5c4134b4b64d01b29ac19ff6f"
fi
as_fn_error $? "conditional \"HAVE_NETWORK\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
+if test -z "${HAVE_DEVMODE_TRUE}" && test -z "${HAVE_DEVMODE_FALSE}"; then
+ as_fn_error $? "conditional \"HAVE_DEVMODE\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
if test -z "${HAVE_SPHINX_TRUE}" && test -z "${HAVE_SPHINX_FALSE}"; then
as_fn_error $? "conditional \"HAVE_SPHINX\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by libfyaml $as_me 0.7.11, which was
+This file was extended by libfyaml $as_me 0.7.12, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
-libfyaml config.status 0.7.11
+libfyaml config.status 0.7.12
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
HAVE_CHECK: ${HAVE_CHECK}
HAVE_COMPATIBLE_CHECK: ${HAVE_COMPATIBLE_CHECK}
HAVE_NETWORK: ${HAVE_NETWORK}
+ HAVE_DEVMODE: ${HAVE_DEVMODE}
HAVE_SPHINX: ${HAVE_SPHINX}
GIT: $GIT
DOCKER: $DOCKER
/* may start simple key (in block ctx) */
if (!fyp->flow_level && !fyp->simple_key_allowed) {
fyp->simple_key_allowed = true;
+ fyp->tab_used_for_ws = false;
tabs_allowed = fyp->flow_level || !fyp->simple_key_allowed || fyp_tabsize(fyp);
fyp_scan_debug(fyp, "simple_key_allowed -> %s\n", fyp->simple_key_allowed ? "true" : "false");
}
*did_purgep = false;
while ((fysk = fy_simple_key_list_head(&fyp->simple_keys)) != NULL) {
+#ifdef FY_DEVMODE
fyp_scan_debug(fyp, "purge-check: flow_level=%d fysk->flow_level=%d fysk->mark.line=%d line=%d",
fyp->flow_level, fysk->flow_level,
fysk->mark.line, fyp_line(fyp));
fyp_debug_dump_simple_key(fyp, fysk, "purge-check: ");
+#endif
line = fysk->mark.line;
goto err_out;
}
+#ifdef FY_DEVMODE
fyp_debug_dump_simple_key(fyp, fysk, "purging: ");
+#endif
fy_simple_key_list_del(&fyp->simple_keys, fysk);
fy_parse_simple_key_recycle(fyp, fysk);
fy_parse_simple_key_recycle(fyp, fysk);
fyp->simple_key_allowed = true;
+ fyp->tab_used_for_ws = false;
fyp_scan_debug(fyp, "simple_key_allowed -> %s\n", fyp->simple_key_allowed ? "true" : "false");
}
while ((fysk = fy_simple_key_list_first(&fyp->simple_keys)) != NULL &&
fysk->flow_level >= fyp->flow_level) {
+#ifdef FY_DEVMODE
fyp_debug_dump_simple_key(fyp, fysk, "removing: ");
+#endif
/* remove it from the list */
fy_simple_key_list_del(&fyp->simple_keys, fysk);
(fyt->type == FYTT_FLOW_MAPPING_START || fyt->type == FYTT_FLOW_SEQUENCE_START);
+#ifdef FY_DEVMODE
fyp_debug_dump_simple_key_list(fyp, &fyp->simple_keys, fysk, "fyp->simple_keys (saved): ");
+#endif
return 0;
return -1;
}
+/* special case for allowing whitespace (including tabs) after -?: */
+static int fy_ws_indentation_check(struct fy_parser *fyp, bool *found_tabp, struct fy_mark *tab_mark)
+{
+ int c, adv, tab_adv;
+ bool indentation, found_tab;
+
+ found_tab = false;
+
+ /* not meaning in flow mode */
+ if (fyp->flow_level)
+ goto out;
+
+ /* scan forward, keeping track if we found a tab */
+ adv = 0;
+ tab_adv = -1;
+ if (tab_mark)
+ fy_get_mark(fyp, tab_mark);
+ while (fy_is_ws(c = fy_parse_peek_at(fyp, adv))) {
+ if (!found_tab && fy_is_tab(c)) {
+ found_tab = true;
+ tab_adv = adv;
+ /* XXX somewhat hacky, space is 1 char only so adjust */
+ if (tab_mark) {
+ tab_mark->input_pos += adv;
+ tab_mark->column += adv;
+ }
+ }
+ adv++;
+ }
+
+ if (found_tab) {
+ indentation = fy_utf8_strchr("?:|>", c) ||
+ (c == '-' && fyp_is_blankz(fyp, fy_parse_peek_at(fyp, adv + 1)));
+
+ /* any kind of block indentation is not allowed */
+ FYP_PARSE_ERROR_CHECK(fyp, tab_adv, 1, FYEM_SCAN,
+ !indentation, err_out,
+ "cannot use tab for indentation of block entry");
+ fy_advance_by(fyp, tab_adv + 1);
+ }
+
+ /* now chomp spaces only afterwards */
+ while (fy_is_space(c = fy_parse_peek(fyp)))
+ fy_advance(fyp, c);
+
+out:
+ if (found_tabp)
+ *found_tabp = found_tab;
+
+ return 0;
+
+err_out:
+ return -1;
+}
int fy_fetch_stream_start(struct fy_parser *fyp)
{
/* simple key is allowed */
fyp->simple_key_allowed = true;
+ fyp->tab_used_for_ws = false;
fyp_scan_debug(fyp, "simple_key_allowed -> %s\n", fyp->simple_key_allowed ? "true" : "false");
fyt = fy_token_queue_simple(fyp, &fyp->queued_tokens, FYTT_STREAM_START, 0);
}
fyp->simple_key_allowed = false;
+ fyp->tab_used_for_ws = false;
fyp_scan_debug(fyp, "simple_key_allowed -> %s\n", fyp->simple_key_allowed ? "true" : "false");
fyt = fy_token_queue_simple(fyp, &fyp->queued_tokens, type, 3);
fyp->flow = c == '[' ? FYFT_SEQUENCE : FYFT_MAP;
fyp->simple_key_allowed = true;
+ fyp->tab_used_for_ws = false;
fyp_scan_debug(fyp, "simple_key_allowed -> %s\n", fyp->simple_key_allowed ? "true" : "false");
/* the comment indicator must have at least a space */
"fy_parse_flow_pop() failed");
fyp->simple_key_allowed = false;
+ fyp->tab_used_for_ws = false;
fyp_scan_debug(fyp, "simple_key_allowed -> %s\n",
fyp->simple_key_allowed ? "true" : "false");
"fy_remove_simple_key() failed");
fyp->simple_key_allowed = true;
+ fyp->tab_used_for_ws = false;
fyp_scan_debug(fyp, "simple_key_allowed -> %s\n", fyp->simple_key_allowed ? "true" : "false");
fyt_last = fy_token_list_tail(&fyp->queued_tokens);
struct fy_mark mark;
struct fy_simple_key *fysk;
struct fy_token *fyt;
- int adv, tab_adv;
- bool indentation, found_tab;
fyp_error_check(fyp, c == '-', err_out,
"illegal block entry");
"fy_remove_simple_key() failed");
fyp->simple_key_allowed = true;
+ fyp->tab_used_for_ws = false;
fyp_scan_debug(fyp, "simple_key_allowed -> %s\n", fyp->simple_key_allowed ? "true" : "false");
fyt = fy_token_queue_simple(fyp, &fyp->queued_tokens, FYTT_BLOCK_ENTRY, 1);
fyp_error_check(fyp, fyt, err_out,
"fy_token_queue_simple() failed");
- /* special case for allowing whitespace (including tabs) after - */
- found_tab = false;
-
- /* scan forward, keeping track if we found a tab */
- adv = 0;
- tab_adv = -1;
- while (fy_is_ws(c = fy_parse_peek_at(fyp, adv))) {
- if (!found_tab && fy_is_tab(c)) {
- found_tab = true;
- tab_adv = adv;
- }
- adv++;
- }
-
- if (found_tab) {
- indentation = fy_utf8_strchr("?:|>", c) ||
- (c == '-' && fyp_is_blankz(fyp, fy_parse_peek_at(fyp, adv + 1)));
-
- /* any kind of block indentation is not allowed */
- FYP_PARSE_ERROR_CHECK(fyp, tab_adv, 1, FYEM_SCAN,
- !indentation, err_out,
- "cannot use tab for indentation of block entry");
- fy_advance_by(fyp, tab_adv + 1);
- }
-
- /* now chomp spaces only afterwards */
- while (fy_is_space(c = fy_parse_peek(fyp)))
- fy_advance(fyp, c);
+ rc = fy_ws_indentation_check(fyp, NULL, NULL);
+ fyp_error_check(fyp, !rc, err_out_rc,
+ "fy_ws_indentation_check() failed");
return 0;
bool target_simple_key_allowed;
struct fy_token *fyt;
struct fy_atom *handle;
+ bool found_tab;
+ struct fy_mark tab_mark;
fyp_error_check(fyp, c == '?', err_out,
"illegal block entry or key mark");
fyp->simple_key_allowed = target_simple_key_allowed;
fyp_scan_debug(fyp, "simple_key_allowed -> %s\n", fyp->simple_key_allowed ? "true" : "false");
- /* eat whitespace */
- while (fy_is_blank(c = fy_parse_peek(fyp)))
- fy_advance(fyp, c);
+ rc = fy_ws_indentation_check(fyp, &found_tab, &tab_mark);
+ fyp_error_check(fyp, !rc, err_out_rc,
+ "fy_ws_indentation_check() failed");
+
+ /* record whether a tab was used for indentation */
+ if (fyp->simple_key_allowed && found_tab) {
+ fyp->tab_used_for_ws = true;
+ fyp->last_tab_used_for_ws_mark = tab_mark;
+ } else
+ fyp->tab_used_for_ws = false; // XXX
/* comment? */
if (c == '#') {
bool push_bmap_start, push_key_only, did_purge, final_complex_key;
bool is_multiline __FY_DEBUG_UNUSED__;
struct fy_atom *chandle;
+ bool found_tab;
+ struct fy_mark tab_mark;
int rc;
fyp_error_check(fyp, c == ':', err_out,
goto err_out;
}
+ /* special handling for ?: */
+ if (fyp->tab_used_for_ws) {
+ FYP_PARSE_ERROR(fyp, 0, 1, FYEM_SCAN, "Indentation used tabs for ':' indicator");
+ goto err_out;
+ }
+
if (push_bmap_start) {
assert(!fyp->flow_level);
fyt->key.flow_level = fyp->flow_level;
}
+#ifdef FY_DEVMODE
fyp_debug_dump_token(fyp, fyt_insert, "insert-token: ");
fyp_debug_dump_token_list(fyp, &fyp->queued_tokens, fyt_insert, "fyp->queued_tokens (before): ");
fyp_debug_dump_token_list(fyp, &sk_tl, NULL, "sk_tl: ");
+#endif
if (fyt_insert) {
} else
fy_token_lists_splice(&fyp->queued_tokens, &sk_tl);
+#ifdef FY_DEVMODE
fyp_debug_dump_token_list(fyp, &fyp->queued_tokens, fyt_insert, "fyp->queued_tokens (after): ");
+#endif
target_simple_key_allowed = fysk ? false : !fyp->flow_level;
fyp_error_check(fyp, fyt, err_out,
"fy_token_queue_simple() failed");
+ if (fysk)
+ fy_parse_simple_key_recycle(fyp, fysk);
+
+
fyp->simple_key_allowed = target_simple_key_allowed;
fyp_scan_debug(fyp, "simple_key_allowed -> %s\n", fyp->simple_key_allowed ? "true" : "false");
- if (fysk)
- fy_parse_simple_key_recycle(fyp, fysk);
+ if (is_complex) {
+ rc = fy_ws_indentation_check(fyp, &found_tab, &tab_mark);
+ fyp_error_check(fyp, !rc, err_out_rc,
+ "fy_ws_indentation_check() failed");
+
+ /* record whether a tab was used for indentation */
+ if (fyp->simple_key_allowed && found_tab) {
+ fyp->tab_used_for_ws = true;
+ fyp->last_tab_used_for_ws_mark = tab_mark;
+ } else
+ fyp->tab_used_for_ws = false; // XXX
+ } else
+ fyp->tab_used_for_ws = false;
if (final_complex_key) {
fyp->pending_complex_key_column = -1;
fyp_error_check(fyp, !rc, err_out_rc,
"fy_scan_comment() failed");
}
+
}
return 0;
"fy_save_simple_key_mark() failed");
fyp->simple_key_allowed = false;
+ fyp->tab_used_for_ws = false;
fyp_scan_debug(fyp, "simple_key_allowed -> %s\n", fyp->simple_key_allowed ? "true" : "false");
return 0;
"fy_save_simple_key_mark() failed");
fyp->simple_key_allowed = false;
+ fyp->tab_used_for_ws = false;
fyp_scan_debug(fyp, "simple_key_allowed -> %s\n", fyp->simple_key_allowed ? "true" : "false");
return 0;
"fy_remove_simple_key() failed");
fyp->simple_key_allowed = true;
+ fyp->tab_used_for_ws = false;
fyp_scan_debug(fyp, "simple_key_allowed -> %s\n", fyp->simple_key_allowed ? "true" : "false");
/* skip over block scalar start */
(void)fy_parse_tag_directive(fyp, fyt, true);
}
+#ifdef FY_DEVMODE
if (fyt)
fyp_debug_dump_token(fyp, fyt, "producing: ");
+#endif
return fyt;
}
fyt = fy_scan_remove_peek(fyp, fyt);
fyp_error_check(fyp, fyt, err_out,
"failed to peek token");
+
+#ifdef FY_DEVMODE
fyp_debug_dump_token(fyp, fyt, "next: ");
+#endif
had_doc_end = true;
}
fyt = fy_scan_peek(fyp);
fyp_error_check(fyp, fyt, err_out,
"failed to peek token");
+#ifdef FY_DEVMODE
fyp_debug_dump_token(fyp, fyt, "next: ");
+#endif
}
/* the end */
fyt = fy_scan_remove_peek(fyp, fyt);
fyp_error_check(fyp, fyt, err_out,
"failed to peek token");
+#ifdef FY_DEVMODE
fyp_debug_dump_token(fyp, fyt, "next: ");
+#endif
/* check whether it's a sequence entry or not */
is_seq = fyt->type != FYTT_BLOCK_ENTRY && fyt->type != FYTT_BLOCK_END;
fyt = fy_scan_remove_peek(fyp, fyt);
fyp_error_check(fyp, fyt, err_out,
"failed to peek token");
+#ifdef FY_DEVMODE
fyp_debug_dump_token(fyp, fyt, "next: ");
+#endif
/* check whether it's a block entry or not */
is_block = fyt->type != FYTT_KEY && fyt->type != FYTT_VALUE &&
fyt = fy_scan_remove_peek(fyp, fyt);
fyp_error_check(fyp, fyt, err_out,
"failed to peek token");
+#ifdef FY_DEVMODE
fyp_debug_dump_token(fyp, fyt, "next: ");
+#endif
/* check whether it's a block entry or not */
is_value = fyt->type != FYTT_KEY && fyt->type != FYTT_VALUE &&
fyt = fy_scan_remove_peek(fyp, fyt);
fyp_error_check(fyp, fyt, err_out,
"failed to peek token");
+#ifdef FY_DEVMODE
fyp_debug_dump_token(fyp, fyt, "next: ");
+#endif
}
if (fyt->type == FYTT_KEY) {
fyt = fy_scan_remove_peek(fyp, fyt);
fyp_error_check(fyp, fyt, err_out,
"failed to peek token");
+#ifdef FY_DEVMODE
fyp_debug_dump_token(fyp, fyt, "next: ");
+#endif
if (fyt->type != FYTT_FLOW_ENTRY && fyt->type != FYTT_FLOW_SEQUENCE_END) {
rc = fy_parse_state_push(fyp, FYPS_FLOW_SEQUENCE_ENTRY_MAPPING_END);
fyt = fy_scan_remove_peek(fyp, fyt);
fyp_error_check(fyp, fyt, err_out,
"failed to peek token");
+#ifdef FY_DEVMODE
fyp_debug_dump_token(fyp, fyt, "next: ");
+#endif
}
if (fyt->type == FYTT_KEY) {
fyt = fy_scan_remove_peek(fyp, fyt);
fyp_error_check(fyp, fyt, err_out,
"failed to peek token");
+#ifdef FY_DEVMODE
fyp_debug_dump_token(fyp, fyt, "next: ");
+#endif
/* JSON key checks */
FYP_TOKEN_ERROR_CHECK(fyp, fyt, FYEM_PARSE,
fyt = fy_scan_remove_peek(fyp, fyt);
fyp_error_check(fyp, fyt, err_out,
"failed to peek token");
+#ifdef FY_DEVMODE
fyp_debug_dump_token(fyp, fyt, "next: ");
+#endif
if (fyt->type != FYTT_FLOW_ENTRY &&
fyt->type != FYTT_FLOW_MAPPING_END) {