Skip to content

Commit

Permalink
parser will now ignore preceding whitespace in var blocks; removed un…
Browse files Browse the repository at this point in the history
…used

file

penis
  • Loading branch information
xxalpha committed Feb 26, 2016
1 parent 28ae2a7 commit be29040
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 74 deletions.
70 changes: 0 additions & 70 deletions tools/mapmerge/dmm2tgm.py

This file was deleted.

14 changes: 11 additions & 3 deletions tools/mapmerge/map_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,6 @@ def write_dictionary_tgm(filename, dictionary):
for thing in list_:
buffer = ""
in_quote_block = False
escaping_quote = False
in_varedit_block = False
for char in thing:

Expand Down Expand Up @@ -226,13 +225,12 @@ def parse_map(map_file):
characters = map_input.read()

in_quote_block = False
escaping_quote = False
in_key_block = False
in_data_block = False
in_varedit_block = False
after_data_block = False
escaping_parenthesis = 0
escaping = False
skip_whitespace = False

dictionary = collections.OrderedDict()
curr_key = ""
Expand Down Expand Up @@ -285,12 +283,22 @@ def parse_map(map_file):

curr_datum = curr_datum + char
continue

if skip_whitespace and char == " ":
skip_whitespace = False
continue
skip_whitespace = False

if char == "\"":
curr_datum = curr_datum + char
in_quote_block = True
continue

if char == ";":
skip_whitespace = True
curr_datum = curr_datum + char
continue

if char == "}":
curr_datum = curr_datum + char
in_varedit_block = False
Expand Down
1 change: 0 additions & 1 deletion tools/mapmerge/mapmerger.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import sys
import os
import pathlib
import dmm2tgm
import map_helpers

#main("../../_maps/")
Expand Down

0 comments on commit be29040

Please sign in to comment.