Add associative map constraints and range refinement
This commit is contained in:
@@ -182,3 +182,31 @@ Array constraints
|
||||
left: (identifier)
|
||||
right: (comparison_constraint
|
||||
value: (integer))))))))
|
||||
|
||||
==================
|
||||
Map constraint and ascription
|
||||
==================
|
||||
{
|
||||
services = {
|
||||
api = { port = 8080; };
|
||||
} as {...{ port = Int; }};
|
||||
}
|
||||
---
|
||||
|
||||
(source_file
|
||||
(object
|
||||
(field_definition
|
||||
path: (field_path (identifier))
|
||||
value: (as_expression
|
||||
narrower: (object
|
||||
(field_definition
|
||||
path: (field_path (identifier))
|
||||
value: (object
|
||||
(field_definition
|
||||
path: (field_path (identifier))
|
||||
value: (literal (integer))))))
|
||||
wider: (map_constraint
|
||||
value: (object
|
||||
(field_definition
|
||||
path: (field_path (identifier))
|
||||
value: (identifier))))))))
|
||||
|
||||
Reference in New Issue
Block a user