Skip to content
This repository was archived by the owner on Jun 1, 2022. It is now read-only.

Commit d3d73fc

Browse files
committed
[#565] Change type hint operator from as to ::
1 parent ac889de commit d3d73fc

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed

common/enums.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ export enum Prec {
33
SubtractionType = -1,
44
UnionType = 0,
55
Assignment = 1,
6-
TypeHint = 1,
6+
TypeHint = 0,
77
CurriedType = 1,
88
NamedInfixApplication = 1,
99
SectionIdentifier = 1,

common/terms.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -472,7 +472,7 @@ export const type_hint = <RuleName extends string>(
472472
) =>
473473
prec.left(
474474
Prec.TypeHint,
475-
seq(field('value', $._term), 'as', field('type', $._type)),
475+
seq(field('value', $._term), '::', field('type', $._type)),
476476
)
477477

478478
export const hole = <RuleName extends string>($: GrammarSymbols<RuleName>) =>

tony/corpus/terms.txt

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1084,15 +1084,22 @@ type GreaterThan<T>(x :: T) = [y :: T | y > x]
10841084
type hint
10851085
==================
10861086

1087-
'string' as String
1087+
'string' :: String
1088+
x :: Promise<Number>
10881089

10891090
---
10901091

10911092
(program
10921093
term: (type_hint
10931094
value: (string)
10941095
type: (parametric_type
1095-
name: (type))))
1096+
name: (type)))
1097+
term: (type_hint
1098+
value: (identifier)
1099+
type: (parametric_type
1100+
name: (type)
1101+
argument: (parametric_type
1102+
name: (type)))))
10961103

10971104
==================
10981105
hole

0 commit comments

Comments
 (0)