• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • Vote for the theme of Hive's HD Modeling Contest #7! Click here to vote! - Please only vote if you plan on participating❗️

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,266
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