Skip to content

Commit 7b7df9d

Browse files
committed
Re-order switch case
1 parent 3c965cd commit 7b7df9d

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

src/vimscript/expression/evaluate.ts

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1009,7 +1009,9 @@ export class EvaluationContext {
10091009
return float(Math.exp(toFloat(x!)));
10101010
}
10111011
// TODO: extend/extendnew()
1012-
// TODO: filter
1012+
// TODO: filecopy()
1013+
// TODO: filereadable()/filewritable()
1014+
// TODO: filter()
10131015
case 'flatten':
10141016
case 'flattennew': {
10151017
const [l, _depth] = getArgs(1, 2);
@@ -1048,6 +1050,14 @@ export class EvaluationContext {
10481050
const [x] = getArgs(1);
10491051
return int(toFloat(x!));
10501052
}
1053+
case 'floor': {
1054+
const [x] = getArgs(1);
1055+
return float(Math.floor(toFloat(x!)));
1056+
}
1057+
case 'fmod': {
1058+
const [x, y] = getArgs(2);
1059+
return float(toFloat(x!) % toFloat(y!));
1060+
}
10511061
// TODO: fullcommand()
10521062
case 'function': {
10531063
const [name, arglist, dict] = getArgs(1, 3);
@@ -1076,14 +1086,6 @@ export class EvaluationContext {
10761086
// }
10771087
return funcref({ name: toString(name!), arglist, dict });
10781088
}
1079-
case 'floor': {
1080-
const [x] = getArgs(1);
1081-
return float(Math.floor(toFloat(x!)));
1082-
}
1083-
case 'fmod': {
1084-
const [x, y] = getArgs(2);
1085-
return float(toFloat(x!) % toFloat(y!));
1086-
}
10871089
// TODO: funcref()
10881090
case 'get': {
10891091
const [_haystack, _idx, _default] = getArgs(2, 3);

0 commit comments

Comments
 (0)