Skip to content

Commit 8f5be29

Browse files
committed
use array
1 parent 1834468 commit 8f5be29

6 files changed

Lines changed: 17 additions & 17 deletions

File tree

matching/matching.mbt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -226,8 +226,8 @@ fn structural_match(
226226

227227
///|
228228
fn match_children(
229-
pattern : FixedArray[(String?, @untyped_ast.Node)],
230-
candidate : FixedArray[(String?, @untyped_ast.Node)],
229+
pattern : Array[(String?, @untyped_ast.Node)],
230+
candidate : Array[(String?, @untyped_ast.Node)],
231231
compiled : CompiledExprPattern,
232232
bindings : @hashmap.HashMap[String, BoundValue],
233233
) -> Bool {
@@ -498,8 +498,8 @@ fn node_equal_ignoring_loc(
498498

499499
///|
500500
fn children_equal_ignoring_loc(
501-
left : FixedArray[(String?, @untyped_ast.Node)],
502-
right : FixedArray[(String?, @untyped_ast.Node)],
501+
left : Array[(String?, @untyped_ast.Node)],
502+
right : Array[(String?, @untyped_ast.Node)],
503503
) -> Bool {
504504
left.length() == right.length() &&
505505
({

query/cstyle_simple_forloop_test.mbt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ test "query can emulate cstyle forward simple forloop patterns-not by iterating
4444
#| start: { fname: "sample.mbt", lnum: 2, bol: 12, cnum: 18 },
4545
#| end: { fname: "sample.mbt", lnum: 2, bol: 12, cnum: 19 },
4646
#| },
47-
#| children: <FixedArray: []>,
47+
#| children: [],
4848
#|}
4949
),
5050
)
@@ -57,7 +57,7 @@ test "query can emulate cstyle forward simple forloop patterns-not by iterating
5757
#| start: { fname: "sample.mbt", lnum: 8, bol: 121, cnum: 127 },
5858
#| end: { fname: "sample.mbt", lnum: 8, bol: 121, cnum: 128 },
5959
#| },
60-
#| children: <FixedArray: []>,
60+
#| children: [],
6161
#|}
6262
),
6363
)

untyped_ast/convert.mbt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ fn node(
99
let (name, value) = child
1010
converted.push((Some(name), value))
1111
})
12-
{ kind, loc, children: FixedArray::from_array(converted) }
12+
{ kind, loc, children: converted }
1313
}
1414

1515
///|
@@ -65,10 +65,10 @@ fn[T] option_value(opt : T?, f : (T) -> Node) -> Node {
6565
fn[T] list_children(
6666
list : @list.List[T],
6767
f : (T) -> Node,
68-
) -> FixedArray[(String?, Node)] {
68+
) -> Array[(String?, Node)] {
6969
let values : Array[(String?, Node)] = []
7070
list.each(fn(item) { values.push((None, f(item))) })
71-
FixedArray::from_array(values)
71+
values
7272
}
7373

7474
///|

untyped_ast/pkg.generated.mbti

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ pub fn visit_node_scoped_exprs(Node, (ScopedNodeExpr) -> NodeVisitAction) -> Uni
3535
pub(all) struct Node {
3636
kind : NodeKind
3737
loc : @basic.Location
38-
children : FixedArray[(String?, Node)]
38+
children : Array[(String?, Node)]
3939
} derive(@debug.Debug)
4040
pub fn Node::contains_unshadowed(Self, id~ : String) -> Bool
4141
pub fn Node::normalized_binder_name(Self) -> String?

untyped_ast/types.mbt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -686,7 +686,7 @@ pub fn NodeKind::to_string(self : NodeKind) -> String {
686686
pub(all) struct Node {
687687
kind : NodeKind
688688
loc : @basic.Location
689-
children : FixedArray[(String?, Node)]
689+
children : Array[(String?, Node)]
690690
} derive(Debug)
691691

692692
///|
@@ -706,7 +706,7 @@ pub fn Node::to_json(self : Node) -> Json {
706706
fn fields_node_to_json(
707707
kind : NodeKind,
708708
loc : @basic.Location,
709-
fields : FixedArray[(String?, Node)],
709+
fields : Array[(String?, Node)],
710710
) -> Json {
711711
let children : Map[String, Json] = {}
712712
fields.each(fn(field) {
@@ -722,7 +722,7 @@ fn fields_node_to_json(
722722
fn items_node_to_json(
723723
kind : NodeKind,
724724
loc : @basic.Location,
725-
items : FixedArray[(String?, Node)],
725+
items : Array[(String?, Node)],
726726
) -> Json {
727727
let children : Array[Json] = []
728728
items.each(fn(item) {

untyped_ast/untyped_ast_test.mbt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -301,22 +301,22 @@ test "node normalized identifier methods reject unexpected shapes" {
301301
let malformed_long_ident : Node = {
302302
kind: LongIdent_Ident,
303303
loc: test_loc(),
304-
children: FixedArray::from_array([(Some("value"), wrong)]),
304+
children: [(Some("value"), wrong)],
305305
}
306306
let malformed_var : Node = {
307307
kind: Var,
308308
loc: test_loc(),
309-
children: FixedArray::from_array([(Some("name"), malformed_long_ident)]),
309+
children: [(Some("name"), malformed_long_ident)],
310310
}
311311
let malformed_binder : Node = {
312312
kind: Binder,
313313
loc: test_loc(),
314-
children: FixedArray::from_array([(Some("name"), wrong)]),
314+
children: [(Some("name"), wrong)],
315315
}
316316
let malformed_label : Node = {
317317
kind: Label,
318318
loc: test_loc(),
319-
children: FixedArray::from_array([(Some("name"), wrong)]),
319+
children: [(Some("name"), wrong)],
320320
}
321321

322322
debug_inspect(wrong.normalized_long_ident(), content="None")

0 commit comments

Comments
 (0)