From 1ba526d4deacfeebc3f5a660fb45b64a20de33f3 Mon Sep 17 00:00:00 2001 From: MaxED Date: Tue, 16 Feb 2016 15:46:35 +0300 Subject: [PATCH] Added #region / #endregion handling (should affect all text lumps, let me know if there are text lumps unaffected by this). --- src/sc_man_scanner.re | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/sc_man_scanner.re b/src/sc_man_scanner.re index d1d05b929..cc051b05f 100644 --- a/src/sc_man_scanner.re +++ b/src/sc_man_scanner.re @@ -55,6 +55,8 @@ std2: /*!re2c "/*" { goto comment; } /* C comment */ "//" (any\"\n")* "\n" { goto newline; } /* C++ comment */ + ("#region"|"#endregion") (any\"\n")* "\n" + { goto newline; } /* Region blocks [mxd] */ (["](([\\]["])|[^"])*["]) { RET(TK_StringConst); } 'stop' { RET(TK_Stop); } @@ -80,6 +82,8 @@ std2: /*!re2c "/*" { goto comment; } /* C comment */ "//" (any\"\n")* "\n" { goto newline; } /* C++ comment */ + ("#region"|"#endregion") (any\"\n")* "\n" + { goto newline; } /* Region blocks [mxd] */ /* C Keywords */ 'break' { RET(TK_Break); } @@ -269,6 +273,8 @@ std2: /*!re2c "/*" { goto comment; } /* C comment */ ("//"|";") (any\"\n")* "\n" { goto newline; } /* C++/Hexen comment */ + ("#region"|"#endregion") (any\"\n")* "\n" + { goto newline; } /* Region blocks [mxd] */ WSP+ { goto std1; } /* whitespace */ "\n" { goto newline; } @@ -287,6 +293,8 @@ std2: /*!re2c "/*" { goto comment; } /* C comment */ "//" (any\"\n")* "\n" { goto newline; } /* C++ comment */ + ("#region"|"#endregion") (any\"\n")* "\n" + { goto newline; } /* Region blocks [mxd] */ WSP+ { goto std1; } /* whitespace */ "\n" { goto newline; }