From 1500d2775307f855d17c483caabcdf1c2924b562 Mon Sep 17 00:00:00 2001 From: Chloe Brown Date: Thu, 26 Jun 2025 18:20:42 +0100 Subject: Fix 955--960. --- sec/compiler.ltx | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/sec/compiler.ltx b/sec/compiler.ltx index a78a6cd..8f18adc 100644 --- a/sec/compiler.ltx +++ b/sec/compiler.ltx @@ -58,12 +58,13 @@ A parser combinator can interact with state when: \item performing a semantic action (modifying the parse result), where it can read the state. \end{itemize} -For example, consider parsing the syntax \verb|\x => x|, binding the -variable \verb|x| before referencing it. After processing the first -occurrence of \verb|x|, the \lang{} parser updates the state adding -\verb|x| to the environment of bound names. After parsing the second -\verb|x| as an identifier, the parser can look up the name in the -environment and convert it into a deBruijn index. +For example, consider parsing the syntax \systemtinline{\x => x}, +binding the variable \systemtinline{x} before referencing it. After +processing the first occurrence of \systemtinline{x}, the \lang{} +parser updates the state by adding \systemtinline{x} to the +environment of bound names. After parsing the second \systemtinline{x} +as an identifier, the parser can look up the name in the environment +and convert it into a deBruijn index. The state is not stored globally, but is local to the current parser combinator. We can imagine this as a stack of states. Before parsing -- cgit v1.2.3