aboutsummaryrefslogtreecommitdiffstats
path: root/print-syntax.c
diff options
context:
space:
mode:
authorMattias Andrée <m@maandree.se>2026-01-05 13:50:38 +0100
committerMattias Andrée <m@maandree.se>2026-02-23 07:52:18 +0100
commit7dd4970daafdc1992e1dba486a1477a17cb4c53e (patch)
treee56e544ec55e68872397738e0e5064b000d31eba /print-syntax.c
parentOptimise detection of rejection (diff)
downloadlibparser-7dd4970daafdc1992e1dba486a1477a17cb4c53e.tar.gz
libparser-7dd4970daafdc1992e1dba486a1477a17cb4c53e.tar.bz2
libparser-7dd4970daafdc1992e1dba486a1477a17cb4c53e.tar.xz
Add committed-operator
Signed-off-by: Mattias Andrée <m@maandree.se>
Diffstat (limited to 'print-syntax.c')
-rw-r--r--print-syntax.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/print-syntax.c b/print-syntax.c
index 1584e7b..3228401 100644
--- a/print-syntax.c
+++ b/print-syntax.c
@@ -42,6 +42,13 @@ print_sentence(const union libparser_sentence *sentence, int indent)
indent += 1;
break;
+ case LIBPARSER_SENTENCE_TYPE_COMMITTED:
+ printf("+(");
+ indent = print_sentence(sentence->unary.sentence, indent + 2);
+ printf(")");
+ indent += 1;
+ break;
+
case LIBPARSER_SENTENCE_TYPE_OPTIONAL:
printf("[");
indent = print_sentence(sentence->unary.sentence, indent + 1);