mirror of
https://github.com/google/blockly.git
synced 2026-01-04 23:50:12 +01:00
* fix(generators): Changes to exports and access controls for TypeScript compatibility (#7295) * fix(generators): Add missing declarations for Order enums * chore(generators): Remove spurious whitespace * fix(generators): Make provideFunction_ etc. public Remove the protected declaration on provideFunction_ and FUNCTION_NAME_PLACEHOLDER_ so they can be used from generator functions written in TypeScript. Not strictly part of #7283, but closely related and required to fixing the related issue google/blockly-samples#1785. * chore(generators): format (cherry picked from commitd503fbb409) * fix: Correct errors in `HSV_SATURATION`, `HSV_VALUE` accessors (#7297) * fix: Correct errors in HSV_SATURATION, HSV_VALUE accessors Fix the comment / message errors noted in https://github.com/google/blockly/pull/7249#issuecomment-1638645810 * chore: Add renamings for HSV_SATURATION, HSV_VALUE (cherry picked from commit1bc4f67d78) * release: Update version number to 10.0.2 --------- Co-authored-by: Christopher Allen <cpcallen+git@google.com>
This commit is contained in:
committed by
GitHub
parent
20423346b8
commit
e06aa02e54
@@ -49,7 +49,7 @@ export class CodeGenerator {
|
|||||||
* legitimately appear in a function definition (or comment), and it must
|
* legitimately appear in a function definition (or comment), and it must
|
||||||
* not confuse the regular expression parser.
|
* not confuse the regular expression parser.
|
||||||
*/
|
*/
|
||||||
protected FUNCTION_NAME_PLACEHOLDER_ = '{leCUI8hutHZI4480Dc}';
|
FUNCTION_NAME_PLACEHOLDER_ = '{leCUI8hutHZI4480Dc}';
|
||||||
FUNCTION_NAME_PLACEHOLDER_REGEXP_: RegExp;
|
FUNCTION_NAME_PLACEHOLDER_REGEXP_: RegExp;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -471,10 +471,7 @@ export class CodeGenerator {
|
|||||||
* @returns The actual name of the new function. This may differ from
|
* @returns The actual name of the new function. This may differ from
|
||||||
* desiredName if the former has already been taken by the user.
|
* desiredName if the former has already been taken by the user.
|
||||||
*/
|
*/
|
||||||
protected provideFunction_(
|
provideFunction_(desiredName: string, code: string[] | string): string {
|
||||||
desiredName: string,
|
|
||||||
code: string[] | string
|
|
||||||
): string {
|
|
||||||
if (!this.definitions_[desiredName]) {
|
if (!this.definitions_[desiredName]) {
|
||||||
const functionName = this.nameDB_!.getDistinctName(
|
const functionName = this.nameDB_!.getDistinctName(
|
||||||
desiredName,
|
desiredName,
|
||||||
|
|||||||
14
core/main.js
14
core/main.js
@@ -32,8 +32,8 @@ Object.defineProperties(Blockly, {
|
|||||||
* Must be in the range of 0 (inclusive) to 1 (exclusive).
|
* Must be in the range of 0 (inclusive) to 1 (exclusive).
|
||||||
* @name Blockly.HSV_SATURATION
|
* @name Blockly.HSV_SATURATION
|
||||||
* @type {number}
|
* @type {number}
|
||||||
* @deprecated Use Blockly.colour.getHsvSaturation() / .setHsvSaturation(
|
* @deprecated Use Blockly.utils.colour.getHsvSaturation() /
|
||||||
* instead. (July 2023)
|
* .setHsvSaturation() instead. (July 2023)
|
||||||
* @suppress {checkTypes}
|
* @suppress {checkTypes}
|
||||||
*/
|
*/
|
||||||
HSV_SATURATION: {
|
HSV_SATURATION: {
|
||||||
@@ -42,7 +42,7 @@ Object.defineProperties(Blockly, {
|
|||||||
'Blockly.HSV_SATURATION',
|
'Blockly.HSV_SATURATION',
|
||||||
'version 10',
|
'version 10',
|
||||||
'version 11',
|
'version 11',
|
||||||
'Blockly.colour.getHsvSaturation()'
|
'Blockly.utils.colour.getHsvSaturation()'
|
||||||
);
|
);
|
||||||
return colour.getHsvSaturation();
|
return colour.getHsvSaturation();
|
||||||
},
|
},
|
||||||
@@ -51,7 +51,7 @@ Object.defineProperties(Blockly, {
|
|||||||
'Blockly.HSV_SATURATION',
|
'Blockly.HSV_SATURATION',
|
||||||
'version 10',
|
'version 10',
|
||||||
'version 11',
|
'version 11',
|
||||||
'Blockly.colour.setHsvSaturation()'
|
'Blockly.utils.colour.setHsvSaturation()'
|
||||||
);
|
);
|
||||||
colour.setHsvSaturation(newValue);
|
colour.setHsvSaturation(newValue);
|
||||||
},
|
},
|
||||||
@@ -61,7 +61,7 @@ Object.defineProperties(Blockly, {
|
|||||||
* Must be in the range of 0 (inclusive) to 1 (exclusive).
|
* Must be in the range of 0 (inclusive) to 1 (exclusive).
|
||||||
* @name Blockly.HSV_VALUE
|
* @name Blockly.HSV_VALUE
|
||||||
* @type {number}
|
* @type {number}
|
||||||
* @deprecated Use Blockly.colour.getHsvValue() / .setHsvValue instead.
|
* @deprecated Use Blockly.utils.colour.getHsvValue() / .setHsvValue instead.
|
||||||
* (July 2023)
|
* (July 2023)
|
||||||
* @suppress {checkTypes}
|
* @suppress {checkTypes}
|
||||||
*/
|
*/
|
||||||
@@ -71,7 +71,7 @@ Object.defineProperties(Blockly, {
|
|||||||
'Blockly.HSV_VALUE',
|
'Blockly.HSV_VALUE',
|
||||||
'version 10',
|
'version 10',
|
||||||
'version 11',
|
'version 11',
|
||||||
'Blockly.colour.getHsvValue()'
|
'Blockly.utils.colour.getHsvValue()'
|
||||||
);
|
);
|
||||||
return colour.getHsvValue();
|
return colour.getHsvValue();
|
||||||
},
|
},
|
||||||
@@ -80,7 +80,7 @@ Object.defineProperties(Blockly, {
|
|||||||
'Blockly.HSV_VALUE',
|
'Blockly.HSV_VALUE',
|
||||||
'version 10',
|
'version 10',
|
||||||
'version 11',
|
'version 11',
|
||||||
'Blockly.colour.setHsvValue()'
|
'Blockly.utils.colour.setHsvValue()'
|
||||||
);
|
);
|
||||||
colour.setHsvValue(newValue);
|
colour.setHsvValue(newValue);
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ export class PythonGenerator extends CodeGenerator {
|
|||||||
// (foo.bar)() -> foo.bar()
|
// (foo.bar)() -> foo.bar()
|
||||||
// (foo[0])() -> foo[0]()
|
// (foo[0])() -> foo[0]()
|
||||||
[Order.MEMBER, Order.FUNCTION_CALL],
|
[Order.MEMBER, Order.FUNCTION_CALL],
|
||||||
|
|
||||||
// not (not foo) -> not not foo
|
// not (not foo) -> not not foo
|
||||||
[Order.LOGICAL_NOT, Order.LOGICAL_NOT],
|
[Order.LOGICAL_NOT, Order.LOGICAL_NOT],
|
||||||
// a and (b and c) -> a and b and c
|
// a and (b and c) -> a and b and c
|
||||||
@@ -80,7 +80,7 @@ export class PythonGenerator extends CodeGenerator {
|
|||||||
// a or (b or c) -> a or b or c
|
// a or (b or c) -> a or b or c
|
||||||
[Order.LOGICAL_OR, Order.LOGICAL_OR]
|
[Order.LOGICAL_OR, Order.LOGICAL_OR]
|
||||||
];
|
];
|
||||||
|
|
||||||
constructor(name) {
|
constructor(name) {
|
||||||
super(name ?? 'Python');
|
super(name ?? 'Python');
|
||||||
this.isInitialized = false;
|
this.isInitialized = false;
|
||||||
@@ -143,7 +143,7 @@ export class PythonGenerator extends CodeGenerator {
|
|||||||
'vars,xrange,zip'
|
'vars,xrange,zip'
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initialise the database of variable names.
|
* Initialise the database of variable names.
|
||||||
* @param {!Workspace} workspace Workspace to generate code from.
|
* @param {!Workspace} workspace Workspace to generate code from.
|
||||||
@@ -151,22 +151,22 @@ export class PythonGenerator extends CodeGenerator {
|
|||||||
*/
|
*/
|
||||||
init(workspace) {
|
init(workspace) {
|
||||||
super.init(workspace);
|
super.init(workspace);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Empty loops or conditionals are not allowed in Python.
|
* Empty loops or conditionals are not allowed in Python.
|
||||||
*/
|
*/
|
||||||
this.PASS = this.INDENT + 'pass\n';
|
this.PASS = this.INDENT + 'pass\n';
|
||||||
|
|
||||||
if (!this.nameDB_) {
|
if (!this.nameDB_) {
|
||||||
this.nameDB_ = new Names(this.RESERVED_WORDS_);
|
this.nameDB_ = new Names(this.RESERVED_WORDS_);
|
||||||
} else {
|
} else {
|
||||||
this.nameDB_.reset();
|
this.nameDB_.reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
this.nameDB_.setVariableMap(workspace.getVariableMap());
|
this.nameDB_.setVariableMap(workspace.getVariableMap());
|
||||||
this.nameDB_.populateVariables(workspace);
|
this.nameDB_.populateVariables(workspace);
|
||||||
this.nameDB_.populateProcedures(workspace);
|
this.nameDB_.populateProcedures(workspace);
|
||||||
|
|
||||||
const defvars = [];
|
const defvars = [];
|
||||||
// Add developer variables (not created or named by the user).
|
// Add developer variables (not created or named by the user).
|
||||||
const devVarList = Variables.allDeveloperVariables(workspace);
|
const devVarList = Variables.allDeveloperVariables(workspace);
|
||||||
@@ -175,7 +175,7 @@ export class PythonGenerator extends CodeGenerator {
|
|||||||
this.nameDB_.getName(devVarList[i], Names.DEVELOPER_VARIABLE_TYPE) +
|
this.nameDB_.getName(devVarList[i], Names.DEVELOPER_VARIABLE_TYPE) +
|
||||||
' = None');
|
' = None');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add user variables, but only ones that are being used.
|
// Add user variables, but only ones that are being used.
|
||||||
const variables = Variables.allUsedVarModels(workspace);
|
const variables = Variables.allUsedVarModels(workspace);
|
||||||
for (let i = 0; i < variables.length; i++) {
|
for (let i = 0; i < variables.length; i++) {
|
||||||
@@ -183,11 +183,11 @@ export class PythonGenerator extends CodeGenerator {
|
|||||||
this.nameDB_.getName(variables[i].getId(), NameType.VARIABLE) +
|
this.nameDB_.getName(variables[i].getId(), NameType.VARIABLE) +
|
||||||
' = None');
|
' = None');
|
||||||
}
|
}
|
||||||
|
|
||||||
this.definitions_['variables'] = defvars.join('\n');
|
this.definitions_['variables'] = defvars.join('\n');
|
||||||
this.isInitialized = true;
|
this.isInitialized = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Prepend the generated code with import statements and variable definitions.
|
* Prepend the generated code with import statements and variable definitions.
|
||||||
* @param {string} code Generated code.
|
* @param {string} code Generated code.
|
||||||
@@ -208,12 +208,12 @@ export class PythonGenerator extends CodeGenerator {
|
|||||||
// Call Blockly.CodeGenerator's finish.
|
// Call Blockly.CodeGenerator's finish.
|
||||||
code = super.finish(code);
|
code = super.finish(code);
|
||||||
this.isInitialized = false;
|
this.isInitialized = false;
|
||||||
|
|
||||||
this.nameDB_.reset();
|
this.nameDB_.reset();
|
||||||
const allDefs = imports.join('\n') + '\n\n' + definitions.join('\n\n');
|
const allDefs = imports.join('\n') + '\n\n' + definitions.join('\n\n');
|
||||||
return allDefs.replace(/\n\n+/g, '\n\n').replace(/\n*$/, '\n\n\n') + code;
|
return allDefs.replace(/\n\n+/g, '\n\n').replace(/\n*$/, '\n\n\n') + code;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Naked values are top-level blocks with outputs that aren't plugged into
|
* Naked values are top-level blocks with outputs that aren't plugged into
|
||||||
* anything.
|
* anything.
|
||||||
@@ -223,7 +223,7 @@ export class PythonGenerator extends CodeGenerator {
|
|||||||
scrubNakedValue(line) {
|
scrubNakedValue(line) {
|
||||||
return line + '\n';
|
return line + '\n';
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Encode a string as a properly escaped Python string, complete with quotes.
|
* Encode a string as a properly escaped Python string, complete with quotes.
|
||||||
* @param {string} string Text to encode.
|
* @param {string} string Text to encode.
|
||||||
@@ -232,7 +232,7 @@ export class PythonGenerator extends CodeGenerator {
|
|||||||
*/
|
*/
|
||||||
quote_(string) {
|
quote_(string) {
|
||||||
string = string.replace(/\\/g, '\\\\').replace(/\n/g, '\\\n');
|
string = string.replace(/\\/g, '\\\\').replace(/\n/g, '\\\n');
|
||||||
|
|
||||||
// Follow the CPython behaviour of repr() for a non-byte string.
|
// Follow the CPython behaviour of repr() for a non-byte string.
|
||||||
let quote = '\'';
|
let quote = '\'';
|
||||||
if (string.indexOf('\'') !== -1) {
|
if (string.indexOf('\'') !== -1) {
|
||||||
@@ -244,7 +244,7 @@ export class PythonGenerator extends CodeGenerator {
|
|||||||
}
|
}
|
||||||
return quote + string + quote;
|
return quote + string + quote;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Encode a string as a properly escaped multiline Python string, complete
|
* Encode a string as a properly escaped multiline Python string, complete
|
||||||
* with quotes.
|
* with quotes.
|
||||||
@@ -258,7 +258,7 @@ export class PythonGenerator extends CodeGenerator {
|
|||||||
// + '\n' +
|
// + '\n' +
|
||||||
return lines.join(' + \'\\n\' + \n');
|
return lines.join(' + \'\\n\' + \n');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Common tasks for generating Python from blocks.
|
* Common tasks for generating Python from blocks.
|
||||||
* Handles comments for the specified block and any connected value blocks.
|
* Handles comments for the specified block and any connected value blocks.
|
||||||
@@ -297,7 +297,7 @@ export class PythonGenerator extends CodeGenerator {
|
|||||||
const nextCode = opt_thisOnly ? '' : this.blockToCode(nextBlock);
|
const nextCode = opt_thisOnly ? '' : this.blockToCode(nextBlock);
|
||||||
return commentCode + code + nextCode;
|
return commentCode + code + nextCode;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets a property and adjusts the value, taking into account indexing.
|
* Gets a property and adjusts the value, taking into account indexing.
|
||||||
* If a static int, casts to an integer, otherwise returns a code string.
|
* If a static int, casts to an integer, otherwise returns a code string.
|
||||||
@@ -315,7 +315,7 @@ export class PythonGenerator extends CodeGenerator {
|
|||||||
const defaultAtIndex = block.workspace.options.oneBasedIndex ? '1' : '0';
|
const defaultAtIndex = block.workspace.options.oneBasedIndex ? '1' : '0';
|
||||||
const atOrder = delta ? this.ORDER_ADDITIVE : this.ORDER_NONE;
|
const atOrder = delta ? this.ORDER_ADDITIVE : this.ORDER_NONE;
|
||||||
let at = this.valueToCode(block, atId, atOrder) || defaultAtIndex;
|
let at = this.valueToCode(block, atId, atOrder) || defaultAtIndex;
|
||||||
|
|
||||||
if (stringUtils.isNumber(at)) {
|
if (stringUtils.isNumber(at)) {
|
||||||
// If the index is a naked number, adjust it right now.
|
// If the index is a naked number, adjust it right now.
|
||||||
at = parseInt(at, 10) + delta;
|
at = parseInt(at, 10) + delta;
|
||||||
|
|||||||
4
package-lock.json
generated
4
package-lock.json
generated
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "blockly",
|
"name": "blockly",
|
||||||
"version": "10.0.1",
|
"version": "10.0.2",
|
||||||
"lockfileVersion": 2,
|
"lockfileVersion": 2,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "blockly",
|
"name": "blockly",
|
||||||
"version": "10.0.1",
|
"version": "10.0.2",
|
||||||
"hasInstallScript": true,
|
"hasInstallScript": true,
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "blockly",
|
"name": "blockly",
|
||||||
"version": "10.0.1",
|
"version": "10.0.2",
|
||||||
"description": "Blockly is a library for building visual programming editors.",
|
"description": "Blockly is a library for building visual programming editors.",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"blockly"
|
"blockly"
|
||||||
|
|||||||
@@ -1577,5 +1577,23 @@
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
|
||||||
|
'10.0.1': [
|
||||||
|
{
|
||||||
|
oldName: 'Blockly',
|
||||||
|
exports: {
|
||||||
|
HSV_SATURATION: {
|
||||||
|
newModule: 'Blockly.utils.colour',
|
||||||
|
getMethod: 'getHsvSaturation',
|
||||||
|
setMethod: 'setHsvSaturation',
|
||||||
|
},
|
||||||
|
HSV_VALUE: {
|
||||||
|
newModule: 'Blockly.utils.colour',
|
||||||
|
getMethod: 'getHsvValue',
|
||||||
|
setMethod: 'setHsvValue',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
|
||||||
'develop': [],
|
'develop': [],
|
||||||
}
|
}
|
||||||
|
|||||||
21
typings/dart.d.ts
vendored
21
typings/dart.d.ts
vendored
@@ -4,4 +4,25 @@
|
|||||||
* SPDX-License-Identifier: Apache-2.0
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
export enum Order {
|
||||||
|
ATOMIC = 0, // 0 "" ...
|
||||||
|
UNARY_POSTFIX = 1, // expr++ expr-- () [] . ?.
|
||||||
|
UNARY_PREFIX = 2, // -expr !expr ~expr ++expr --expr
|
||||||
|
MULTIPLICATIVE = 3, // * / % ~/
|
||||||
|
ADDITIVE = 4, // + -
|
||||||
|
SHIFT = 5, // << >>
|
||||||
|
BITWISE_AND = 6, // &
|
||||||
|
BITWISE_XOR = 7, // ^
|
||||||
|
BITWISE_OR = 8, // |
|
||||||
|
RELATIONAL = 9, // >= > <= < as is is!
|
||||||
|
EQUALITY = 10, // == !=
|
||||||
|
LOGICAL_AND = 11, // &&
|
||||||
|
LOGICAL_OR = 12, // ||
|
||||||
|
IF_NULL = 13, // ??
|
||||||
|
CONDITIONAL = 14, // expr ? expr : expr
|
||||||
|
CASCADE = 15, // ..
|
||||||
|
ASSIGNMENT = 16, // = *= /= ~/= %= += -= <<= >>= &= ^= |=
|
||||||
|
NONE = 99, // (...)
|
||||||
|
}
|
||||||
|
|
||||||
export declare const dartGenerator: any;
|
export declare const dartGenerator: any;
|
||||||
|
|||||||
38
typings/javascript.d.ts
vendored
38
typings/javascript.d.ts
vendored
@@ -4,4 +4,42 @@
|
|||||||
* SPDX-License-Identifier: Apache-2.0
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
export enum Order {
|
||||||
|
ATOMIC = 0, // 0 "" ...
|
||||||
|
NEW = 1.1, // new
|
||||||
|
MEMBER = 1.2, // . []
|
||||||
|
FUNCTION_CALL = 2, // ()
|
||||||
|
INCREMENT = 3, // ++
|
||||||
|
DECREMENT = 3, // --
|
||||||
|
BITWISE_NOT = 4.1, // ~
|
||||||
|
UNARY_PLUS = 4.2, // +
|
||||||
|
UNARY_NEGATION = 4.3, // -
|
||||||
|
LOGICAL_NOT = 4.4, // !
|
||||||
|
TYPEOF = 4.5, // typeof
|
||||||
|
VOID = 4.6, // void
|
||||||
|
DELETE = 4.7, // delete
|
||||||
|
AWAIT = 4.8, // await
|
||||||
|
EXPONENTIATION = 5.0, // **
|
||||||
|
MULTIPLICATION = 5.1, // *
|
||||||
|
DIVISION = 5.2, // /
|
||||||
|
MODULUS = 5.3, // %
|
||||||
|
SUBTRACTION = 6.1, // -
|
||||||
|
ADDITION = 6.2, // +
|
||||||
|
BITWISE_SHIFT = 7, // << >> >>>
|
||||||
|
RELATIONAL = 8, // < <= > >=
|
||||||
|
IN = 8, // in
|
||||||
|
INSTANCEOF = 8, // instanceof
|
||||||
|
EQUALITY = 9, // == != === !==
|
||||||
|
BITWISE_AND = 10, // &
|
||||||
|
BITWISE_XOR = 11, // ^
|
||||||
|
BITWISE_OR = 12, // |
|
||||||
|
LOGICAL_AND = 13, // &&
|
||||||
|
LOGICAL_OR = 14, // ||
|
||||||
|
CONDITIONAL = 15, // ?:
|
||||||
|
ASSIGNMENT = 16, // = += -= **= *= /= %= <<= >>= ...
|
||||||
|
YIELD = 17, // yield
|
||||||
|
COMMA = 18, // ,
|
||||||
|
NONE = 99, // (...)
|
||||||
|
}
|
||||||
|
|
||||||
export declare const javascriptGenerator: any;
|
export declare const javascriptGenerator: any;
|
||||||
|
|||||||
15
typings/lua.d.ts
vendored
15
typings/lua.d.ts
vendored
@@ -4,4 +4,19 @@
|
|||||||
* SPDX-License-Identifier: Apache-2.0
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
export enum Order {
|
||||||
|
ATOMIC = 0, // literals
|
||||||
|
// The next level was not explicit in documentation and inferred by Ellen.
|
||||||
|
HIGH = 1, // Function calls, tables[]
|
||||||
|
EXPONENTIATION = 2, // ^
|
||||||
|
UNARY = 3, // not # - ~
|
||||||
|
MULTIPLICATIVE = 4, // * / %
|
||||||
|
ADDITIVE = 5, // + -
|
||||||
|
CONCATENATION = 6, // ..
|
||||||
|
RELATIONAL = 7, // < > <= >= ~= ==
|
||||||
|
AND = 8, // and
|
||||||
|
OR = 9, // or
|
||||||
|
NONE = 99,
|
||||||
|
}
|
||||||
|
|
||||||
export declare const luaGenerator: any;
|
export declare const luaGenerator: any;
|
||||||
|
|||||||
40
typings/php.d.ts
vendored
40
typings/php.d.ts
vendored
@@ -4,4 +4,44 @@
|
|||||||
* SPDX-License-Identifier: Apache-2.0
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
export enum Order {
|
||||||
|
ATOMIC = 0, // 0 "" ...
|
||||||
|
CLONE = 1, // clone
|
||||||
|
NEW = 1, // new
|
||||||
|
MEMBER = 2.1, // []
|
||||||
|
FUNCTION_CALL = 2.2, // ()
|
||||||
|
POWER = 3, // **
|
||||||
|
INCREMENT = 4, // ++
|
||||||
|
DECREMENT = 4, // --
|
||||||
|
BITWISE_NOT = 4, // ~
|
||||||
|
CAST = 4, // (int) (float) (string) (array) ...
|
||||||
|
SUPPRESS_ERROR = 4, // @
|
||||||
|
INSTANCEOF = 5, // instanceof
|
||||||
|
LOGICAL_NOT = 6, // !
|
||||||
|
UNARY_PLUS = 7.1, // +
|
||||||
|
UNARY_NEGATION = 7.2, // -
|
||||||
|
MULTIPLICATION = 8.1, // *
|
||||||
|
DIVISION = 8.2, // /
|
||||||
|
MODULUS = 8.3, // %
|
||||||
|
ADDITION = 9.1, // +
|
||||||
|
SUBTRACTION = 9.2, // -
|
||||||
|
STRING_CONCAT = 9.3, // .
|
||||||
|
BITWISE_SHIFT = 10, // << >>
|
||||||
|
RELATIONAL = 11, // < <= > >=
|
||||||
|
EQUALITY = 12, // == != === !== <> <=>
|
||||||
|
REFERENCE = 13, // &
|
||||||
|
BITWISE_AND = 13, // &
|
||||||
|
BITWISE_XOR = 14, // ^
|
||||||
|
BITWISE_OR = 15, // |
|
||||||
|
LOGICAL_AND = 16, // &&
|
||||||
|
LOGICAL_OR = 17, // ||
|
||||||
|
IF_NULL = 18, // ??
|
||||||
|
CONDITIONAL = 19, // ?:
|
||||||
|
ASSIGNMENT = 20, // = += -= *= /= %= <<= >>= ...
|
||||||
|
LOGICAL_AND_WEAK = 21, // and
|
||||||
|
LOGICAL_XOR = 22, // xor
|
||||||
|
LOGICAL_OR_WEAK = 23, // or
|
||||||
|
NONE = 99, // (...)
|
||||||
|
}
|
||||||
|
|
||||||
export declare const phpGenerator: any;
|
export declare const phpGenerator: any;
|
||||||
|
|||||||
24
typings/python.d.ts
vendored
24
typings/python.d.ts
vendored
@@ -4,4 +4,28 @@
|
|||||||
* SPDX-License-Identifier: Apache-2.0
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
export enum Order {
|
||||||
|
ATOMIC = 0, // 0 "" ...
|
||||||
|
COLLECTION = 1, // tuples, lists, dictionaries
|
||||||
|
STRING_CONVERSION = 1, // `expression...`
|
||||||
|
MEMBER = 2.1, // . []
|
||||||
|
FUNCTION_CALL = 2.2, // ()
|
||||||
|
EXPONENTIATION = 3, // **
|
||||||
|
UNARY_SIGN = 4, // + -
|
||||||
|
BITWISE_NOT = 4, // ~
|
||||||
|
MULTIPLICATIVE = 5, // * / // %
|
||||||
|
ADDITIVE = 6, // + -
|
||||||
|
BITWISE_SHIFT = 7, // << >>
|
||||||
|
BITWISE_AND = 8, // &
|
||||||
|
BITWISE_XOR = 9, // ^
|
||||||
|
BITWISE_OR = 10, // |
|
||||||
|
RELATIONAL = 11, // in, not in, is, is not, >, >=, <>, !=, ==
|
||||||
|
LOGICAL_NOT = 12, // not
|
||||||
|
LOGICAL_AND = 13, // and
|
||||||
|
LOGICAL_OR = 14, // or
|
||||||
|
CONDITIONAL = 15, // if else
|
||||||
|
LAMBDA = 16, // lambda
|
||||||
|
NONE = 99, // (...)
|
||||||
|
}
|
||||||
|
|
||||||
export declare const pythonGenerator: any;
|
export declare const pythonGenerator: any;
|
||||||
|
|||||||
Reference in New Issue
Block a user