Pocket Plane Group
Friends and Neighbors => Weimer Republic (WeiDU.org) => WeiDU => Topic started by: Magus_BGforge on January 15, 2019, 10:03:57 PM
-
I'd like to ask if it would be too much trouble to add a command line option to parse a file as an action list or a patch list. Something like "weidu --parse patch my_include.tpp" (and same for action). And output the errors normally, if any.
This is for use in VScode (http://forums.pocketplane.net/index.php/topic,29802.0.html), to report syntax errors. Working for TP2, and I'd like to extend it to TPA/TPP, but I don't see a way to do this currently... at least without dirty, dirty hacks.
For some reason it's not possible to make an attachment... Here's a screenshot to see the feature I'm talking about: https://ibb.co/cvLXVDt
-
Do you want to grep for errors/warnings in the chatter or would more structured output be preferable?
-
I just run "weidu --nogame --no-exit-pause --skip-at-view --noautoupdate --uninstall --language 0 --log ${dev_null}", detect "PARSE ERROR" and then push the entire output text https://ibb.co/bHrv8yt. There can't be more than one parse error reported anyway, right?
I'm not sure how exactly it could/should be structured, either. The only clue I ever got from parse errors is "look hard at this line and around it".
Warnings are not reported currently. The feature requires specific position (line/column boundaries), and I think weidu doesn't print those for warnings?
The implementation could probably be improved, and structured output would likely help with that (if enabled for .tp2, too), but I'd like to gather some feedback/suggestions first, and so far I hasn't got that.
So either way would do, but if structuring is a hassle, no reason to bother with it for now.
-
TP2 only issues fatal parse errors, yes. But there's no sense in not enabling this for BCS and D as well, and those compilers can issue non-fatal warnings. I'll see what I can come up with.
-
Right, BCS/D can probably be done even without this feature. Nobody requested that, though, so I skipped them for now.