Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
libcloogle
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Cloogle
libcloogle
Commits
ffd6cfa0
Verified
Commit
ffd6cfa0
authored
Apr 29, 2018
by
Camil Staps
🚀
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add ABC types for A and B stack offsets
parent
e45bb044
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
13 deletions
+19
-13
Cloogle.dcl
Cloogle.dcl
+2
-0
Cloogle.icl
Cloogle.icl
+17
-13
No files found.
Cloogle.dcl
View file @
ffd6cfa0
...
...
@@ -223,6 +223,8 @@ from Text.GenJSON import generic JSONEncode, generic JSONDecode, :: JSONNode
::
ABCArgumentType
=
ABCTypeLabel
|
ABCTypeAStackOffset
|
ABCTypeBStackOffset
|
ABCTypeBool
|
ABCTypeChar
|
ABCTypeInt
...
...
Cloogle.icl
View file @
ffd6cfa0
...
...
@@ -34,12 +34,14 @@ derive gEq FunctionKind
JSONEncode
{|
ABCArgument
|}
_
(
ABCArgument
t
r
)
=
[
JSONString
(
if
r
(
"["
<+
type
<+
"]"
)
type
)]
where
type
=
case
t
of
ABCTypeLabel
->
"label"
ABCTypeBool
->
"bool"
ABCTypeChar
->
"char"
ABCTypeInt
->
"int"
ABCTypeReal
->
"real"
ABCTypeString
->
"string"
ABCTypeLabel
->
"label"
ABCTypeAStackOffset
->
"A-offset"
ABCTypeBStackOffset
->
"B-offset"
ABCTypeBool
->
"bool"
ABCTypeChar
->
"char"
ABCTypeInt
->
"int"
ABCTypeReal
->
"real"
ABCTypeString
->
"string"
JSONDecode
{|
ABCArgument
|}
_
[
JSONString
s
:
r
]
|
size
s
>
0
&&
s
.[
0
]
==
'['
&&
s
.[
size
s
-1
]
==
']'
...
...
@@ -47,13 +49,15 @@ JSONDecode{|ABCArgument|} _ [JSONString s:r]
=
(
flip
ABCArgument
False
<$>
fromString
s
,
r
)
where
fromString
s
=
case
s
of
"label"
->
Just
ABCTypeLabel
"bool"
->
Just
ABCTypeBool
"char"
->
Just
ABCTypeChar
"int"
->
Just
ABCTypeInt
"real"
->
Just
ABCTypeReal
"string"
->
Just
ABCTypeString
_
->
Nothing
"label"
->
Just
ABCTypeLabel
"A-offset"
->
Just
ABCTypeAStackOffset
"B-offset"
->
Just
ABCTypeBStackOffset
"bool"
->
Just
ABCTypeBool
"char"
->
Just
ABCTypeChar
"int"
->
Just
ABCTypeInt
"real"
->
Just
ABCTypeReal
"string"
->
Just
ABCTypeString
_
->
Nothing
JSONDecode
{|
ABCArgument
|}
_
json
=
(
Nothing
,
json
)
instance
toInt
CloogleError
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment