From 8bcc70eac8af379ed3481039eb1bd5feea3cf195 Mon Sep 17 00:00:00 2001 From: "kr.angelov" Date: Fri, 22 Nov 2013 13:30:18 +0000 Subject: the GF syntax for identifiers is exteded with quoted forms, i.e. you could write for instance 'ab.c' and then everything between the quites is identifier. This includes Unicode characters and non-ASCII symbols. This is useful for automatically generated GF grammars. --- src/runtime/c/pgf/printer.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/runtime/c/pgf/printer.c') diff --git a/src/runtime/c/pgf/printer.c b/src/runtime/c/pgf/printer.c index 8b737266e..2417a3edd 100644 --- a/src/runtime/c/pgf/printer.c +++ b/src/runtime/c/pgf/printer.c @@ -16,7 +16,7 @@ pgf_print_flag(GuMapItor* fn, const void* key, void* value, GuOut *out = clo->out; gu_puts(" flag ", out, err); - gu_string_write(flag, out, err); + pgf_print_cid(flag, out, err); gu_puts(" = ", out, err); pgf_print_literal(lit, out, err); gu_puts(";\n", out, err); @@ -32,7 +32,7 @@ pgf_print_cat(GuMapItor* fn, const void* key, void* value, GuOut *out = clo->out; gu_puts(" cat ", out, err); - gu_string_write(name, out, err); + pgf_print_cid(name, out, err); PgfPrintContext* ctxt = NULL; size_t n_hypos = gu_seq_length(cat->context); @@ -61,7 +61,7 @@ pgf_print_absfun(GuMapItor* fn, const void* key, void* value, GuOut *out = clo->out; gu_puts((fun->defns == NULL) ? " data " : " fun ", out, err); - gu_string_write(name, out, err); + pgf_print_cid(name, out, err); gu_puts(" : ", out, err); pgf_print_type(fun->type, NULL, 0, out, err); gu_printf(out, err, " ; -- %f\n", fun->ep.prob); @@ -70,7 +70,7 @@ static void pgf_print_abstract(PgfAbstr* abstr, GuOut* out, GuExn* err) { gu_puts("abstract ", out, err); - gu_string_write(abstr->name, out, err); + pgf_print_cid(abstr->name, out, err); gu_puts(" {\n", out, err); PgfPrintFn clo1 = { { pgf_print_flag }, out }; @@ -205,7 +205,7 @@ pgf_print_cncfun(PgfCncFun *cncfun, PgfSequences* sequences, if (cncfun->absfun != NULL) { gu_puts(" [", out, err); - gu_string_write(cncfun->absfun->name, out, err); + pgf_print_cid(cncfun->absfun->name, out, err); gu_puts("]", out, err); } @@ -311,7 +311,7 @@ pgf_print_cnccat(GuMapItor* fn, const void* key, void* value, GuOut *out = clo->out; gu_puts(" ", out, err); - gu_string_write(name, out, err); + pgf_print_cid(name, out, err); gu_puts(" :=\n", out, err); PgfCCat *start = gu_seq_get(cnccat->cats, PgfCCat*, 0); @@ -335,7 +335,7 @@ pgf_print_concrete(PgfCId cncname, PgfConcr* concr, GuOut* out, GuExn* err) { gu_puts("concrete ", out, err); - gu_string_write(cncname, out, err); + pgf_print_cid(cncname, out, err); gu_puts(" {\n", out, err); PgfPrintFn clo1 = { { pgf_print_flag }, out }; -- cgit v1.2.3