Skip to content

Commit

Permalink
2.1.61, CREATE DATA, additional types (#869)
Browse files Browse the repository at this point in the history
  • Loading branch information
larshp committed Sep 11, 2022
1 parent 42594bd commit c067b94
Show file tree
Hide file tree
Showing 7 changed files with 42 additions and 18 deletions.
18 changes: 9 additions & 9 deletions packages/cli/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions packages/cli/package.json
@@ -1,6 +1,6 @@
{
"name": "@abaplint/transpiler-cli",
"version": "2.1.60",
"version": "2.1.61",
"description": "Transpiler - Command Line Interface",
"bin": {
"abap_transpile": "./abap_transpile"
Expand All @@ -25,7 +25,7 @@
"author": "abaplint",
"license": "MIT",
"devDependencies": {
"@abaplint/transpiler": "^2.1.60",
"@abaplint/transpiler": "^2.1.61",
"@types/glob": "^7.2.0",
"glob": "=7.2.0",
"@types/progress": "^2.0.5",
Expand Down
4 changes: 2 additions & 2 deletions packages/runtime/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/runtime/package.json
@@ -1,6 +1,6 @@
{
"name": "@abaplint/runtime",
"version": "2.1.60",
"version": "2.1.61",
"description": "Transpiler - Runtime",
"main": "build/src/index.js",
"typings": "build/src/index.d.ts",
Expand Down
26 changes: 25 additions & 1 deletion packages/runtime/src/statements/create_data.ts
@@ -1,5 +1,5 @@
import {clone} from "../clone";
import {ABAPObject, Character, DataReference, Date, FieldSymbol, Float, Integer, Structure, Table, Time} from "../types";
import {ABAPObject, Character, DataReference, Date, String, FieldSymbol, Float, Integer, Structure, Table, Time, XString, Hex, Packed} from "../types";
import {ICharacter} from "../types/_character";
import {INumeric} from "../types/_numeric";

Expand Down Expand Up @@ -53,6 +53,24 @@ export function createData(target: DataReference, options?: ICreateDataOptions)
target.assign(new Character({length: length}));
}
break;
case "X":
{
let length = 1;
if (options.length) {
length = options.length.get();
}
target.assign(new Hex({length: length}));
}
break;
case "P":
{
let length = 1;
if (options.length) {
length = options.length.get();
}
target.assign(new Packed({length: length}));
}
break;
case "F":
target.assign(new Float());
break;
Expand All @@ -65,6 +83,12 @@ export function createData(target: DataReference, options?: ICreateDataOptions)
case "I":
target.assign(new Integer());
break;
case "STRING":
target.assign(new String());
break;
case "XSTRING":
target.assign(new XString());
break;
default:
throw "CREATE DATA, unknown type " + options.typeName;
}
Expand Down
4 changes: 2 additions & 2 deletions packages/transpiler/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/transpiler/package.json
@@ -1,6 +1,6 @@
{
"name": "@abaplint/transpiler",
"version": "2.1.60",
"version": "2.1.61",
"description": "Transpiler",
"main": "build/src/index.js",
"typings": "build/src/index.d.ts",
Expand Down

0 comments on commit c067b94

Please sign in to comment.