Skip to content

Commit 8e4a1b6

Browse files
committed
[WIP] Smart convert, and add web example with 8xp<->8xp2 converter.
1 parent c7af832 commit 8e4a1b6

9 files changed

Lines changed: 601 additions & 18 deletions

File tree

TIVarsLib.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

TIVarsLib.wasm

-510 Bytes
Binary file not shown.

cli/cli.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ int main(int argc, char** argv)
4949
("l,lang", "Language", cxxopts::value<string>()->default_value("en"))
5050
("a,archive", "Archive status", cxxopts::value<bool>())
5151
("r,reindent", "Re-indent", cxxopts::value<bool>())
52+
("smart", "Use compatibility rewrites when converting 84+CE programs to 84Evo", cxxopts::value<bool>())
5253
("accessible", "Use accessible token names for non-US-keyboard display tokens", cxxopts::value<bool>())
5354
("p,prettify", "Prettify (display-oriented, may not roundtrip)", cxxopts::value<bool>())
5455
("s,detect_strings", "Detect strings", cxxopts::value<bool>())
@@ -264,21 +265,22 @@ int main(int argc, char** argv)
264265

265266
if (iformat == VARFILE)
266267
{
268+
const options_t conversionOptions = {{"smart", result["smart"].as<bool>() ? 1 : 0}};
267269
if (result.count("name"))
268270
{
269271
file.setVarName(requestedName);
270272
}
271273
if (result.count("calc"))
272274
{
273-
file.convertToModel(requestedModel);
275+
file.convertToModel(requestedModel, conversionOptions);
274276
}
275277
else if (oformat == VARFILE && isEvoVarExtension(extensionOf(opath)) && !file.isEvoFormat())
276278
{
277-
file.convertToModel(TIModel{"84Evo"});
279+
file.convertToModel(TIModel{"84Evo"}, conversionOptions);
278280
}
279281
else if (oformat == VARFILE && isLegacyVarExtension(extensionOf(opath)) && file.isEvoFormat())
280282
{
281-
file.convertToModel(TIModel{"84+CE"});
283+
file.convertToModel(TIModel{"84+CE"}, conversionOptions);
282284
}
283285
}
284286

0 commit comments

Comments
 (0)