diff options
| author | Rémi Verschelde <rverschelde@gmail.com> | 2019-10-25 23:16:04 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-10-25 23:16:04 +0200 |
| commit | c43c3747cfbb21385c09e887d93f6808f9a5bc6d (patch) | |
| tree | 829fb8d9af21beb6f92270e7913eb25bef07e6d7 /modules/gdscript/gdscript_parser.h | |
| parent | 6a74113150ab565ba11900417e61344794548a12 (diff) | |
| parent | afbde3314aee106c835249b2f56c14d68f782899 (diff) | |
Merge pull request #32808 from bojidar-bg/30937-less-strict-mixed-spacing
Allow mixed tabs and spaces when indentation does not depend on tab size
Diffstat (limited to 'modules/gdscript/gdscript_parser.h')
| -rw-r--r-- | modules/gdscript/gdscript_parser.h | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/modules/gdscript/gdscript_parser.h b/modules/gdscript/gdscript_parser.h index 04ce9cf4c6..93557d745d 100644 --- a/modules/gdscript/gdscript_parser.h +++ b/modules/gdscript/gdscript_parser.h @@ -552,7 +552,27 @@ private: int pending_newline; - List<int> tab_level; + struct IndentLevel { + int indent; + int tabs; + + bool is_mixed(IndentLevel other) { + return ( + (indent == other.indent && tabs != other.tabs) || + (indent > other.indent && tabs < other.tabs) || + (indent < other.indent && tabs > other.tabs)); + } + + IndentLevel() : + indent(0), + tabs(0) {} + + IndentLevel(int p_indent, int p_tabs) : + indent(p_indent), + tabs(p_tabs) {} + }; + + List<IndentLevel> indent_level; String base_path; String self_path; |