Make changelog.txt parser more user friendly

Post your ideas and suggestions how to improve the game.

Moderator: ickputzdirwech

User avatar
Optera
Smart Inserter
Smart Inserter
Posts: 2920
Joined: Sat Jun 11, 2016 6:41 am
Contact:

Make changelog.txt parser more user friendly

Post by Optera »

The parser feels way to nitpicky about indents and correct amount of whitespaces. Often it complains with "missing colon after category." when the actual fix is to add and remove indent in Npp.

Parsing changelogs like this would be a lot more forgiving to randomly placed whitespaces and also allow indenting with tabs.

Code: Select all

foreach line in file {
  strg = trim(line).toLower();  
  if strg.StartsWith("version:") {
    // version
  } else if strg.StartsWith("date:") {
    // date    
  } else if strg.EndsWith(":") {
    // category    
  } else if strg.StartsWith("----") {
    // separator
  } else if strg.StartsWith("-") {
    // add list item to last read category
  }
}
Post Reply

Return to “Ideas and Suggestions”