Skip to content

Commit a9a095e

Browse files
parser: Export Parser class as unstable API (#2744)
Fixes #2741
1 parent 5d4007c commit a9a095e

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

src/language/parser.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,18 @@ export function parseType(
162162
return type;
163163
}
164164

165-
class Parser {
165+
/**
166+
* This class is exported only to assist people in implementing their own parsers
167+
* without duplicating too much code and should be used only as last resort for cases
168+
* such as experimental syntax or if certain features could not be contributed upstream.
169+
*
170+
* It is still part of the internal API and is versioned, so any changes to it are never
171+
* considered breaking changes. If you still need to support multiple versions of the
172+
* library, please use the `versionInfo` variable for version detection.
173+
*
174+
* @internal
175+
*/
176+
export class Parser {
166177
_options: ?ParseOptions;
167178
_lexer: Lexer;
168179

0 commit comments

Comments
 (0)