diff --git a/libs/microbit/core.cpp b/libs/microbit/core.cpp index 39a2db37..e4a36350 100644 --- a/libs/microbit/core.cpp +++ b/libs/microbit/core.cpp @@ -72,7 +72,7 @@ namespace BooleanMethods { bool bang(bool v) { return !v; } } -namespace String { +namespace String_ { /** * Make a string from the given ASCII character code. */ @@ -129,7 +129,7 @@ namespace NumberImpl { int mod(int x, int y) { return x % y; } } -namespace Math { +namespace Math_ { /** * Returns the value of a base expression taken to a specified power. * @param x The base value of the expression. @@ -226,22 +226,6 @@ namespace kindscript { void *ptrOfLiteral(int offset); } -namespace RecordImpl { - //% - RefRecord* mk(int reflen, int totallen) - { - check(0 <= reflen && reflen <= totallen, ERR_SIZE, 1); - check(reflen <= totallen && totallen <= 255, ERR_SIZE, 2); - - void *ptr = ::operator new(sizeof(RefRecord) + totallen * sizeof(uint32_t)); - RefRecord *r = new (ptr) RefRecord(); - r->len = totallen; - r->reflen = reflen; - memset(r->fields, 0, r->len * sizeof(uint32_t)); - return r; - } -} - namespace ksrt { //% uint32_t ldloc(RefLocal *r) { diff --git a/libs/microbit/core.d.ts b/libs/microbit/core.d.ts index 07a1492f..916a781c 100644 --- a/libs/microbit/core.d.ts +++ b/libs/microbit/core.d.ts @@ -86,7 +86,7 @@ interface String { * Converts A string to an integer. * @param s A string to convert into a number. */ - //% shim=String::toNumber + //% shim=String_::toNumber declare function parseInt(s: string): number; interface Object {} diff --git a/libs/microbit/shims.d.ts b/libs/microbit/shims.d.ts index 0852cea2..c48f7dc2 100644 --- a/libs/microbit/shims.d.ts +++ b/libs/microbit/shims.d.ts @@ -48,7 +48,7 @@ declare namespace String { /** * Make a string from the given ASCII character code. */ - //% shim=String::fromCharCode + //% shim=String_::fromCharCode function fromCharCode(code: number): string; } @@ -67,20 +67,20 @@ declare namespace Math { * @param x The base value of the expression. * @param y The exponent value of the expression. */ - //% shim=Math::pow + //% shim=Math_::pow function pow(x: number, y: number): number; /** * Returns a pseudorandom number between 0 and `max`. */ - //% shim=Math::random + //% shim=Math_::random function random(max: number): number; /** * Returns the square root of a number. * @param x A numeric expression. */ - //% shim=Math::sqrt + //% shim=Math_::sqrt function sqrt(x: number): number; }