Skip to content

Commit 8a7331f

Browse files
committed
Rewrite pragma inside produceExpListPerState with code-combinators
1 parent 2c316cc commit 8a7331f

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

packages/backend-lalr/src/Happy/Backend/LALR/ProduceCode.lhs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -610,9 +610,10 @@ machinery to discard states in the parser...
610610
% f (Prelude.True, nr) = [token_strs Prelude.!! nr]
611611

612612
> produceExpListPerState
613-
> = renderDocDecs (runIdentity $ evalStateT (produceExpListArray @DocExp) Map.empty)
614-
> . str "{-# NOINLINE happyExpListPerState #-}\n"
615-
> . renderDocDecs [[happy_exp_list_per_state_dec]]
613+
> =
614+
> (renderDocDecs $
615+
> (runIdentity $ evalStateT (produceExpListArray @DocExp) Map.empty)
616+
> ++ [[noInlinePragmaD happy_exp_list_per_state_name, happy_exp_list_per_state_dec]])
616617
> . nl
617618
> where (first_token, last_token) = bounds token_names'
618619
> nr_tokens = last_token - first_token + 1

0 commit comments

Comments
 (0)