From 43543cf9c205bfeb60f3dc50f01e1460e47a2b26 Mon Sep 17 00:00:00 2001 From: Richard Knoll Date: Tue, 23 Oct 2018 15:57:15 -0700 Subject: [PATCH] Adding a regex for upgrading Math.random() (#1503) * Adding a regex for upgrading Math.random() * Simpler regex * Trailing whitespace --- pxtarget.json | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/pxtarget.json b/pxtarget.json index e32d27db..b2da1a3b 100644 --- a/pxtarget.json +++ b/pxtarget.json @@ -63,12 +63,13 @@ { "type": "api", "map": { - "bluetooth\\s*\\.uartRead\\s*\\((.*?)\\)": "bluetooth.uartReadUntil($1)", - "bluetooth\\s*\\.uartWrite\\s*\\((.*?)\\)": "bluetooth.uartWriteUntil($1)", - "input\\s*\\.calibrate\\s*\\(": "input.calibrateCompass(", - "radio\\s*\\.onDataPacketReceived\\(\\s*\\(\\{\\s*receivedNumber\\s*\\}\\)\\s*=>\\s*\\{": "radio.onReceivedNumber(function (receivedNumber) {", - "radio\\s*\\.onDataPacketReceived\\(\\s*\\(\\{\\s*receivedString: name, receivedNumber: value\\s*\\}\\)\\s*=>\\s*\\{": "radio.onReceivedValue(function (name, value) {", - "radio\\s*\\.onDataPacketReceived\\(\\s*\\(\\{\\s*receivedString\\s*\\}\\)\\s*=>\\s*\\{": "radio.onReceivedString(function (receivedString) {" + "bluetooth\\s*\\.\\s*uartRead\\s*\\((.*?)\\)": "bluetooth.uartReadUntil($1)", + "bluetooth\\s*\\.\\s*uartWrite\\s*\\((.*?)\\)": "bluetooth.uartWriteUntil($1)", + "input\\s*\\.\\s*calibrate\\s*\\(": "input.calibrateCompass(", + "radio\\s*\\.\\s*onDataPacketReceived\\(\\s*\\(\\{\\s*receivedNumber\\s*\\}\\)\\s*=>\\s*\\{": "radio.onReceivedNumber(function (receivedNumber) {", + "radio\\s*\\.\\s*onDataPacketReceived\\(\\s*\\(\\{\\s*receivedString: name, receivedNumber: value\\s*\\}\\)\\s*=>\\s*\\{": "radio.onReceivedValue(function (name, value) {", + "radio\\s*\\.\\s*onDataPacketReceived\\(\\s*\\(\\{\\s*receivedString\\s*\\}\\)\\s*=>\\s*\\{": "radio.onReceivedString(function (receivedString) {", + "Math\\s*\\.\\s*random\\s*\\(": "Math.randomRange(0, " } }, {