Skip to content

Commit

Permalink
Merge pull request #6715 from roc-lang/update-glue-syntax
Browse files Browse the repository at this point in the history
Update glue platform files to new syntax
  • Loading branch information
Anton-4 authored May 6, 2024
2 parents 5984e4c + ddccf8f commit 128f396
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 16 deletions.
4 changes: 1 addition & 3 deletions crates/glue/platform/File.roc
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
interface File
exposes [File]
imports []
module [File]

File : { name : Str, content : Str }
6 changes: 3 additions & 3 deletions crates/glue/platform/Shape.roc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
interface Shape
exposes [Shape, RocNum, RocTagUnion, RocStructFields, RocFn, RocSingleTagPayload]
imports [TypeId.{ TypeId }]
module [Shape, RocNum, RocTagUnion, RocStructFields, RocFn, RocSingleTagPayload]

import TypeId exposing [TypeId]

Shape : [
RocStr,
Expand Down
4 changes: 1 addition & 3 deletions crates/glue/platform/Target.roc
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
interface Target
exposes [Target, Architecture, OperatingSystem]
imports []
module [Target, Architecture, OperatingSystem]

Target : {
architecture : Architecture,
Expand Down
4 changes: 1 addition & 3 deletions crates/glue/platform/TypeId.roc
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
interface TypeId
exposes [TypeId, typeIDfromU64, typeIDtoU64]
imports []
module [TypeId, typeIDfromU64, typeIDtoU64]

TypeId := U64 implements [Eq, Hash, Inspect, Encoding]

Expand Down
11 changes: 7 additions & 4 deletions crates/glue/platform/Types.roc
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
interface Types
exposes [Types, shape, size, alignment, target, walkShapes, entryPoints]
imports [Shape.{ Shape }, TypeId.{ TypeId, typeIDfromU64, typeIDtoU64 }, Target.{ Target }]
module [Types, shape, size, alignment, target, walkShapes, entryPoints]

import Shape exposing [Shape]
import TypeId exposing [TypeId, typeIDfromU64, typeIDtoU64]
import Target exposing [Target]

# TODO: switch AssocList uses to Dict once roc_std is updated.
Tuple1 : [T Str TypeId]
Expand All @@ -23,7 +25,8 @@ Types := {
## Names and types of the entry points of the program (e.g. mainForHost)
entrypoints : List Tuple1,
target : Target,
} implements [Inspect, Encoding]
}
implements [Inspect, Encoding]

target : Types -> Target
target = \@Types types -> types.target
Expand Down

0 comments on commit 128f396

Please sign in to comment.