원클릭으로
tree-sitter-parse-testing
Use when testing tree-sitter parser behavior for specific F# code snippets
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Use when testing tree-sitter parser behavior for specific F# code snippets
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
| name | tree-sitter-parse-testing |
| description | Use when testing tree-sitter parser behavior for specific F# code snippets |
Use tree-sitter parse -d to debug parsing issues. The debug output shows the state machine transitions, helping identify where parsing fails.
Run from the parser directory (fsharp/ or fsharp_signature/):
echo 'let x = 1' | npx tree-sitter parse -d
(file [0, 0] - [1, 0]
(declaration_expression [0, 0] - [0, 9]
...))
(nodename [start_row, start_col] - [end_row, end_col])(ERROR [0, 0] - [0, 7]
...)
(MISSING identifier [0, 8] - [0, 8])
Key patterns to look for:
| Pattern | Meaning |
|---|---|
detect_error | Parser encountered unexpected token |
recover_with_missing | Parser inserted placeholder to recover |
recover_with_error | Parser skipped tokens to recover |
shift state:N | Parser shifted to state N |
reduce sym:X | Parser reduced using rule X |
accept | Parse completed successfully |
-d to see the tree-d to see the debug outputdetect_error near the problem locationIf the debug output repeatedly emits the same token or state indefinitely, the parser has entered an infinite loop. This typically happens when:
src/scanner.c) is returning tokens that don't advance the parse position** Symptoms:**
accept or an error stateWhat to do:
# 1. See the parse tree
echo 'type X = ' | npx tree-sitter parse
# 2. Debug output shows recovery
echo 'type X = ' | npx tree-sitter parse -d | grep -A5 detect_error
The debug output shows the parser detecting an error at column 8 and recovering by inserting a MISSING identifier.
-d, find detect_error, check what tokens were expected