Age | Commit message (Collapse) | Author | Files |
|
|
|
* src/asprintf.c (grecs_vasprintf): Operate on a fresh copy of va_alist
in each new iteration.
|
|
|
|
|
|
* src/grecs.h (grecs_adjust_string_locations): New extern.
* src/parser.c (grecs_adjust_string_locations): New variable.
* src/grecs-lex.l: Adjust string locations only if
grecs_adjust_string_locations is set.
|
|
* src/grecs-lex.l (qstring_locus_fixup): New function.
Call it before returning QSTRING to exclude quotes from the
reported string locations. FIXME: This should be user-configurable.
* src/grecs-locus.h (YY_LOCATION_PRINT): Add missing argument.
|
|
diagnostics.
* src/grecs.h (grecs_locus_point): New struct.
(grecs_locus_point_advance_line): New macro.
(grecs_locus_t): Redesign.
(grecs_value) <locus>: New member.
(grecs_node) <idloc>: New member.
(grecs_print_diag_fun): Change signature.
(grecs_warning,grecs_error): Change signature.
(grecs_parse_line_directive)
(grecs_parse_line_directive_cpp)
(grecs_string_convert): Change signature.
(grecs_current_locus): Remove.
(grecs_current_locus_point): New extern.
* src/grecs-locus.h: New file.
* src/Make.am (noinst_HEADERS): Add grecs-locus.h.
* src/join.c (reset_locus): Rewrite.
* src/lookup.c: Initialize new members of grecs_value and grecs_node.
(split_cfg_path): Return wrdse error code.
(grecs_node_from_path_locus): Take two grecs_locus_t arguments.
Make sure all created nodes have their locus members
properly initialized.
* src/parser.c (grecs_parse): Initialize grecs_current_locus_point.
* src/tree.c (grecs_node_create_points): New function.
(string_to_bool,string_to_host,string_to_sockaddr)
(grecs_string_convert): Change signatures. Be more precise in
what locus to report.
* src/diag.c (default_print_diag): Use YY_LOCATION_PRINT to
output locus.
(grecs_print_diag_fun): Change signature.
(grecs_warning,grecs_error): Change signature.
* src/format.c (grecs_format_locus): Rewrite.
(grecs_format_node): Be more precise in what locus is being
output.
* src/bind-gram.y: Keep track of locations. Turn on error-verbose mode.
* src/grecs-gram.y: Likewise.
* src/meta1-gram.y: Likewise.
* src/bind-lex.l: Keep track of locations.
* src/git-parser.c: Likewise.
* src/grecs-lex.l: Likewise.
* src/meta1-lex.l: Likewise.
* src/path-parser.c: Likewise.
* src/preproc.c: Likewise.
* tests/gcf1.conf: Untabify.
* tests/format01.at: Reflect changes in the output.
* tests/join.at: Likewise.
* tests/set.at: Likewise.
* tests/locus-bind.at: New testcase.
* tests/locus-git.at: New testcase.
* tests/locus-meta1.at: New testcase.
* tests/locus00.at: New testcase.
* tests/locus01.at: New testcase.
* tests/locus02.at: New testcase.
* tests/path-locus.at: New testcase.
|
|
|
|
at configuration time.
* src/Make.am (PARSER_DEFS, AM_CPPFLAGS): New variables.
[GRECS_COND_META1_PARSER]: Update PARSER_DEFS.
[GRECS_COND_BIND_PARSER]: Likewise.
[GRECS_COND_GIT_PARSER]: Likewise.
(GRECS_SRC): Add parsertab.c
* src/parsertab.c: New file.
* src/grecs.h (grecs_parser_t): New typedef.
(grecs_enumerate_parsers)
(grecs_get_parser_by_type): New functions.
* tests/Makefile.am (PARSER_DEFS): New variable.
[GRECS_COND_META1_PARSER]: Update PARSER_DEFS.
[GRECS_COND_BIND_PARSER]: Likewise.
[GRECS_COND_GIT_PARSER]: Likewise.
(package.m4): Define ENABLE_* according to the PARSER_DEFS settings.
* tests/empty.at: Test ENABLE_* defines to avoid testing
unsupported parser formats.
* tests/testsuite.at: Likewise.
* tests/gcffmt.c: New option -list. Improve help output.
|
|
* src/bind-gram.y: Accept empty statement lists.
|
|
* src/bind-gram.y: Input may be empty.
* src/grecs-gram.y: Likewise.
* src/meta1-gram.y: Likewise.
* tests/empty.at: New test.
* tests/Makefile.am: Add new testcase.
* tests/testsuite.at: Add new testcase.
|
|
* Makefile.am (EXTRA_DIST): Add @GRECS_DISTDOC@.
* am/grecs.m4 (GRECS_SETUP): New flag syntax-doc sets
GRECS_DISTDOC.
* doc/GRECS_SETUP.3: Update.
* src/format.c (grecs_format_node): Print value if GRECS_NODE_FLAG_VALUE
is set.
* tests/glob01.at: Update.
|
|
* src/grecs.h: Rearange GRECS_NODE_FLAG_* constants.
Remove GRECS_NODE_FLAG_NODESCEND, introduce GRECS_NODE_FLAG_DESCEND
instead.
(_GRECS_NODE_MASK_DELIM,_GRECS_NODE_MASK_OUTPUT): New macros.
(grecs_format_node): Returns int.
(grecs_print_node): Likewise.
|
|
* src/git-parser.c (token)<tag>: Remove.
(token)<path>: New field.
(rawinput): Set input_char to 0 on EOF.
(collect_tag): Remove.
(collect_unquoted,collect_subsection_name): New functions.
(collect_string): Remove.
(gettoken): Handle multiple subsections.
Handle dot-delimited section names.
(create_subsection_node): New function.
(read_section): Rewrite using create_subsection_node.
(grecs_git_parser): Initialize and free tok.path.
* tests/git.conf: Provide a dot-delimited section name.
* tests/parser-git.at: Change. expected output.
|
|
* doc/grecs-syntax.texi: Remove the topmost @section to
let includers specify their own sectioning command.
|
|
* build-aux/yyrename: Improve argument checking. Reword the description.
|
|
* src/bind-lex.l: Fix unquoted string rule.
* src/grecs-lex.l: Likewise.
* tests/bind00.at: Update.
* tests/grecs00.at: New testcase.
* tests/Makefile.am: Add new testcases.
* tests/testsuite.at: Likewise.
* tests/gcffmt.c (main): New options -x and -X.
|
|
Accept ; as a comment starter. Accept partially or fully quoted values.
Support the backslash escapes allowed by Git.
* src/git-parser.c (input): semicolon starts a comment, too.
(collect_substring): New function.
(collect_string): Rewrite via collect_substring.
(collect_value): New function.
(getvalue): Use collect_value.
|
|
* src/bind-lex.l: Fix comment starter rule to take precedence
over the identifier rule.
* tests/bind00.at: New testcase.
* tests/Makefile.am: Add new testcase.
* tests/testsuite.at: Likewise.
|
|
* src/bind-lex.l: Parse #line directives.
(_pop_context): Use fclose or pclose, depending on how
the stream was opened.
(grecs_bind_new_source): Use preprocessor if grecs_preprocessor
was set.
* src/grecs-lex.l (parse_line): Rename to grecs_parse_line_directive.
(parse_line_cpp): Rename to grecs_parse_line_directive_cpp.
* src/grecs.h (grecs_parse_line_directive)
(grecs_parse_line_directive_cpp): New protos.
* src/lookup.c (grecs_match_first): Bugfix.
|
|
|
|
* src/bind-gram.y: Special handling for the controls block.
* src/bind-lex.l: Handle "controls" separately.
* src/lookup.c (grecs_find_node): Handle single dot path
(root node).
(grecs_match_first): Likewise.
(grecs_match_next): Return NULL if buf is NULL.
* tests/parser-bind.at: Update.
|
|
* src/path-parser.c: New file.
* src/format.c (grecs_format_node): Attempt to print value only
if the node is grecs_node_stmt.
* src/grecs.h (grecs_path_parser): New proto.
(grecs_node_from_path_locus): New proto.
* src/lookup.c (grecs_node_from_path_locus): New function.
* src/Make.am (GRECS_SRC): Add path-parser.c.
* build-aux/getopt.m4: Implement print_help_hook.
|
|
* src/format.c (grecs_format_docstring): Rename to grecs_print_docstring.
(grecs_format_simple_statement): Rename to grecs_print_simple_statement.
(grecs_format_block_statement): Rename to grecs_print_block_statement.
(grecs_format_statement_array): Rename to grecs_print_statement_array.
(grecs_format_locus): Rename to grecs_print_locus.
(grecs_format_node_path): Rename to grecs_print_node_path.
(grecs_format_value): Rename to grecs_print_value.
(grecs_format_node): Rename to grecs_print_node.
(grecs_format_locus,grecs_format_node_path)
(grecs_format_value,grecs_format_node): Reimplement as
output-independent functions.
All uses changed.
* src/grecs.h: Update prototypes.
* doc/grecs_format_locus.3: Update.
* doc/grecs_format_node.3: Update.
* doc/grecs_format_node_path.3: Update.
* doc/grecs_format_value.3: Update.
|
|
* Makefile.am: Fix format to git log.
* src/bind-lex.l (grecs_bind_close_sources): Reset input_stack to 0.
* src/lookup.c (split_cfg_path): Allow only one of "./:;,^~" at
the beginning of a path.
|
|
* src/grecs.h (grecs_include_path_clear): New proto.
* src/preproc.c (grecs_include_path_clear): New function.
|
|
* README.submodule: Update URL.
* src/bind-lex.l (grecs_bind_new_source): Scan include path.
* src/grecs.h (grecs_find_include_file): new proto.
* src/preproc.c (try_file): Rename to grecs_find_include_file. Change
signature and return type. All uses updated.
* tests/Makefile.am (EXTRA_DIST): Add new configs.
(TESTSUITE_AT): Add parser-bind.at.
* tests/gcffmt.c: Add -I (-include) option.
* tests/testsuite.at: Include parser-bind.at.
* tests/bind.conf: New file.
* tests/bind.dlz: New file.
* tests/bind.ext.conf: New file.
* tests/bind.int.conf: New file.
* tests/bind.keys: New file.
* tests/parser-bind.at: New file.
|
|
* src/git-parser.c: Hanlde end-of-line comments.
* tests/Makefile.am (EXTRA_DIST): Add meta1.conf and git.conf
(TESTSUITE_AT): Add parser-git.at and parser-meta1.at.
* tests/testsuite.at: Include parser-git.at and parser-meta1.at.
* tests/meta1.conf: New file.
* tests/git.conf: New file.
* tests/parser-git.at: New file.
* tests/parser-meta1.at: New file.
* tests/gcffmt.c (main): Handle -type= option.
|
|
* am/grecs.m4: New option: parser-git
* doc/GRECS_SETUP.3: Document new options.
* src/git-parser.c: New file.
* src/Make.am [GRECS_COND_GIT_PARSER]: Define GRECS_PARSER_GIT.
(GRECS_SRC): Add GRECS_PARSER_GIT.
* src/grecs.h (grecs_git_parser): New proto.
* src/txtacc.c (grecs_txtacc_free): Ignore NULL argument.
|
|
* build-aux/yyrename: Ignore #line statements.
|
|
* am/grecs.m4: New option: parser-bind.
* src/.gitignore: Update.
* src/Make.am [GRECS_COND_BIND_PARSER]: Set GRECS_PARSER_BIND
and GRECS_EXTRA_BIND.
(GRECS_SRC): Include GRECS_PARSER_BIND.
(EXTRA_DIST): Include GRECS_EXTRA_BIND.
* src/bind-gram.y: New file.
* src/bind-lex.l: New file.
* src/format.c (grecs_txtacc_format_value): New function.
* src/grecs.h (grecs_bind_parser): New proto.
* src/parser.c: Set grecs_current_locus.
* src/tree.c (grecs_node_bind): Return immediately if node==NULL.
* src/yytrans: Update.
|
|
* Makefile.am (EXTRA_DIST): Add build-aux/yyrename
* am/grecs.m4: New options: parser-meta1 and all-parsers
* src/.gitignore: Update.
* src/Make.am [GRECS_COND_META1_PARSER]: Set GRECS_PARSER_META1 and
GRECS_EXTRA_META1
(GRECS_SRC): Add new files.
(EXTRA_DIST): Add GRECS_EXTRA_META1.
(LEXCOMPILE,YACCCOMPILE): Redefine
* src/grecs-gram.y: Don't include yygrecs.h
(grecs_vasprintf,grecs_asprintf): Move to a separate file.
(grecs_parse): Rename to grecs_grecs_parser.
Actual grecs_parse is defined in parser.c
(grecs_gram_trace): Move to parser.c
* src/grecs-lex.l: Don't include yygrecs.h
Use line_acc functions.
* src/grecs.h (grecs_trace_flags): New extern.
(GRECS_TRACE_GRAM, GRECS_TRACE_LEX): New flags.
(grecs_lex_begin): Change signature.
(grecs_grecs_parser,grecs_meta1_parser): New protos.
(grecs_line_acc_create)
(grecs_line_acc_free,grecs_line_acc_grow_char)
(grecs_line_acc_grow_char_unescape)
(grecs_line_acc_grow)
(grecs_line_acc_grow_unescape_last): New protos.
(GRECS_TXTACC_BUFSIZE): New const
(grecs_txtacc_create,grecs_txtacc_free)
(grecs_txtacc_grow,grecs_txtacc_finish)
(grecs_txtacc_free_string): New protos.
(grecs_value_match): New proto.
* src/wordsplit.c (quote_transtab): Translate \"
* src/yygrecs.h: Remove.
* src/yytrans: New file.
* build-aux/yyrename: New file.
* src/asprintf.c: New file.
* src/lineacc.c: New file.
* src/meta1-gram.y: New file.
* src/meta1-lex.l: New file.
* src/parser.c: New file.
* src/txtacc.c: New file.
* doc/grecs_parse.3: Update.
* doc/GRECS_SETUP.3: Update.
|
|
* src/lookup.c (grecs_value_match): New function.
(grecs_match_buf_free): Ignore NULL argument.
(grecs_match): Implement single-occurrence wildcard (%). Match
values using fnmatch globbing patterns.
(grecs_match_first): Compress multiple contiguous *
|
|
* src/grecs-gram.y (union)<ident>: New field.
(IDENT): Change type to <ident>. All uses changed.
* src/grecs-lex.l (ident): Initialize ident.locus.
* src/grecs.h (GRECS_NODE_FLAG_NODESCEND): New flag.
(grecs_match_buf_t): New data type.
(grecs_match_first,grecs_match_next)
(grecs_match_buf_free): New protos.
(grecs_tree_first_node,grecs_next_node): New protos.
* src/format.c (grecs_format_node): Handle GRECS_NODE_FLAG_NODESCEND flag.
* src/lookup.c (grecs_match_buf): New struct.
(grecs_match_first,grecs_match_next)
(grecs_match_buf_free): New functions.
(split_cfg_path): Fill in array of values, if given.
(parse_tag): Remove. All uses updated.
(node_finder): Use grecs_match_buf.
* src/tree.c (grecs_tree_reduce): Fill config_keywords with 0s.
(grecs_tree_first_node, grecs_next_node): New functions.
* tests/.gitignore: Add gcfenum
* tests/enum.at: New file.
* tests/glob00.at: New file.
* tests/glob01.at: New file.
* tests/glob02.at: New file.
* tests/gcfenum.c: New file.
* tests/Makefile.am: Build gcfenum. Add enum.at test.
* tests/testsuite.at: Include enum.at.
* tests/gcfpeek.c: Implement -match option.
|
|
* build-aux/git2chg.awk: New configuration variables:
since=YYYY-MM-DD, to cut off entries earlier than the
given date, and append=FILE, to append FILE to the
generated ChangeLog.
* am/grecs.m4 (GRECS_HOST_PROJECT_INCLUDES): New substitution
variable.
* src/Make.am (INCLUDES): Expand GRECS_HOST_PROJECT_INCLUDES.
* tests/Makefile.am: Likewise.
|
|
* src/grecs-gram.y (slist production): Free ep->data after appending.
* src/grecs-lex.l (string_list): Remove. All uses updated.
* src/tree.c (grecs_node_free): Free ident.
(grecs_tree_process): Fill config_keywords with zeros.
* src/grecs.h (grecs_getline): New proto.
* src/preproc.c (pp_getline): Rename to grecs_getline,
drop static qualifier. Improve initial allocation.
|
|
* src/tree.c (grecs_process_ident): Do nothing if target is NULL.
|
|
|
|
* Makefile.am (gitid.h): Fix sed expression.
* src/grecs.h (grecs_hash_string): New proto.
* src/symtab.c (grecs_hash_string): New function.
|
|
* src/lookup.c (grecs_value_eq): Allow for NULL values.
|
|
* src/format.c (grecs_format_value): Return immediately if val is NULL.
* src/grecs-gram.y: Accept statements without values and arrays as
block tags.
* src/tree.c (grecs_process_ident): Bail out if a value is required, but
not given.
|
|
|
|
|
|
* .gitignore: Add gitid.h
* Makefile.am: Build gitid.h.
* am/grecs.m4: Remove GRECS_VEROK_AT.
* build-aux/getopt.m4 (print_version_hook): New variable.
(print_version): Call print_version_hook, if defined.
* src/Make.am (INCLUDES): Update.
* src/grecs.h (grecs_version_info) <id>: New member.
* src/version.c (grecs_version): Initialize id.
* tests/Makefile.am: Remove GRECS_VEROK_AT.
* tests/testsuite.at: Likewise.
|
|
* am/grecs.m4: Define GRECS_VEROK_AT if package version matches
the standard scheme.
Define GRECS_DISTCK_AT if install flag is set.
* src/grecs.h (GRECS_VERSION_MAJOR)
(GRECS_VERSION_MINOR): New defines.
(grecs_version_info)<buffer>: New member.
(grecs_version): Return allocated grecs_version_info structure.
(grecs_version_cmp): Change prototype.
(grecs_version_ok)
(grecs_version_info_cmp)
(grecs_version_split)
(grecs_version_info_free): New protos.
* src/version.c: Rewrite.
* src/libgrecs.m4 (AM_LIBGRECS): Use grecs_version_ok
* tests/.gitignore: Add distck.
* tests/Makefile.am: Add new tests.
* tests/testsuite.at: Add new tests.
* tests/gcfver.c: Update.
* tests/vercmp.at: Rewrite.
* tests/verok.at: New file (from old vercmp.at).
* tests/distck.at: New file.
* tests/distck.c: New file.
|
|
|
|
* src/grecs.h (GRECS_MULT): New flag.
* src/lookup.c (parse_label): Allocate array elements.
* src/tree.c (grecs_process_ident): Store string duplicates
in lists.
(reduceproc): Ignore keywords marked with GRECS_MULT.
|
|
* AUTHORS, COPYING, NEWS, README: New files.
* .gitignore: Update.
* am/.gitignore: New file.
* build-aux/.gitignore: New file.
* build-aux/ylwrap: Remove.
* Makefile.am: Define ACLOCAL_AMFLAGS
[GRECS_CHANGELOG]: Build ChangeLog.
* am/grecs.m4: Define GRECS_CHANGELOG and GRECS_SRCDIR.
Fixup first argument, if it is [.].
* configure.ac: New file.
* src/Make-inst.am (include_HEADERS): Add wordsplit.h.
Install libgrecs.m4.
* Make-shared.am (noinst_HEADERS): Add wordsplit.h.
* src/Make-static.am: Likewise.
* src/Make.am (GRECS_SRC): Remove wordsplit.h
(noinst_HEADERS): Add yygrecs.h
(YLWRAP): Remove.
* src/libgrecs.m4: New file.
* src/yygrecs.h: New file.
* src/grecs-gram.y: Include yygrecs.h.
* src/grecs-lex.l: Likewise.
* src/preproc.c (yy_grecs_flex_debug): Rename to grecs_yy_flex_debug.
|
|
* src/Makefile.am: Remove.
* src/Make.am (GRECS_SRC): Remove grecs.h
* src/Make-inst.am (include_HEADERS): Add grecs.h
* src/Make-shared.am (noinst_HEADERS): Add grecs.h
* src/Make-static.am: Likewise.
|
|
* src/grecs.h (grecs_tree_reduce): Change signature.
(nodeproc_closure)<flags>: New member.
(value_to_list): Bugfixes.
(value_to_array,array_add): New functions.
(node_aggregate_stmt): Rewrite.
(node_merge_stmt): Take additional argument.
(grecs_tree_reduce): Take additional argument. All uses changed.
* src/tree.c (grecs_tree_free): Don't coredump on NULL arg.
* src/format.c (grecs_format_simple_statement): Bugfix.
* tests/reduce03.at: New testcase.
* tests/Makefile.am: Add reduce03.at
* tests/testsuite.at: Add reduce03.at
* tests/gcffmt.c: Single grecs_format_node call is enough to
print the entire tree.
* tests/gcfset.c (logging_kwtab): Mark "facility" as GRECS_AGGR
to disable aggregation.
(usage): Update.
(main): New options: -print, -locus, -sort, -noset.
Pass GRECS_AGGR to grecs_tree_reduce.
|