mirror of
https://github.com/JannisX11/blockbench.git
synced 2025-03-13 16:58:33 +08:00
Add back support for older iOS versions
Add new molang validation for ")("
This commit is contained in:
parent
c891ca0652
commit
e2fa88246a
@ -587,6 +587,7 @@ new ValidatorCheck('molang_syntax', {
|
||||
run() {
|
||||
let check = this;
|
||||
let keywords = ['return', 'continue', 'break'];
|
||||
let two_expression_regex = (isApp || window.chrome) ? new RegExp('(?<!\\w)[0-9._]+\\(|\\)[a-z0-9._]+') : null;
|
||||
function validateMolang(string, message, instance) {
|
||||
if (!string || typeof string !== 'string') return;
|
||||
let clear_string = string.replace(/'.*'/g, '0');
|
||||
@ -598,7 +599,7 @@ new ValidatorCheck('molang_syntax', {
|
||||
if (clear_string.match(/^[+*/.,?=&<>|]/)) {
|
||||
issues.push('Expression starts with an invalid character');
|
||||
}
|
||||
if ((clear_string.match(/[\w.]\s+[\w.]/) && !keywords.find(k => clear_string.includes(k))) || clear_string.match(/(?<!\w)[0-9._]+\(|\)[a-z0-9._]+/)) {
|
||||
if ((clear_string.match(/[\w.]\s+[\w.]/) && !keywords.find(k => clear_string.includes(k))) || clear_string.match(/\)\(/) || (two_expression_regex && clear_string.match(two_expression_regex))) {
|
||||
issues.push('Two expressions with no operator in between');
|
||||
}
|
||||
if (clear_string.match(/(^|[^a-z0-9_])[\d.]+[a-z_]+/i)) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user