on master help sign in
get rid of unused arguments in getCharWidth
6788afcEvan Czaplicki
compiler/src/Elm/Docs.hs+1−1
@@ -404,7 +404,7 @@ untilDocs pos end row col =
404 then
404 then
405 (# True, pos5, row, col + 5 #)
405 (# True, pos5, row, col + 5 #)
406 else
406 else
407− let !newPos = plusPtr pos (P.getCharWidth pos end word) in
407+ let !newPos = plusPtr pos (P.getCharWidth word) in
408 untilDocs newPos end row (col + 1)
408 untilDocs newPos end row (col + 1)
409
409
410
410
compiler/src/Elm/Kernel.hs+1−1
@@ -152,7 +152,7 @@ chompChunks vs es fs src pos end row col lastPos revChunks =
152
152
153 else
153 else
154 let
154 let
155− !newPos = plusPtr pos (getCharWidth pos end word)
155+ !newPos = plusPtr pos (getCharWidth word)
156 in
156 in
157 chompChunks vs es fs src newPos end row (col + 1) lastPos revChunks
157 chompChunks vs es fs src newPos end row (col + 1) lastPos revChunks
158
158
compiler/src/Json/Decode.hs+1−1
@@ -671,7 +671,7 @@ pStringHelp pos end row col =
671 if word < 0x20 then
671 if word < 0x20 then
672 (# BadString BadStringControlChar, pos, row, col #)
672 (# BadString BadStringControlChar, pos, row, col #)
673 else
673 else
674− let !newPos = plusPtr pos (P.getCharWidth pos end word) in
674+ let !newPos = plusPtr pos (P.getCharWidth word) in
675 pStringHelp newPos end row (col + 1)
675 pStringHelp newPos end row (col + 1)
676
676
677
677
compiler/src/Json/String.hs+1−1
@@ -126,7 +126,7 @@ chompChunks pos end start revChunks =
126
126
127 _ ->
127 _ ->
128 let
128 let
129− !width = P.getCharWidth pos end word
129+ !width = P.getCharWidth word
130 !newPos = plusPtr pos width
130 !newPos = plusPtr pos width
131 in
131 in
132 chompChunks newPos end start revChunks
132 chompChunks newPos end start revChunks
compiler/src/Parse/Primitives.hs+2−2
@@ -394,8 +394,8 @@ isWord pos end word =
394 pos < end && unsafeIndex pos == word
394 pos < end && unsafeIndex pos == word
395
395
396
396
397−getCharWidth :: Ptr Word8 -> Ptr Word8 -> Word8 -> Int
397+getCharWidth :: Word8 -> Int
398−getCharWidth _pos _end word -- TODO remove unused variables. Shorter stack?
398+getCharWidth word
399 | word < 0x80 = 1
399 | word < 0x80 = 1
400 | word < 0xc0 = error "Need UTF-8 encoded input. Ran into unrecognized bits."
400 | word < 0xc0 = error "Need UTF-8 encoded input. Ran into unrecognized bits."
401 | word < 0xe0 = 2
401 | word < 0xe0 = 2
compiler/src/Parse/Shader.hs+1−1
@@ -96,7 +96,7 @@ eatShader pos end row col =
96 eatShader (plusPtr pos 1) end (row + 1) 1
96 eatShader (plusPtr pos 1) end (row + 1) 1
97
97
98 else
98 else
99− let !newPos = plusPtr pos (P.getCharWidth pos end word) in
99+ let !newPos = plusPtr pos (P.getCharWidth word) in
100 eatShader newPos end row (col + 1)
100 eatShader newPos end row (col + 1)
101
101
102
102
compiler/src/Parse/Space.hs+2−2
@@ -167,7 +167,7 @@ eatLineComment pos end row col =
167 if word == 0x0A {- \n -} then
167 if word == 0x0A {- \n -} then
168 eatSpaces (plusPtr pos 1) end (row + 1) 1
168 eatSpaces (plusPtr pos 1) end (row + 1) 1
169 else
169 else
170− let !newPos = plusPtr pos (P.getCharWidth pos end word) in
170+ let !newPos = plusPtr pos (P.getCharWidth word) in
171 eatLineComment newPos end row (col + 1)
171 eatLineComment newPos end row (col + 1)
172
172
173
173
@@ -231,7 +231,7 @@ eatMultiCommentHelp pos end row col openComments =
231 eatMultiCommentHelp (plusPtr pos 2) end row (col + 2) (openComments + 1)
231 eatMultiCommentHelp (plusPtr pos 2) end row (col + 2) (openComments + 1)
232
232
233 else
233 else
234− let !newPos = plusPtr pos (P.getCharWidth pos end word) in
234+ let !newPos = plusPtr pos (P.getCharWidth word) in
235 eatMultiCommentHelp newPos end row (col + 1) openComments
235 eatMultiCommentHelp newPos end row (col + 1) openComments
236
236
237
237
compiler/src/Parse/String.hs+3−3
@@ -87,7 +87,7 @@ chompChar pos end row col numChars mostRecent =
87
87
88 else
88 else
89 let
89 let
90− !width = P.getCharWidth pos end word
90+ !width = P.getCharWidth word
91 !newPos = plusPtr pos width
91 !newPos = plusPtr pos width
92 in
92 in
93 chompChar newPos end row (col + 1) (numChars + 1) (ES.Slice pos width)
93 chompChar newPos end row (col + 1) (numChars + 1) (ES.Slice pos width)
@@ -203,7 +203,7 @@ singleString pos end row col initialPos revChunks =
203 Err row (col + 1) E.StringEndless_Single
203 Err row (col + 1) E.StringEndless_Single
204
204
205 else
205 else
206− let !newPos = plusPtr pos (P.getCharWidth pos end word) in
206+ let !newPos = plusPtr pos (P.getCharWidth word) in
207 singleString newPos end row (col + 1) initialPos revChunks
207 singleString newPos end row (col + 1) initialPos revChunks
208
208
209
209
@@ -254,7 +254,7 @@ multiString pos end row col initialPos sr sc revChunks =
254 Err sr sc E.StringEndless_Multi
254 Err sr sc E.StringEndless_Multi
255
255
256 else
256 else
257− let !newPos = plusPtr pos (P.getCharWidth pos end word) in
257+ let !newPos = plusPtr pos (P.getCharWidth word) in
258 multiString newPos end row (col + 1) initialPos sr sc revChunks
258 multiString newPos end row (col + 1) initialPos sr sc revChunks
259
259
260
260