@@ -6,55 +6,55 @@ const parseTimescale = require('./parse-time-scale.js');
66
77/**
88 * Returns a function that handles the 'enddefinitions' message from the VCD worker.
9- *
9+ *
1010 * When the worker sends this message, it indicates that the VCD parser has finished
1111 * processing the definitions section (everything before $enddefinitions), containing
1212 * signal hierarchy and metadata.
13- *
13+ *
1414 * @param {Object } $ - Application context object
1515 * @param {Object } $.cnt1 - Container object with parser state
1616 * @param {Object } $.cnt1.pstate - Parser state object
1717 * @param {Object } $.memI64 - BigInt64Array view of WASM memory
1818 * @param {Object } $.state - Application state object
1919 * @param {boolean } $.state.vcdDefinitionsParsed - Flag indicating definitions are parsed
20- *
20+ *
2121 * Handler Behavior:
2222 * 1. Receives VCD definitions data (signal hierarchy, timescale, etc.)
2323 * 2. Stores definitions in application context
2424 * 3. Configures parser state with timing information
2525 * 4. Updates time values from WASM memory
2626 * 5. Sets definitions parsed flag
27- *
27+ *
2828 * @example
2929 * ```javascript
3030 * const $ = appContext();
3131 * $.workerHandlo = {};
3232 * $.workerHandlo.enddefinitions = handleEnddefinitions($);
33- *
33+ *
3434 * // Handler will be called when worker sends:
3535 * // postMessage({
36- * // cmd: 'enddefinitions',
36+ * // cmd: 'enddefinitions',
3737 * // data: {
3838 * // wires: {...}, // Signal hierarchy
3939 * // timescale: '1ns' // Time unit
4040 * // }
4141 * // });
4242 * ```
43- *
43+ *
4444 * Data Structure:
4545 * The enddefinitions data typically contains:
4646 * - `wires`: Hierarchical signal definitions
4747 * - `timescale`: VCD timescale specification (e.g., "1ns", "1ps")
4848 */
4949const handleEnddefinitions = ( $ ) => async ( e ) => {
5050 console . log ( 'rx: enddefinitions' ) ; // eslint-disable-line no-console
51-
51+
5252 // Extract definitions data from worker message
5353 const { data} = e . data ;
54-
54+
5555 // Store definitions in application context for later use
5656 $ . enddefinitions = data ;
57-
57+
5858 // Configure parser state with timing information
5959 $ . cnt1 . pstate . timescale = parseTimescale ( data . timescale ) ;
6060
0 commit comments