Skip to content

Commit b7b1c38

Browse files
committed
Move RubyParser up in Parser arch docs
1 parent 163dae8 commit b7b1c38

1 file changed

Lines changed: 14 additions & 14 deletions

File tree

docs/Parser.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -55,20 +55,6 @@ You can also provide the parser type explicitly as the second argument:
5555
Note that these two methods are aliased as {YARD.parse} and {YARD.parse_string} for
5656
convenience.
5757

58-
## Implementing and Registering a Custom Parser
59-
60-
To implement a custom parser, subclass {YARD::Parser::Base}. Documentation on which
61-
abstract methods should be implemented are documented in that class. After the class
62-
is implemented, it is registered with the {YARD::Parser::SourceParser} factory class
63-
to be called when a file of the right extension needs to be parsed, or when a user
64-
selects that parser type explicitly. To register your new parser class, call the
65-
method {YARD::Parser::SourceParser.register_parser_type}:
66-
67-
SourceParser.register_parser_type(:my_parser, MyParser, 'my_parser_ext')
68-
69-
The last argument can be a single extension, a list of extensions (Array), a single Regexp, or a
70-
list of Regexps. Do not include the '.' in the extension.
71-
7258
## RubyParser
7359

7460
The Ruby parser uses the Ripper library that is packaged as part of stdlib.
@@ -138,6 +124,20 @@ to quickly get at a node of a specific type in such a situation:
138124
Multiple types can be searched for at once. If none are found, the original root
139125
node is returned so that it may be chained.
140126

127+
## Implementing and Registering a Custom Parser
128+
129+
To implement a custom parser, subclass {YARD::Parser::Base}. Documentation on which
130+
abstract methods should be implemented are documented in that class. After the class
131+
is implemented, it is registered with the {YARD::Parser::SourceParser} factory class
132+
to be called when a file of the right extension needs to be parsed, or when a user
133+
selects that parser type explicitly. To register your new parser class, call the
134+
method {YARD::Parser::SourceParser.register_parser_type}:
135+
136+
SourceParser.register_parser_type(:my_parser, MyParser, 'my_parser_ext')
137+
138+
The last argument can be a single extension, a list of extensions (Array), a single Regexp, or a
139+
list of Regexps. Do not include the '.' in the extension.
140+
141141
## The Legacy Parser
142142

143143
The goal of the legacy parser is much the same as the new parser, but it is far

0 commit comments

Comments
 (0)