Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
comp2212-cw-2021
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
PLC
comp2212-cw-2021
Commits
4ffbb4a8
Commit
4ffbb4a8
authored
4 years ago
by
pm3g19
Browse files
Options
Downloads
Patches
Plain Diff
Implemented stripping of csv strings
parent
2d4d5e50
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Interpreter.hs
+8
-7
8 additions, 7 deletions
Interpreter.hs
with
8 additions
and
7 deletions
Interpreter.hs
+
8
−
7
View file @
4ffbb4a8
...
@@ -2,6 +2,7 @@ import Types
...
@@ -2,6 +2,7 @@ import Types
import
Debug
import
Debug
import
Eval
import
Eval
import
System.IO
import
System.IO
import
ReadCSV
parse
::
String
->
Program
parse
::
String
->
Program
parse
=
notImplemented
parse
=
notImplemented
...
@@ -34,10 +35,6 @@ evalFinal = evalFull []
...
@@ -34,10 +35,6 @@ evalFinal = evalFull []
showFinal
::
Expr
->
IO
()
showFinal
::
Expr
->
IO
()
showFinal
=
notImplemented
showFinal
=
notImplemented
--------------------------------------------
--------------------------------------------
--------------------------------------------
loadInputFile
::
SymbolName
->
IO
Expr
loadInputFile
::
SymbolName
->
IO
Expr
loadInputFile
name
=
do
loadInputFile
name
=
do
...
@@ -46,8 +43,12 @@ loadInputFile name = do
...
@@ -46,8 +43,12 @@ loadInputFile name = do
return
output
return
output
where
where
toRecord
stringList
=
Record
$
map
String
stringList
toRecord
stringList
=
Record
$
map
((
String
)
.
stripLeadingAndTrailingWhitespace
)
stringList
stripLeadingAndTrailingWhitespace
=
stripTrailingWhitespace
.
dropWhile
(
==
' '
)
stripTrailingWhitespace
(
' '
:
xs
)
=
let
remainder
=
stripTrailingWhitespace
xs
in
if
null
remainder
then
[]
else
' '
:
remainder
readCSV
::
FilePath
->
IO
[[
String
]]
stripTrailingWhitespace
(
x
:
xs
)
=
x
:
stripTrailingWhitespace
xs
readCSV
=
notImplemented
stripTrailingWhitespace
[]
=
[]
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment