Skip to content

Commit

Permalink
fix(spec): Fix duplicate definitions
Browse files Browse the repository at this point in the history
Rename some rules for the builtin statement to avoid ambiguity.
  • Loading branch information
pierwill committed Sep 11, 2022
1 parent 9d0d3f1 commit c7a1787
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions docs/SPEC.md
Original file line number Diff line number Diff line change
Expand Up @@ -1173,19 +1173,19 @@ All such values must have a corresponding builtin statement to declare the exist
BuiltinStatement = "builtin" identifer ":" TypeExpression .
TypeExpression = MonoType ["where" Constraints] .

MonoType = Tvar | Basic | Array | Record | Function .
Tvar = "A" … "Z" .
Basic = "int" | "uint" | "float" | "string" | "bool" | "time" | "duration" | "bytes" | "regexp" .
Array = "[" MonoType "]" .
Record = ( "{" [Properties] "}" ) | ( "{" Tvar "with" Properties "}" ) .
Function = "(" [Parameters] ")" "=>" MonoType .

Properties = Property { "," Property } .
Property = Label ":" MonoType .
Label = identifier | string_lit

Parameters = Parameter { "," Parameter } .
Parameter = [ "<-" | "?" ] identifier ":" MonoType .
MonoType = Tvar | BasicType | ArrayType | RecordType | FunctionType .
Tvar = "A" … "Z" .
BasicType = "int" | "uint" | "float" | "string" | "bool" | "time" | "duration" | "bytes" | "regexp" .
ArrayType = "[" MonoType "]" .
RecordType = ( "{" [RecordTypeProperties] "}" ) | ( "{" Tvar "with" RecordTypeProperties "}" ) .
FunctionType = "(" [FunctionTypeParameters] ")" "=>" MonoType .

RecordTypeProperties = RecordTypeProperty { "," RecordTypeProperty } .
RecordTypeProperty = Label ":" MonoType .
Label = identifier | string_lit

FunctionTypeParameters = FunctionTypeParameter { "," FunctionTypeParameter } .
FunctionTypeParameter = [ "<-" | "?" ] identifier ":" MonoType .

Constraints = Constraint { "," Constraint } .
Constraint = Tvar ":" Kinds .
Expand Down

0 comments on commit c7a1787

Please sign in to comment.