This is an archive of the discontinued LLVM Phabricator instance.

[mlir] Add basic tree-sitter grammar file
ClosedPublic

Authored by jpienaar on Apr 24 2022, 3:29 PM.

Details

Summary

tree-sitter grammar file that tries to closely matches LangRef (it could use
some tweaking and cleanup, but kept fairly basic). Also updated LangRef in
places where found some issues while doing the nearly direct transcription.

This only adds a grammar file, not all the other parts (npm etc) that
accompanies it. Those I'll propose for separate repo like we do for vscode
extension.

Diff Detail

Event Timeline

jpienaar created this revision.Apr 24 2022, 3:29 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 24 2022, 3:29 PM
jpienaar requested review of this revision.Apr 24 2022, 3:29 PM
jpienaar updated this revision to Diff 424920.Apr 25 2022, 8:21 AM

Reformat

(was using the wrong formatter)

rriddle accepted this revision.Apr 26 2022, 1:58 PM

LG to start. Would also like the prec.left TODO comment to be clarified/removed. It isn't very actionable/descriptive at the moment.

mlir/utils/tree-sitter-mlir/grammar.js
95

Can you clarify this?

162

sigh, we need to remove the type from type aliases. That was a mistake IMO (my fault). I'll send a followup for that soon.

196

What is prec.left?

This revision is now accepted and ready to land.Apr 26 2022, 1:58 PM
This revision was automatically updated to reflect the committed changes.
jpienaar marked 3 inline comments as done.