encodeParseOptions encodes the per-file ExternalModuleIndicatorOptions as a uint32 bitmask.
(opts ast.ExternalModuleIndicatorOptions)
| 291 | |
| 292 | // encodeParseOptions encodes the per-file ExternalModuleIndicatorOptions as a uint32 bitmask. |
| 293 | func encodeParseOptions(opts ast.ExternalModuleIndicatorOptions) uint32 { |
| 294 | var bits uint32 |
| 295 | if opts.JSX { |
| 296 | bits |= 1 |
| 297 | } |
| 298 | if opts.Force { |
| 299 | bits |= 2 |
| 300 | } |
| 301 | return bits |
| 302 | } |
| 303 | |
| 304 | // NodeIndexTable maps between AST nodes and their encoder indices for O(1) node handle resolution. |
| 305 | type NodeIndexTable struct { |