Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
M
MLG360Interpreter
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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
plw1g21
MLG360Interpreter
Commits
7bc2f224
Commit
7bc2f224
authored
Apr 26, 2023
by
mhz1g21
Browse files
Options
Downloads
Patches
Plain Diff
added tile validation on join
parent
70a7180b
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
Grammar.y
+2
-1
2 additions, 1 deletion
Grammar.y
Julio.hs
+11
-2
11 additions, 2 deletions
Julio.hs
with
13 additions
and
3 deletions
Grammar.y
+
2
−
1
View file @
7bc2f224
...
...
@@ -3,7 +3,8 @@ module Grammar where
import Tokens
}
%name parseJulio
%name parse
Julio
%tokentype { Token }
%error { parseError }
%token
...
...
This diff is collapsed.
Click to expand it.
Julio.hs
+
11
−
2
View file @
7bc2f224
...
...
@@ -366,7 +366,11 @@ evaluateJoinH e1 e2 env = do
return
(
TileValue
joinedTile
)
_
->
error
"Both operands of joinH should be a Tile"
joinTilesH
t1
t2
=
zipWith
(
++
)
t1
t2
joinTilesH
t1
t2
=
do
let
equal
=
length
t1
==
length
t2
case
(
equal
)
of
True
->
zipWith
(
++
)
t1
t2
False
->
error
"Tiles must have the same number of rows to be joined horizontally"
--join tiles vertically
evaluateJoinV
e1
e2
env
=
do
...
...
@@ -378,7 +382,12 @@ evaluateJoinV e1 e2 env = do
return
(
TileValue
joinedTile
)
_
->
error
"Both operands of joinV should be a Tile"
joinTilesV
t1
t2
=
t1
++
t2
joinTilesV
t1
t2
=
do
let
equal
=
length
(
head
t1
)
==
length
(
head
t2
)
case
(
equal
)
of
True
->
t1
++
t2
False
->
error
"Tiles must have the same number of columns to be joined vertically"
--export tile
...
...
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