on master help sign in
get rid of unused arguments in getCharWidth
commit6788afcf6acb02ebfb6fbc76761e55ef1f711ee2 authorEvan Czaplicki <evancz@users.noreply.github.com> dateMon 10 Jun 2019, 11:33 (7 years ago) parent0d54890
8 files changed+12−12
compiler/src/Elm/Docs.hs+1−1 compiler/src/Elm/Kernel.hs+1−1 compiler/src/Json/Decode.hs+1−1 compiler/src/Json/String.hs+1−1 compiler/src/Parse/Primitives.hs+2−2 compiler/src/Parse/Shader.hs+1−1 compiler/src/Parse/Space.hs+2−2 compiler/src/Parse/String.hs+3−3
compiler/src/Elm/Docs.hs+1−1
@@ -404,7 +404,7 @@ untilDocs pos end row col =
404404 then
405405 (# True, pos5, row, col + 5 #)
406406 else
407− let !newPos = plusPtr pos (P.getCharWidth pos end word) in
407+ let !newPos = plusPtr pos (P.getCharWidth word) in
408408 untilDocs newPos end row (col + 1)
409409
410410
compiler/src/Elm/Kernel.hs+1−1
@@ -152,7 +152,7 @@ chompChunks vs es fs src pos end row col lastPos revChunks =
152152
153153 else
154154 let
155− !newPos = plusPtr pos (getCharWidth pos end word)
155+ !newPos = plusPtr pos (getCharWidth word)
156156 in
157157 chompChunks vs es fs src newPos end row (col + 1) lastPos revChunks
158158
compiler/src/Json/Decode.hs+1−1
@@ -671,7 +671,7 @@ pStringHelp pos end row col =
671671 if word < 0x20 then
672672 (# BadString BadStringControlChar, pos, row, col #)
673673 else
674− let !newPos = plusPtr pos (P.getCharWidth pos end word) in
674+ let !newPos = plusPtr pos (P.getCharWidth word) in
675675 pStringHelp newPos end row (col + 1)
676676
677677
compiler/src/Json/String.hs+1−1
@@ -126,7 +126,7 @@ chompChunks pos end start revChunks =
126126
127127 _ ->
128128 let
129− !width = P.getCharWidth pos end word
129+ !width = P.getCharWidth word
130130 !newPos = plusPtr pos width
131131 in
132132 chompChunks newPos end start revChunks
compiler/src/Parse/Primitives.hs+2−2
@@ -394,8 +394,8 @@ isWord pos end word =
394394 pos < end && unsafeIndex pos == word
395395
396396
397−getCharWidth :: Ptr Word8 -> Ptr Word8 -> Word8 -> Int
398−getCharWidth _pos _end word -- TODO remove unused variables. Shorter stack?
397+getCharWidth :: Word8 -> Int
398+getCharWidth word
399399 | word < 0x80 = 1
400400 | word < 0xc0 = error "Need UTF-8 encoded input. Ran into unrecognized bits."
401401 | word < 0xe0 = 2
compiler/src/Parse/Shader.hs+1−1
@@ -96,7 +96,7 @@ eatShader pos end row col =
9696 eatShader (plusPtr pos 1) end (row + 1) 1
9797
9898 else
99− let !newPos = plusPtr pos (P.getCharWidth pos end word) in
99+ let !newPos = plusPtr pos (P.getCharWidth word) in
100100 eatShader newPos end row (col + 1)
101101
102102
compiler/src/Parse/Space.hs+2−2
@@ -167,7 +167,7 @@ eatLineComment pos end row col =
167167 if word == 0x0A {- \n -} then
168168 eatSpaces (plusPtr pos 1) end (row + 1) 1
169169 else
170− let !newPos = plusPtr pos (P.getCharWidth pos end word) in
170+ let !newPos = plusPtr pos (P.getCharWidth word) in
171171 eatLineComment newPos end row (col + 1)
172172
173173
@@ -231,7 +231,7 @@ eatMultiCommentHelp pos end row col openComments =
231231 eatMultiCommentHelp (plusPtr pos 2) end row (col + 2) (openComments + 1)
232232
233233 else
234− let !newPos = plusPtr pos (P.getCharWidth pos end word) in
234+ let !newPos = plusPtr pos (P.getCharWidth word) in
235235 eatMultiCommentHelp newPos end row (col + 1) openComments
236236
237237
compiler/src/Parse/String.hs+3−3
@@ -87,7 +87,7 @@ chompChar pos end row col numChars mostRecent =
8787
8888 else
8989 let
90− !width = P.getCharWidth pos end word
90+ !width = P.getCharWidth word
9191 !newPos = plusPtr pos width
9292 in
9393 chompChar newPos end row (col + 1) (numChars + 1) (ES.Slice pos width)
@@ -203,7 +203,7 @@ singleString pos end row col initialPos revChunks =
203203 Err row (col + 1) E.StringEndless_Single
204204
205205 else
206− let !newPos = plusPtr pos (P.getCharWidth pos end word) in
206+ let !newPos = plusPtr pos (P.getCharWidth word) in
207207 singleString newPos end row (col + 1) initialPos revChunks
208208
209209
@@ -254,7 +254,7 @@ multiString pos end row col initialPos sr sc revChunks =
254254 Err sr sc E.StringEndless_Multi
255255
256256 else
257− let !newPos = plusPtr pos (P.getCharWidth pos end word) in
257+ let !newPos = plusPtr pos (P.getCharWidth word) in
258258 multiString newPos end row (col + 1) initialPos sr sc revChunks
259259
260260