Esprima Expects ownership of the array! Items should not be added or removed from the while the returned is in use! Items should not be added or removed from the while the returned is in use! This implementation does not detect changes to the list during iteration and therefore the behaviour is undefined under those conditions. { (incl. ) | (omitted element) } { | (in assignment contexts only) | | | | (omitted element) } { | | | } | nodes never appear in the final AST, only used during its construction. | | | (in assignment contexts only) | | | | | | | (string or numeric) | '[' ']' | | (string) | | | | | (string) | (string) A JavaScript expression. Gets or sets the list of tokens associated with the AST represented by this node. This property is automatically set by when is set to . The operation is not guaranteed to be thread-safe. In case concurrent access or update is possible, the necessary synchronization is caller's responsibility. Gets or sets the list of comments associated with the AST represented by this node. This property is automatically set by when is set to . The operation is not guaranteed to be thread-safe. In case concurrent access or update is possible, the necessary synchronization is caller's responsibility. (may have an initializer in non-strict mode) | | | (cannot have an initializer) | | | (var i) | (i=0) { | | | } { | | | } Represents either a or an Represents either a , a or an Represents either an or an | (string or numeric) | (string) A Jsx expression. True if an indexer is used and the property to be evaluated. Inheritors who extend the AST with custom node types should override this method and provide an actual implementation. Dispatches the visitation of the current node to . When defining custom node types, inheritors can use this method to implement the abstract method. Expects ownership of the array! This implementation does not detect changes to the list during iteration and therefore the behaviour is undefined under those conditions. { | } { | } Gets or sets the list of tokens associated with the AST represented by this node. This property is automatically set by and when is set to . The operation is not guaranteed to be thread-safe. In case concurrent access or update is possible, the necessary synchronization is caller's responsibility. Gets or sets the list of comments associated with the AST represented by this node. This property is automatically set by and when is set to . The operation is not guaranteed to be thread-safe. In case concurrent access or update is possible, the necessary synchronization is caller's responsibility. | (string or numeric) | '[' ']' When property of an object literal: (incl. and for getters/setters/methods)
When property of an object binding pattern: | (in assignment contexts only) | | |
| (in assignment contexts only) | Gets or sets the arbitrary, user-defined data object associated with the current . The operation is not guaranteed to be thread-safe. In case concurrent access or update is possible, the necessary synchronization is caller's responsibility. | Error handler that collects errors that have been seen during the parsing. Default error handling logic for Esprima. JIT cannot inline methods that have in them. These helper methods allow us to work around this. Provides JavaScript parsing capabilities. Use the , or methods to parse the JavaScript code. Creates a new instance. Creates a new instance. The parser options. Parses the code as a JavaScript module. Parses the code as a JavaScript script. From internal representation to an external structure Expect the next token to match the specified punctuator. If not, an exception will be thrown. Quietly expect a comma when in tolerant mode, otherwise delegates to Expect(). Expect the next token to match the specified keyword. If not, an exception will be thrown. Return true if the next token matches the specified punctuator. Return true if the next token matches the specified punctuator and consumes the next token. Return true if the next token matches any of the specified punctuators. Return true if the next token matches the specified keyword Parses the code as a JavaScript expression. Provides JSX parsing capabilities. Use the , or methods to parse the JSX code. Zero-based index within the parsed code string. (Can be negative if location information is available.) One-based line number. (Can be zero if location information is not available.) One-based column index. Zero-based index within the parsed code string. (Can be negative if location information is available.) One-based line number. (Can be zero if location information is not available.) One-based column index. Parser options. Gets or sets whether the tokens are included in the parsed tree, defaults to . Gets or sets whether the comments are included in the parsed tree, defaults to . Gets or sets whether the parser is tolerant to errors, defaults to . Gets or sets whether the parser allows return statement to be used outside of functions, defaults to . Gets or sets the to use, defaults to . Gets or sets how regular expressions should be parsed, defaults to . Default timeout for created instances, defaults to 10 seconds. The maximum depth of assignments allowed, defaults to 200. Action to execute on each parsed node. This callback allows you to make changes to the nodes created by the parser. E.g. you can use it to store a reference to the parent node for later use: options.OnNodeCreated = node => { foreach (var child in node.ChildNodes) { child.AssociatedData = node; } }; Represents a source position as line number and column offset, where the first line is 1 and first column is 0. A position where and are zero is an allowed (and the default) value but considered an invalid position. Checks whether an ECMAScript regular expression is syntactically correct. Unicode sets mode (flag v) is not supported currently, for such patterns the method returns . Expressions within Unicode property escape sequences (\p{...} and \P{...}) are not validated (ignored) currently. if the regular expression is syntactically correct, otherwise . Parses an ECMAScript regular expression and tries to construct a instance with the equivalent behavior. Please note that, because of some fundamental differences between the ECMAScript and .NET regular expression engines, not every ECMAScript regular expression can be converted to an equivalent (or can be converted with compromises only). You can read more about the known issues of the conversion here. An instance of , whose property contains the equivalent if the conversion was possible, otherwise (unless is ). is an invalid regular expression pattern or cannot be converted to an equivalent (if is ). Ensures the braces are balanced in the regular expression pattern. Check the regular expression pattern for additional syntax errors and optionally build an adjusted pattern which implements the equivalent behavior in .NET, on top of the compatibility mode. if the scanner is configured to validate the regular expression pattern but not adapt it to .NET. Otherwise, the adapted pattern or if the pattern is syntactically correct but a .NET equivalent could not be constructed and the scanner is configured to tolerant mode. Specifies how the scanner should parse regular expressions. Scan regular expressions without checking that they are syntactically correct. Scan regular expressions and check that they are syntactically correct (throw if an invalid regular expression is encountered) but don't attempt to convert them to an equivalent . Scan regular expressions, check that they are syntactically correct (throw if an invalid regular expression is encountered) and attempt to convert them to an equivalent without the option. In the case of a valid regular expression for which an equivalent cannot be constructed, either is thrown or a is created with the property set to , depending on the option. Scan regular expressions, check that they are syntactically correct (throw if an invalid regular expression is encountered) and attempt to convert them to an equivalent with the option. In the case of a valid regular expression for which an equivalent cannot be constructed, either is thrown or a is created with the property set to , depending on the option. Scanner options. Gets or sets whether the comments are collected, defaults to . Gets or sets whether the scanner is tolerant to errors, defaults to . Gets or sets the to use, defaults to . Gets or sets how regular expressions should be parsed, defaults to . Default timeout for created instances, defaults to 10 seconds. A heavily slimmed down version of which can be used to reduce memory allocations when dissecting a string. Initializes buckets and slots arrays. Uses suggested capacity by finding next prime greater than or equal to capacity. Gets a reference to the specified hashcode's bucket, containing an index into . Adds the specified string to the object if it's not already contained. The string to add. The stored string instance. Gets the (positive) hashcode for a given instance. The input instance. The hashcode for . 0-based index of next entry in chain: -1 means end of chain also encodes whether this entry _itself_ is part of the free list by changing sign and subtracting 3, so -2 means end of free list, -3 means index 0 but on free list, -4 means index 1 but on free list, etc. This switch is intended for enabling a compatibility mode for to build a JSON output which matches the format of the test fixtures of the original Esprima project. Maps operator precedence to an integer value. The expression representing the operation. If less than zero, the operation has left-to-right associativity.
If zero, associativity is not defined for the operation.
If greater than zero, the operation has right-to-left associativity. Precedence value as defined based on this table. Higher value means higher precedence. Negative value is returned if the precedence is not defined for the specified expression. is returned for primitive expressions like .
Base class for JavaScript code formatters. Base JavaScript text writer (code formatter) which uses the most compact possible (i.e. minimal) format. A leading new line is required for the current trivia (i.e. it must start in a new line). A trailing new line is required for the current trivia (i.e. it must be followed by a new line). Surrounding new lines are required for the current trivia. The punctuator precedes the related token(s). The punctuator is somewhere in the middle of the related token(s). The punctuator follows the related token(s). The keyword follows the body of a statement and precedes another body of the same statement (e.g. the else branch of an ). A leading space is recommended for the current token (unless other white-space precedes it). May or may not be respected. (It is decided by the actual implementation.) A trailing space is recommended for the current token (unless other white-space follows it). May or may not be respected. (It is decided by the actual implementation.) Surrounding spaces are recommended for the current token (unless other white-spaces surround it). May or may not be respected. (It is decided by the actual implementation.) The statement must be terminated with a semicolon. If is set, determines if the semicolon can be omitted when the statement comes last in the current block (see ). Automatically propagated to child statements, should be set directly only for statement list items. Whether the semicolon is omitted or not is decided by the actual implementation. The statement comes last in the current statement list (more precisely, it is the right-most part in the textual representation of the current statement list). In the visitation handlers of the flag is interpreted differently: it indicates that the statement comes last in the parent statement. (Upon visiting a statement, this flag of the parent and child statement gets combined to determine its effective value for the current statement list.) The statement represents the body of another statement (e.g. the if branch of an ). The expression must be wrapped in brackets. The expression comes first in the current expression tree, more precisely, it is the left-most part in the textual representation of the currently visited expression tree (incl. brackets). In the visitation handlers of the flag is interpreted differently: it indicates that the expression comes first in the parent expression. (Upon visiting an expression, this flag of the parent and child expression gets combined to determine its effective value for the expression tree.) Gets or sets the arbitrary, user-defined data object associated with the current . The operation is not guaranteed to be thread-safe. In case concurrent access or update is possible, the necessary synchronization is caller's responsibility. Represents a writer that provides a fast, non-cached, forward-only way of generating streams or files containing JSON Text according to the grammar rules laid out in RFC 4627. Creates an instance which can be used for working around multiple inheritance: the returned instance re-routes visitations of JSX nodes to the specified , thus it can be used for emulating base class method calls. Creates an instance which can be used for working around multiple inheritance: the returned instance re-routes visitations of JSX nodes to the specified , thus it can be used for emulating base class method calls. JavaScript code formatter which implements the most commonly used K&R style. Map from an ASCII char to its hex value, e.g. arr['b'] == 11. 0xFF means it's not a hex digit. Applied to a method that will never return under any circumstance. Specifies that when a method returns , the parameter may be null even if the corresponding type disallows it. Initializes the attribute with the specified return value condition. The return value condition. If the method returns this value, the associated parameter may be null. Gets the return value condition. Reserved to be used by the compiler for tracking metadata. This class should not be used by developers in source code. Used to indicate to the compiler that the .locals init flag should not be set in method headers.