@@ -302,8 +302,10 @@ instance Monad Parser where
302302-- TEXT
303303
304304
305+{-# INLINE symbol #-}
305306symbol :: Text -> Parser ()
306307symbol sym@(Text.Text tArray tOffset tLen) =
308+ let !theory = Symbol sym in
307309 Parser $ \(State array offset length indent row col ctx) cok _ _ eerr ->
308310 if tLen <= length && Text.equal tArray tOffset array offset tLen then
309311 let
@@ -316,7 +318,7 @@ symbol sym@(Text.Text tArray tOffset tLen) =
316318 cok () newState noError
317319
318320 else
319− eerr (expect row col ctx (Symbol sym))
321+ eerr (expect row col ctx theory)
320322
321323
322324moveCursor :: Text.Array -> Int -> Int -> Int -> Int -> (# Int, Int #)
@@ -738,7 +740,7 @@ eatMultiCommentHelp array offset length row col openComments =
738740
739741docComment :: Parser Text
740742docComment =
741− do symbol "{-|"
743+ do docCommentOpen
742744 Parser $ \(State array offset length indent row col ctx) cok cerr _ _ ->
743745 case eatMultiCommentHelp array offset length row col 1 of
744746 Left err ->
@@ -751,6 +753,12 @@ docComment =
751753 noError
752754
753755
756+{-# NOINLINE docCommentOpen #-}
757+docCommentOpen :: Parser ()
758+docCommentOpen =
759+ symbol "{-|"
760+
761+
754762chompUntilDocs :: Parser Bool
755763chompUntilDocs =
756764 Parser $ \(State array offset length indent row col ctx) cok _ _ _ ->
@@ -1375,7 +1383,7 @@ stepHex word hexNumber =
13751383
13761384shaderSource :: Parser Text
13771385shaderSource =
1378− do symbol "[glsl|"
1386+ do shaderSourceOpen
13791387 Parser $ \(State array offset length indent row col ctx) cok cerr _ _ ->
13801388 case eatShader array offset length row col of
13811389 Nothing ->
@@ -1390,6 +1398,12 @@ shaderSource =
13901398 cok (copyText array offset size) newState noError
13911399
13921400
1401+{-# NOINLINE shaderSourceOpen #-}
1402+shaderSourceOpen :: Parser ()
1403+shaderSourceOpen =
1404+ symbol "[glsl|"
1405+
1406+
13931407eatShader :: Text.Array -> Int -> Int -> Int -> Int -> Maybe (Int, Int, Int)
13941408eatShader array offset length row col =
13951409 if length < 2 then