Skip to content

Commit

Permalink
Testing for tree-sitter backend
Browse files Browse the repository at this point in the history
  • Loading branch information
chaserhkj committed Dec 10, 2023
1 parent 1092f0c commit 3ca65d9
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions testing/src/ParameterizedTests.hs
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,7 @@ parameters = concat
, javaParams { tpName = "Java (with jflex and line numbers)"
, tpBnfcOptions = ["--java", "--jflex", "-l"] }
]
, [ treeSitter ]
]
where
base = baseParameters
Expand All @@ -442,6 +443,14 @@ parameters = concat
, tpBnfcOptions = ["--ocaml"]
, tpRunTestProg = haskellRunTestProg
}
treeSitter = TP
{ tpName = "tree-sitter"
, tpBuild = do
cmd "tree-sitter" "generate" . (:[]) =<< findFile "grammar.js"
, tpBnfcOptions = ["--tree-sitter"]
, tpRunTestProg = \ _lang args -> do
cmd "tree-sitter" "parse" args
}

-- | Helper function that runs bnfc with the context's options and an
-- option to generate 'tpMakefile'.
Expand Down

0 comments on commit 3ca65d9

Please sign in to comment.