File tree Expand file tree Collapse file tree
crates/emmylua_parser/src Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -36,6 +36,8 @@ fn parse_docs(p: &mut LuaDocParser) {
3636 p. set_state ( LuaDocLexerState :: NormalDescription ) ;
3737 p. bump ( ) ;
3838
39+ if_token_bump ( p, LuaTokenKind :: TkWhitespace ) ;
40+
3941 if matches ! (
4042 p. current_token( ) ,
4143 LuaTokenKind :: TkDocRegion | LuaTokenKind :: TkDocEndRegion
Original file line number Diff line number Diff line change @@ -484,12 +484,16 @@ impl LuaDocLexer<'_> {
484484 reader. eat_while ( is_doc_whitespace) ;
485485 LuaTokenKind :: TkWhitespace
486486 }
487- ch if ch. is_ascii_alphabetic ( ) => {
487+ ch if ch. is_ascii_alphabetic ( ) || ch == '#' => {
488+ if reader. current_char ( ) == '#' {
489+ reader. bump ( ) ;
490+ }
491+
488492 reader. eat_while ( |c| c. is_ascii_alphabetic ( ) ) ;
489493 let text = reader. current_saved_text ( ) ;
490494 match text {
491- "region" => LuaTokenKind :: TkDocRegion ,
492- "endregion" => LuaTokenKind :: TkDocEndRegion ,
495+ "region" | "#region" => LuaTokenKind :: TkDocRegion ,
496+ "endregion" | "#endregion" => LuaTokenKind :: TkDocEndRegion ,
493497 _ => {
494498 reader. eat_while ( |_| true ) ;
495499 LuaTokenKind :: TkDocDetail
You can’t perform that action at this time.
0 commit comments