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

Commit a2bae4a

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

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
@@ -2,7 +2,7 @@ export enum Prec {
22
SubtractionType = -1,
33
UnionType = 0,
44
Assignment = 1,
5-
TypeHint = 1,
5+
TypeHint = 0,
66
CurriedType = 1,
77
NamedInfixApplication = 1,
88
SectionIdentifier = 1,

common/terms.ts

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

476476
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
@@ -1028,15 +1028,22 @@ type GreaterThan<T>(x :: T) = [y :: T | y > x]
10281028
type hint
10291029
==================
10301030

1031-
'string' as String
1031+
'string' :: String
1032+
x :: Promise<Number>
10321033

10331034
---
10341035

10351036
(program
10361037
term: (type_hint
10371038
value: (string)
10381039
type: (parametric_type
1039-
name: (type))))
1040+
name: (type)))
1041+
term: (type_hint
1042+
value: (identifier)
1043+
type: (parametric_type
1044+
name: (type)
1045+
argument: (parametric_type
1046+
name: (type)))))
10401047

10411048
==================
10421049
hole

0 commit comments

Comments
 (0)