Author Topic: An option to "just parse" TPA/TPP  (Read 1421 times)

Offline Magus_BGforge

  • Planewalker
  • *****
  • Posts: 75
An option to "just parse" TPA/TPP
« 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, 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

Offline Wisp

  • Moderator
  • Planewalker
  • *****
  • Posts: 1176
Re: An option to "just parse" TPA/TPP
« Reply #1 on: January 16, 2019, 03:43:47 PM »
Do you want to grep for errors/warnings in the chatter or would more structured output be preferable?

Offline Magus_BGforge

  • Planewalker
  • *****
  • Posts: 75
Re: An option to "just parse" TPA/TPP
« Reply #2 on: January 17, 2019, 02:20:12 AM »
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.

Offline Wisp

  • Moderator
  • Planewalker
  • *****
  • Posts: 1176
Re: An option to "just parse" TPA/TPP
« Reply #3 on: January 20, 2019, 07:03:11 AM »
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.

Offline Magus_BGforge

  • Planewalker
  • *****
  • Posts: 75
Re: An option to "just parse" TPA/TPP
« Reply #4 on: January 23, 2019, 06:43:47 AM »
Right, BCS/D can probably be done even without this feature. Nobody requested that, though, so I skipped them for now.

 

With Quick-Reply you can write a post when viewing a topic without loading a new page. You can still use bulletin board code and smileys as you would in a normal post.

Warning: this topic has not been posted in for at least 120 days.
Unless you're sure you want to reply, please consider starting a new topic.

Name: Email:
Verification:
Type the letters shown in the picture
Listen to the letters / Request another image
Type the letters shown in the picture:
What color is grass?:
What is the seventh word in this sentence?:
What is five minus two (use the full word)?: