|
@@ -51,7 +51,7 @@ function protocolReplace(line) { |
|
|
if (line == "}") { |
|
|
if (line == "}") { |
|
|
isProtocol = false; |
|
|
isProtocol = false; |
|
|
} |
|
|
} |
|
|
console.log("ИГР protocolR isP/line:", isProtocol, line); |
|
|
|
|
|
|
|
|
console.log("ИГР protocolR-1 isP/line:", isProtocol, line); |
|
|
if (!isProtocol) { |
|
|
if (!isProtocol) { |
|
|
return line; |
|
|
return line; |
|
|
} |
|
|
} |
|
@@ -60,6 +60,7 @@ function protocolReplace(line) { |
|
|
if (isProtocol) { |
|
|
if (isProtocol) { |
|
|
result = protocolReplaceVariable(result); |
|
|
result = protocolReplaceVariable(result); |
|
|
} |
|
|
} |
|
|
|
|
|
console.log("ИГР protocolR-2 isP/line:", isProtocol, line); |
|
|
return result; |
|
|
return result; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@@ -71,7 +72,7 @@ function protocolReplaceVariable(line) { |
|
|
let spaceLength = parts[0].length - name.length; |
|
|
let spaceLength = parts[0].length - name.length; |
|
|
let spaces = " ".repeat(spaceLength); |
|
|
let spaces = " ".repeat(spaceLength); |
|
|
//console.log("Variable. name/spaceL/parts:", name, spaceLength, parts); |
|
|
//console.log("Variable. name/spaceL/parts:", name, spaceLength, parts); |
|
|
return `${spaces}var ${name}: ${type} { get }\n`; |
|
|
|
|
|
|
|
|
return `${spaces}var ${name}: ${type} { get }`; |
|
|
} |
|
|
} |
|
|
return line; |
|
|
return line; |
|
|
} |
|
|
} |