Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
80 commits
Select commit Hold shift + click to select a range
e8fddde
add mojo support
lsh May 11, 2024
0bacd0a
add struct
lsh May 11, 2024
ccb3092
.
lsh May 11, 2024
9812fbb
.
lsh May 11, 2024
82d067d
.
lsh May 12, 2024
a278add
.
lsh May 12, 2024
a73662e
add alias
lsh May 12, 2024
4519ca7
add mlir builtins
lsh May 12, 2024
196adc3
cleanup
lsh May 12, 2024
cd30edd
more builtin functions
lsh May 12, 2024
d292976
better highlighting
lsh May 12, 2024
c330ab1
better paramter support
lsh May 12, 2024
0a71ddb
more tweaks
lsh May 13, 2024
4f50343
mlir_type highlighting
lsh May 14, 2024
ac8f43c
mlir_type highlighting
lsh May 14, 2024
20e25a9
mlir_type highlighting
lsh May 14, 2024
1f7420d
mlir_type highlighting
lsh May 14, 2024
7f6ce3b
another attempt
lsh May 14, 2024
cb62c92
just a test
lsh May 14, 2024
852c7a5
cursory mlir highlighting and more keywords
lsh May 17, 2024
0ceea99
Add traits support
dmitry-salin May 17, 2024
e77ab67
Merge pull request #2 from dmitry-salin/trait
lsh Jun 5, 2024
15dfe5f
support for ref argument convention
lsh Jun 5, 2024
640c06b
support for ref argument return position
lsh Jun 5, 2024
cbfe368
tiny update
lsh Dec 3, 2024
0d82f32
Merge pull request #5 from lsh/lsh/mut-read-kw
lsh Dec 3, 2024
7557b0c
add out keyword
lsh Dec 3, 2024
d54ce80
Merge pull request #6 from lsh/lsh/out-keyword
lsh Dec 3, 2024
764849b
tiny update
lsh Dec 3, 2024
1052bf8
add `__disable_del` keyword
lsh Dec 7, 2024
fd1e06d
change alias to comptime
lsh Dec 24, 2025
209f6dc
update argument conventions
lsh Dec 24, 2025
46eed8e
Add support for some things like typed raises and tests
lsh Dec 25, 2025
406ba41
Support unified closures
lsh Dec 25, 2025
dbb2fe4
support where clauses and asserts
lsh Dec 25, 2025
03966fb
Merge pull request #8 from lsh/lsh/update
lsh Dec 25, 2025
06df289
Support function effects without a return type
kbenzie Jun 16, 2026
c1724a9
Support compositional function effects, `thin`, and `capturing[_]`
kbenzie Jun 16, 2026
7bcedd0
Support the postfix transfer/consume operator `x^`
kbenzie Jun 16, 2026
e621593
Support comptime control-flow statements
kbenzie Jun 16, 2026
1c95959
Support infer markers, separators, defaults and empty type-parameter …
kbenzie Jun 16, 2026
e8916ce
Admit `mut`/`out` as identifiers in parameter and argument positions
kbenzie Jun 16, 2026
2fd70ea
Support empty and keyword-argument subscripts
kbenzie Jun 16, 2026
983e182
Support parameterized comptime aliases
kbenzie Jun 16, 2026
b19ab85
Support brace-delimited result conventions
kbenzie Jun 16, 2026
57717f8
Support callable type literals
kbenzie Jun 16, 2026
510b01b
Support a typed `self` parameter
kbenzie Jun 16, 2026
64d8cb8
Support struct/initializer literals
kbenzie Jun 16, 2026
07a437d
Support the bare `ref` convention and conventions on variadics
kbenzie Jun 16, 2026
6325627
Support MLIR interop constructs
kbenzie Jun 16, 2026
0c7d2b8
Support parameterized callable types
kbenzie Jun 16, 2026
566aab9
Support a type bound on a parameterized comptime alias
kbenzie Jun 16, 2026
013df04
Support `where` clauses in a struct conformance list
kbenzie Jun 16, 2026
fd531ec
Support a slice value in a subscript keyword argument
kbenzie Jun 16, 2026
4edf4a1
Support a typed `raises` without a return type
kbenzie Jun 16, 2026
a03e183
Admit `read`/`mut`/`out` as ordinary identifiers
kbenzie Jun 16, 2026
25358b7
Support names in a capture/result convention clause
kbenzie Jun 16, 2026
044eb3b
Support a called parametric instantiation in type position
kbenzie Jun 16, 2026
5a3e64f
Support backtick identifiers as binding names
kbenzie Jun 16, 2026
68b8fef
Support a call result as an assignment target
kbenzie Jun 16, 2026
4aa1063
Support `__extension` declarations
kbenzie Jun 16, 2026
878366b
Support argument conventions on callable-type parameters
kbenzie Jun 16, 2026
df15851
Support relative `import .module`
kbenzie Jun 16, 2026
076f7be
Support a convention on a for loop variable
kbenzie Jun 16, 2026
e1d1b9d
Support the `abi(...)` function qualifier
kbenzie Jun 16, 2026
c5caa8f
Support `comptime` applied to a parenthesized expression
kbenzie Jun 16, 2026
2fcb0b4
Support the `&` intersection type operator
kbenzie Jun 16, 2026
e012d07
Support a decorator on a comptime alias
kbenzie Jun 16, 2026
90ff78f
Support a multi-argument `ref[...]` convention
kbenzie Jun 16, 2026
681d08f
Highlight MLIR backtick fragments as MLIR, not strings
kbenzie Jun 16, 2026
5fd766a
Tokenize MLIR backtick fragment interiors for highlighting
kbenzie Jun 16, 2026
33193a9
Merge pull request #10 from kbenzie/benie/june26-updates
lsh Jun 16, 2026
95726f1
Clean up Mojo project metadata
jph00 Jun 20, 2026
75a6faf
Remove dangling references to deleted queries/tags.scm
chriselrod Aug 19, 2026
9f839d0
Merge pull request #12 from chriselrod/fix-missing-tags-scm
lsh Aug 20, 2026
cd42384
Merge branch 'main' into fix-mojo-metadata
lsh Aug 20, 2026
b3dbc35
Merge pull request #11 from jph00/fix-mojo-metadata
lsh Aug 20, 2026
dafb67e
Update grammar to current Mojo (1.1.0.dev)
lsh Sep 9, 2026
0783f70
Remove MLIR-specific handling
lsh Sep 9, 2026
9d92a7b
Refactor `type` to share the expression grammar
lsh Sep 9, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ body:
- type: markdown
attributes:
value: |
**Before** reporting an issue, make sure to search [existing issues](https://github.com/tree-sitter/tree-sitter-python/issues). Usage questions such as ***"How do I...?"*** either belong in [Discussions](https://github.com/tree-sitter/tree-sitter/discussions) upstream or in our [Discord server](https://discord.gg/w7nTvsVJhm) and will be closed.
**Before** reporting an issue, make sure to search [existing issues](https://github.com/lsh/tree-sitter-mojo/issues). Usage questions such as ***"How do I...?"*** either belong in [Discussions](https://github.com/tree-sitter/tree-sitter/discussions) upstream or in our [Discord server](https://discord.gg/w7nTvsVJhm) and will be closed.
If your issue is related to a bug in your editor-experience because your editor *leverages* tree-sitter and this parser, then it is likely your issue does *NOT* belong here and belongs in the relevant editor's repository.
- type: checkboxes
attributes:
Expand All @@ -15,7 +15,7 @@ body:
options:
- label: I have read all the [tree-sitter docs](https://tree-sitter.github.io/tree-sitter/using-parsers) if it relates to using the parser
required: false
- label: I have searched the existing issues of tree-sitter-python
- label: I have searched the existing issues of tree-sitter-mojo
required: true
- type: input
attributes:
Expand Down Expand Up @@ -51,9 +51,9 @@ body:
description: Minimal code to reproduce this issue. Ideally this should be reproducible with the C library or the tree-sitter cli, do not suggest an editor or external tool.
value: |
# Example code that causes the issue
def foo():
fn foo():
# Code that fails to parse, or causes an error
...
render: Python
render: Mojo
validations:
required: false
18 changes: 4 additions & 14 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: CI

on:
push:
branches: [master]
branches: [main]
paths:
- grammar.js
- src/**
Expand Down Expand Up @@ -42,19 +42,9 @@ jobs:
test-python: true
test-go: true
test-swift: true
- name: Set up examples
run: |-
git clone https://github.com/numpy/numpy examples/numpy --single-branch --depth=1 --filter=blob:none
git clone https://github.com/django/django examples/django --single-branch --depth=1 --filter=blob:none
git clone https://github.com/pallets/flask examples/flask --single-branch --depth=1 --filter=blob:none
git clone https://github.com/python/cpython examples/cpython --single-branch --depth=1 --filter=blob:none
- name: Parse examples
- name: Parse Mojo examples
uses: tree-sitter/parse-action@v4
with:
files: |
examples/**/*.py
!examples/cpython/Lib/test/test_annotationlib.py
!examples/cpython/Lib/test/test_compile.py
!examples/cpython/Lib/test/test_type_params.py
invalid-files: |
examples/cpython/Lib/test/tokenizedata/badsyntax_3131.py
test/**/*.mojo
test.mojo
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ _obj/

# Python artifacts
.venv/
__pycache__/
*.py[cod]
dist/
*.egg-info
*.whl
Expand Down Expand Up @@ -45,3 +47,5 @@ zig-out/
*.tar.gz
*.tgz
*.zip

.helix
31 changes: 15 additions & 16 deletions CMakeLists.txt

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

98 changes: 54 additions & 44 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions Cargo.toml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading