diff options
author | Sergey Poznyakoff <gray@gnu.org> | 2019-06-05 16:42:37 +0300 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org> | 2019-06-05 16:52:58 +0300 |
commit | 806485a57fb37784e3e1789fce829a2bac390d99 (patch) | |
tree | 963e02852aa0203c912b9947eec0211e8661bc82 /include/grecs/value.h | |
parent | f7b04cc09b26a7e1342170129dacf896f50f98b2 (diff) | |
download | grecs-806485a57fb37784e3e1789fce829a2bac390d99.tar.gz grecs-806485a57fb37784e3e1789fce829a2bac390d99.tar.bz2 |
Fix syntax checking of compound vs. scalar statements. Add assertion functions.
Up to now the parser incorrectly accepted the use of compound statement
keyword in scalar context, unless the keyword description had non NULL
value in the callback field. This change fixes it.
It also defines several assertion functions for use inm callbacks.
* src/tree.c (grecs_value_type_string): New function.
(find_keyword): Take into account node type.
(nodeproc,reduceproc): Leave error reporting to find_keyword.
* tests/set.at: Change expected error string.
* include/grecs/tree.h (grecs_assert_value_type)
(grecs_assert_scalar_stmt)
(grecs_assert_node_value_type): New protos.
* include/grecs/value.h (grecs_value_type_string): New proto.
* src/Make.am: Add assert.c
* src/assert.c: New file.
* src/format.c (grecs_data_type_string): Add i18n markers to the
returned strings.
Diffstat (limited to 'include/grecs/value.h')
-rw-r--r-- | include/grecs/value.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/grecs/value.h b/include/grecs/value.h index 8cd2800..480db9d 100644 --- a/include/grecs/value.h +++ b/include/grecs/value.h @@ -44,6 +44,7 @@ typedef struct grecs_value { void grecs_value_free(struct grecs_value *val); void grecs_value_free_content(struct grecs_value *val); grecs_value_t *grecs_value_ptr_from_static(grecs_value_t *input); +const char *grecs_value_type_string(int t); int grecs_value_eq(struct grecs_value *a, struct grecs_value *b); int grecs_value_match(struct grecs_value *pat, struct grecs_value *b, |