summaryrefslogtreecommitdiff
path: root/src/runtime/python
diff options
context:
space:
mode:
authorKrasimir Angelov <kr.angelov@gmail.com>2017-08-07 16:39:19 +0200
committerKrasimir Angelov <kr.angelov@gmail.com>2017-08-07 16:39:19 +0200
commita8eeb497670fb0f2ffab1f9b070808df965415be (patch)
tree5f169893da63183df272b0d281b5eaf5857ed955 /src/runtime/python
parenta4c19875ed4a97671d17d6d6f062b465ae1f87a6 (diff)
the linearizer API now allows to detect metavariables. This is used for instancein the lookup where the tokens produced from the metavariables are interpreted as distinct from all other tokens.
Diffstat (limited to 'src/runtime/python')
-rw-r--r--src/runtime/python/pypgf.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/runtime/python/pypgf.c b/src/runtime/python/pypgf.c
index d8a3ac976..0278d4bd1 100644
--- a/src/runtime/python/pypgf.c
+++ b/src/runtime/python/pypgf.c
@@ -2039,13 +2039,20 @@ pgf_bracket_lzn_end_phrase(PgfLinFuncs** funcs, PgfCId cat, int fid, int lindex,
state->list = parent;
}
+static void
+pgf_bracket_lzn_symbol_meta(PgfLinFuncs** funcs, PgfMetaId meta_id)
+{
+ pgf_bracket_lzn_symbol_token(funcs, "?");
+}
+
static PgfLinFuncs pgf_bracket_lin_funcs = {
.symbol_token = pgf_bracket_lzn_symbol_token,
.begin_phrase = pgf_bracket_lzn_begin_phrase,
.end_phrase = pgf_bracket_lzn_end_phrase,
.symbol_ne = NULL,
.symbol_bind = NULL,
- .symbol_capit = NULL
+ .symbol_capit = NULL,
+ .symbol_meta = pgf_bracket_lzn_symbol_meta
};
static PyObject*