## Index

### Type aliases

- ParseOptions

### Functions

- parse
- parseValue

## Type aliases

### ParseOptions

ParseOptions: { noLocation: boolean; noSource: boolean }

- Defined in src/parser.ts:47

Configuration options to control parser behavior

#### Type declaration

- ##### noLocation: boolean

  By default, the parser creates AST nodes that know the location in the source that they correspond to. This configuration flag disables that behavior for performance or testing.

- ##### noSource: boolean

## Functions

### parse

- parse(source: string, options?: ParseOptions): Document

- - Defined in src/parser.ts:62

  Given a WIDL source, parses it into a Document. Throws WidlError if a syntax error is encountered.

  #### Parameters

  - ##### source: string

  - ##### Optional options: ParseOptions

  #### Returns Document

### parseValue

- parseValue(source: string, options?: ParseOptions): Value

- - Defined in src/parser.ts:77

  Given a string containing a WIDL value (ex. `[42]`), parse the AST for that value. Throws WidlError if a syntax error is encountered.

  This is useful within tools that operate upon WIDL Values directly and in isolation of complete WIDL documents.

  Consider providing the results to the utility function: valueFromAST().

  #### Parameters

  - ##### source: string

  - ##### Optional options: ParseOptions

  #### Returns Value

Generated using TypeDoc