From: NeilBrown Date: Sat, 8 Jun 2019 04:35:34 +0000 (+1000) Subject: scanner: fix handling of indents in sub-nodes X-Git-Url: https://ocean-lang.org/code/?a=commitdiff_plain;h=151e984bb8300e4eb3f7cdf41135f9a3b0261fd5;hp=151e984bb8300e4eb3f7cdf41135f9a3b0261fd5;p=ocean scanner: fix handling of indents in sub-nodes I seem to have confused ->indent_sizes[] and ->col ->col is used for the reported location of a token so must be the actual column in the file, with no adjustment. ->indent_sizes[] is indents, which must include any inherited from parent nodes. So this is a completely different value. So change mdcode to store the local node indent in ->needs_strip - this is the number of text columns that are stripped off. This, subtracted from ->indent is the text offset of the physical start-of-line. Adding the measured ->col then gives us the indent in the composed file, the indent that must be used for detecting TK_in and TK_out. Introduce a new function state_indent() which determines that indent, and use it instead of ->col. Signed-off-by: NeilBrown ---