Skip to content

Add Mojo language support #737

Description

@Tokarzewski

Language

Mojo (Modular) — Python-superset systems language for AI/ML infra.

Grammar

lsh/tree-sitter-mojo
Forked from tree-sitter-python. MIT license, ABI 15, C scanner (no libstdc++).

  • Pinned commit: 33193a99afe6
  • License: MIT (vendored LICENSE byte-verified against upstream)
  • ABI: 15 (compatible with current runtime ceiling)
  • Scanner type: C (no C++ dependency)
  • Registries: Not in nvim-treesitter or Helix — community grammar

Integration scope

  • CBM_LANG_MOJO enum, grammar_mojo.c wrapper, extraction spec in lang_specs.c
  • Extensions: .mojo, .🔥
  • Spec reuses py_* arrays (node types mirror Python); overrides only class types
  • Mojo-specific: fn/deffunction_definition, struct/classclass_definition, trait/__extensiontrait_definition/extension_definition (Interface label), alias → captured via assignment

Verification

Tested against NuMojo (135 files) and EnergyPlusMojo + 7,354 generated files — 166K+ nodes, no crashes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestlanguage-requestRequest for new language supportparsing/qualityGraph extraction bugs, false positives, missing edgespriority/backlogValuable contribution, lower scheduling urgency; review when maintainer capacity opens.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions