• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Handling tab character for error messages (antlr4)

Status
Not open for further replies.
Level 10
Joined
Sep 19, 2011
Messages
527
Hi there :), I'm still working on vrJASS, on the validation/error messages feature and I've encountered myself with this peculiar problem that I solved with a pretty rusty solution.

The thing is that tabular does not have a universal value, so when errors are displayed, the character position might be wrong because of this. So what I did was simply replace tabs with 4 spaces. Now, is it a good solution?

Greetings and thanks!
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,198
Tabs are more a word processing definition rather than actual text. For that reason almost all indentation in code is done by substitution of tabs with physical spaces, or at least the suit supports the automation of such.

One can think of a tab similar to a new paragraph or new line or even carriage return. They all have meaning with respect to the layout of the resulting text however their exact meaning depends on the document style rather than the text. Tabs could be completely invisible if the document style dictates so, where as actual text should always be visible irrespective of the document style.
 
Level 10
Joined
Sep 19, 2011
Messages
527
Tabs are more a word processing definition rather than actual text. For that reason almost all indentation in code is done by substitution of tabs with physical spaces, or at least the suit supports the automation of such.

One can think of a tab similar to a new paragraph or new line or even carriage return. They all have meaning with respect to the layout of the resulting text however their exact meaning depends on the document style rather than the text. Tabs could be completely invisible if the document style dictates so, where as actual text should always be visible irrespective of the document style.

thanks! :thumbs_up:
 
Status
Not open for further replies.
Top