+}
+
+/**
+* @description repeating matching function `f`
+* zero or more times, like the asterisk `*` in regex `f*` .
+* @param f : the function to be repeated 0+ times.
+* @returns:the combined function
+*/
+export function OnceOrMoreDo(f: Function): (x: TokenMatcheePair) =>
+ tk.Maybe<TokenMatcheePair> {
+ return (x) => {
+ var wrappedOldX: tk.Maybe<TokenMatcheePair> = { _tag: "Some", value: x };
+ var wrappedNewX: tk.Maybe<TokenMatcheePair> = wrappedOldX;
+
+ var counter = -1;
+
+ while (wrappedNewX._tag != "None") {
+ wrappedOldX = wrappedNewX;
+ wrappedNewX = thenDo(wrappedOldX, f);
+ counter += 1;
+
+ };
+
+
+ if (counter <= 0){
+ return { _tag: "None"};
+ }
+ let ast = wrappedOldX.value.ast ;
+ wrappedOldX.value.ast =ast.slice(ast.length-counter);
+ console.log(repr(wrappedOldX.value.ast));
+
+ return wrappedOldX; };