Contribute a grammar, along with associated tests, from the upstream project maintained at https://github.com/artagnon/tree-sitter-mlir. The new grammar includes several fixes, and successfully parses 60-80% of MLIR tests in the Arith, Math, ControlFlow, SCF, Tensor, Affine, and Linalg dialects. Differential Revision: https://reviews.llvm.org/D144408
28 lines
1.0 KiB
MLIR
28 lines
1.0 KiB
MLIR
func.func @test_addi(%arg0 : i64, %arg1 : i64) -> i64 {
|
|
// <- function.builtin
|
|
// ^ function
|
|
// ^ punctuation.bracket
|
|
// ^ variable.parameter
|
|
// ^ punctuation.delimeter
|
|
// ^ type.builtin
|
|
// ^ punctuation.delimeter
|
|
// ^ variable.parameter
|
|
// ^ type.builtin
|
|
// ^ punctuation.bracket
|
|
// ^ operator
|
|
// ^ type.builtin
|
|
// ^ punctuation.bracket
|
|
%0 = arith.addi %arg0, %arg1 : i64
|
|
// ^ variable
|
|
// ^ operator
|
|
// ^ function.builtin
|
|
// ^ variable.parameter
|
|
// ^ variable.parameter
|
|
// ^ type.builtin
|
|
return %0 : i64
|
|
// ^ function.builtin
|
|
// ^ variable
|
|
// ^ type.builtin
|
|
}
|
|
// <- punctuation.bracket
|