* @param {ParserState} state parser state * @param {TopLevelSymbol | null} symbol the symbol, or null for all symbols * @param {Usage} usage usage data * @returns {void}
(state, symbol, usage)
| 222 | * @returns {void} |
| 223 | */ |
| 224 | function addUsage(state, symbol, usage) { |
| 225 | const innerGraphState = getState(state); |
| 226 | |
| 227 | if (innerGraphState) { |
| 228 | const { innerGraph } = innerGraphState; |
| 229 | const info = innerGraph.get(symbol); |
| 230 | if (usage === true) { |
| 231 | innerGraph.set(symbol, true); |
| 232 | } else if (info === undefined) { |
| 233 | innerGraph.set(symbol, new Set([usage])); |
| 234 | } else if (info !== true) { |
| 235 | info.add(usage); |
| 236 | } |
| 237 | } |
| 238 | } |
| 239 | |
| 240 | /** |
| 241 | * @param {JavascriptParser} parser the parser |
no test coverage detected