@abaplint/runtime 2.13.59 → 2.13.60

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -52,6 +52,7 @@ import { INumeric } from "../types/_numeric";
52
52
  import { ICallFunctionOptions } from "./call_function";
53
53
  import { SelectDatabaseOptions, SelectRuntimeOptions } from "../db/db";
54
54
  import { Trace } from "../trace";
55
+ import { ISkipOptions } from "./skip";
55
56
  export declare class Statements {
56
57
  append: typeof append;
57
58
  assert: typeof assert;
@@ -107,4 +108,5 @@ export declare class Statements {
107
108
  message(options: IMessageOptions): Promise<void>;
108
109
  readReport(name: ICharacter, options: Parameters<typeof readReport>[1]): Promise<void>;
109
110
  write(source: INumeric | ICharacter | FieldSymbol | string | number, options?: IWriteOptions): void;
111
+ skip(options?: ISkipOptions): void;
110
112
  }
@@ -53,6 +53,7 @@ const update_database_1 = require("./update_database");
53
53
  const write_1 = require("./write");
54
54
  const call_function_1 = require("./call_function");
55
55
  const trace_1 = require("../trace");
56
+ const skip_1 = require("./skip");
56
57
  // this is a class, as statements like SELECT needs access to the database object instance
57
58
  // and WRITE will access the Console
58
59
  class Statements {
@@ -139,6 +140,9 @@ class Statements {
139
140
  write(source, options) {
140
141
  return new write_1.WriteStatement(this.context).write(source, options);
141
142
  }
143
+ skip(options) {
144
+ return new skip_1.SkipStatement(this.context).skip(options);
145
+ }
142
146
  }
143
147
  exports.Statements = Statements;
144
148
  //# sourceMappingURL=index.js.map
@@ -0,0 +1,11 @@
1
+ import { Context } from "../context";
2
+ import { INumeric } from "../types/_numeric";
3
+ export interface ISkipOptions {
4
+ lines?: INumeric;
5
+ toLine?: INumeric;
6
+ }
7
+ export declare class SkipStatement {
8
+ private readonly context;
9
+ constructor(context: Context);
10
+ skip(options?: ISkipOptions): void;
11
+ }
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SkipStatement = void 0;
4
+ class SkipStatement {
5
+ context;
6
+ constructor(context) {
7
+ this.context = context;
8
+ }
9
+ skip(options) {
10
+ let lines = options?.lines?.get() ?? 1;
11
+ if (options?.toLine !== undefined) {
12
+ const currentLine = this.context.console.get().split("\n").length;
13
+ lines = options.toLine.get() - currentLine;
14
+ }
15
+ lines = Math.max(0, Math.trunc(lines));
16
+ if (lines > 0) {
17
+ this.context.console.add("\n".repeat(lines));
18
+ }
19
+ }
20
+ }
21
+ exports.SkipStatement = SkipStatement;
22
+ //# sourceMappingURL=skip.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/runtime",
3
- "version": "2.13.59",
3
+ "version": "2.13.60",
4
4
  "description": "Transpiler - Runtime",
5
5
  "main": "build/src/index.js",
6
6
  "typings": "build/src/index.d.ts",