feat(Parser): implement Parser
Add a simple parser implementation that supports only field reads.
This commit is contained in:
@ -39,6 +39,9 @@ class ListWrapper {
|
||||
static forEach(list, fn) {
|
||||
list.forEach(fn);
|
||||
}
|
||||
static reduce(List list, Function fn, init) {
|
||||
return list.fold(init, fn);
|
||||
}
|
||||
static first(List list) => list.first;
|
||||
static last(List list) => list.last;
|
||||
static List reversed(List list) => list.reversed.toList();
|
||||
|
@ -60,6 +60,9 @@ export class ListWrapper {
|
||||
}
|
||||
return null;
|
||||
}
|
||||
static reduce(list:List, fn:Function, init) {
|
||||
return list.reduce(fn, init);
|
||||
}
|
||||
static filter(array, pred:Function) {
|
||||
return array.filter(pred);
|
||||
}
|
||||
|
Reference in New Issue
Block a user