diff options
author | Chloe Brown <chloe.brown.00@outlook.com> | 2025-06-26 18:20:42 +0100 |
---|---|---|
committer | Chloe Brown <chloe.brown.00@outlook.com> | 2025-06-26 18:20:42 +0100 |
commit | 1500d2775307f855d17c483caabcdf1c2924b562 (patch) | |
tree | 96c578e427c52dcae22d055199f5a55674d088f4 | |
parent | 8c0e2684211cc01f33989cb518556d4a0282496c (diff) |
Fix 955--960.
-rw-r--r-- | sec/compiler.ltx | 13 |
1 files 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 |