Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
ACC-project
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
Haley Sapphie Owsianko
ACC-project
Commits
a3a52ceb
Commit
a3a52ceb
authored
3 years ago
by
Luca Bataillard
Browse files
Options
Downloads
Patches
Plain Diff
fix wrong implicit usage
parent
849e0c6e
No related branches found
No related tags found
1 merge request
!2
Improved cc
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
compiler/src/l3/CPSInterpreter.scala
+2
-1
2 additions, 1 deletion
compiler/src/l3/CPSInterpreter.scala
compiler/src/l3/CPSValueRepresenter.scala
+3
-3
3 additions, 3 deletions
compiler/src/l3/CPSValueRepresenter.scala
compiler/src/l3/Main.scala
+3
-1
3 additions, 1 deletion
compiler/src/l3/Main.scala
with
8 additions
and
5 deletions
compiler/src/l3/CPSInterpreter.scala
+
2
−
1
View file @
a3a52ceb
...
...
@@ -221,7 +221,8 @@ class CPSInterpreterLow(log: SymbolicCPSTreeModuleLow.Tree => Unit)
allocBlock
(
t
,
Array
.
fill
(
s
)(
BitsV
(
0
)))
case
(
BlockTag
,
Seq
(
BlockV
(
_
,
t
,
_
)))
=>
BitsV
(
t
)
case
(
BlockLength
,
Seq
(
BlockV
(
_
,
_
,
c
)))
=>
BitsV
(
c
.
length
)
case
(
BlockGet
,
Seq
(
BlockV
(
_
,
_
,
c
),
BitsV
(
i
)))
=>
c
(
i
)
case
(
BlockGet
,
Seq
(
BlockV
(
_
,
_
,
c
),
BitsV
(
i
)))
=>
c
(
i
)
case
(
BlockSet
,
Seq
(
BlockV
(
_
,
_
,
c
),
BitsV
(
i
),
v
))
=>
c
(
i
)
=
v
;
BitsV
(
0
)
...
...
This diff is collapsed.
Click to expand it.
compiler/src/l3/CPSValueRepresenter.scala
+
3
−
3
View file @
a3a52ceb
...
...
@@ -90,7 +90,7 @@ object CPSValueRepresenter extends (H.Tree => L.Tree) {
def
iterate
(
fvMap
:
FVMap
)
:
FVMap
=
definedFuns
.
map
{
case
H
.
Fun
(
fName
,
_
,
fArgs
,
fBody
)
=>
val
newFv
=
(
fv
(
fBody
,
fvMap
-
fName
)
-
fName
)
--
fArgs
val
newFv
=
(
fv
(
fBody
,
fvMap
-
fName
))
--
fArgs
(
fName
,
newFv
)
}.
toMap
...
...
@@ -123,7 +123,7 @@ object CPSValueRepresenter extends (H.Tree => L.Tree) {
val
workers
=
initialFuns
map
{
case
H
.
Fun
(
fName
,
fRetC
,
fArgs
,
fBody
)
=>
val
(
wName
,
_
,
fvs
)
=
knownFuns
(
fName
)
val
us
=
fvs
.
map
(
f
=>
Symbol
.
fresh
(
"fv_"
+
f
.
name
))
val
wBody
=
substitute
(
apply
(
fBody
))((
fvs
zip
us
).
toMap
)
val
wBody
=
substitute
(
transform
(
fBody
)(
knownFuns
))((
fvs
zip
us
).
toMap
)
L
.
Fun
(
wName
,
fRetC
,
fArgs
++
us
,
wBody
)
}
...
...
@@ -136,7 +136,7 @@ object CPSValueRepresenter extends (H.Tree => L.Tree) {
val
sArgs
=
fArgs
map
(
f
=>
Symbol
.
fresh
(
"n_"
+
f
.
name
))
val
sBody
=
bindArguments
(
wName
,
sCntName
,
envName
,
fvs
,
1
,
sArgs
map
(
L
.
AtomN
(
_
)))
L
.
Fun
(
sName
,
sCntName
,
sArgs
,
sBody
)
L
.
Fun
(
sName
,
sCntName
,
envName
+:
sArgs
,
sBody
)
}
def
initFuns
(
funsAndVars
:
Seq
[(
Symbol
,
(
Worker
,
Wrapper
,
FreeVars
))],
lastBody
:
L.Tree
)
:
L.Tree
=
{
...
...
This diff is collapsed.
Click to expand it.
compiler/src/l3/Main.scala
+
3
−
1
View file @
a3a52ceb
...
...
@@ -21,8 +21,10 @@ object Main {
andThen
CPSInterpreterLow
)
val
todoargs
=
Seq
(
"../tests/stmt-defrec.l3"
)
val
basePath
=
Paths
.
get
(
"."
).
toAbsolutePath
Either
.
cond
(!
args
.
isEmpty
,
args
.
toIndexedSeq
,
"no input file given"
)
Either
.
cond
(!
todo
args
.
isEmpty
,
todo
args
.
toIndexedSeq
,
"no input file given"
)
.
flatMap
(
L3FileReader
.
readFilesExpandingModules
(
basePath
,
_
))
.
flatMap
(
p
=>
L3Parser
.
parse
(
p
.
_1
,
p
.
_2
))
.
flatMap
(
CL3NameAnalyzer
)
...
...
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