Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
3494081
fix: add backslash to regex for macro parameter
Neptunium931 Mar 30, 2026
ac0225d
fix: add support for macros with arguments
Neptunium931 Mar 30, 2026
76ab3c0
fix: add defualt value for macro args
Neptunium931 Mar 30, 2026
265c7fe
feat: add prefix and infix operators
Neptunium931 Apr 2, 2026
945ead5
feat: add prefix operator and test
Neptunium931 Apr 2, 2026
080b49e
feat: add expressions and operators support
Neptunium931 Apr 2, 2026
5f1792e
feat: add tests for infix operators
Neptunium931 Apr 3, 2026
8e93857
feat: add multiple operation
Neptunium931 Apr 3, 2026
957a247
chore: tree-sitter generate
Neptunium931 Apr 3, 2026
0e769fe
refactor(corpus): move tests for macro to separate file
Neptunium931 May 4, 2026
965072c
feat(offset): add offset keyword
Neptunium931 May 4, 2026
236225d
chore: tree-sitter generate
Neptunium931 May 4, 2026
2ce54e5
fix: negative constants for AT&T syntax
Neptunium931 Jun 18, 2026
2b4b922
chore: tree-sitter generate
Neptunium931 Jun 18, 2026
6ff7e1a
fix: typo
Neptunium931 Jun 18, 2026
ad27821
refactor: renamed `sep` to `repeatSep` and added `sep` function
Neptunium931 Jun 18, 2026
b460a91
fix(AT&T): Added support for omitting arguments in memory addressing
Neptunium931 Jun 18, 2026
0f09239
chore: tree-sitter gernerate
Neptunium931 Jun 18, 2026
6cb7540
fix: Pointer offset arg, reg arg
Neptunium931 Jun 18, 2026
bebead5
chore: tree-sitter generate
Neptunium931 Jun 18, 2026
a291cea
Merge remote-tracking branch 'offsetKeyword' into release
Neptunium931 Jun 18, 2026
4e936a5
Merge branch 'omission' into release
Neptunium931 Jun 18, 2026
5bf4e29
Merge branch 'negative' into release
Neptunium931 Jun 18, 2026
5851ba1
Remove Ko-fi funding link
Neptunium931 Jul 9, 2026
141e345
Add GitHub funding information
Neptunium931 Jul 9, 2026
6dd33a2
Potential fix for code scanning alert no. 1: Workflow does not contai…
Neptunium931 Jul 9, 2026
a3e7466
Potential fix for code scanning alert no. 2: Workflow does not contai…
Neptunium931 Jul 9, 2026
be42bc3
feat: Add fork section to README (#3)
Neptunium931 Jul 9, 2026
304e1eb
Include LICENSE file when packaging
michel-slm Jun 29, 2026
8e3ddef
feat: update version and change maintainer
Neptunium931 Jul 9, 2026
212a6ab
feat: add java and zig bindings
Neptunium931 Jul 9, 2026
3fae6c2
chore: regenerate bindings
Neptunium931 Jul 9, 2026
52a9706
fix: fix intel pointers
Neptunium931 Jul 13, 2026
a61881c
feat(intel): add ptr index scale
Neptunium931 Aug 6, 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
25 changes: 17 additions & 8 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,14 @@ bindings/c/* linguist-generated
CMakeLists.txt linguist-generated
Makefile linguist-generated

# Rust bindings
bindings/rust/* linguist-generated
Cargo.toml linguist-generated
Cargo.lock linguist-generated
# Go bindings
bindings/go/* linguist-generated
go.mod linguist-generated
go.sum linguist-generated

# Java bindings
bindings/java/* linguist-generated
pom.xml linguist-generated

# Node.js bindings
bindings/node/* linguist-generated
Expand All @@ -26,12 +30,17 @@ bindings/python/** linguist-generated
setup.py linguist-generated
pyproject.toml linguist-generated

# Go bindings
bindings/go/* linguist-generated
go.mod linguist-generated
go.sum linguist-generated
# Rust bindings
bindings/rust/* linguist-generated
Cargo.toml linguist-generated
Cargo.lock linguist-generated

# Swift bindings
bindings/swift/** linguist-generated
Package.swift linguist-generated
Package.resolved linguist-generated

# Zig bindings
bindings/zig/* linguist-generated
build.zig linguist-generated
build.zig.zon linguist-generated
2 changes: 1 addition & 1 deletion .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
ko_fi: rubixdev
github: Neptunium931
3 changes: 3 additions & 0 deletions .github/workflows/ts_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ on:
pull_request:
branches: [ main ]

permissions:
contents: read

jobs:
test:
name: Tree-sitter grammar tests
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/typos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ on:
branches: [ main ]
pull_request:
branches: [ main ]
permissions:
contents: read
jobs:
run:
name: Spell Check with Typos
Expand Down
4 changes: 2 additions & 2 deletions CMakeLists.txt

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

9 changes: 6 additions & 3 deletions Cargo.toml

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

1 change: 1 addition & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
Copyright (c) 2023 RubixDev
Copyright (c) 2026, Tymothé BILLEREY <tymothe_billerey@fastmail.fr>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
4 changes: 2 additions & 2 deletions Makefile

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

5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
Generic assembly grammar for
[tree-sitter](https://github.com/tree-sitter/tree-sitter)

# Fork

This fork is a fork of the original [tree-sitter-asm](https://github.com/RubixDev/tree-sitter-asm)
grammar originally developed by [RubixDev](https://github.com/RubixDev).

## Usage in Neovim

### Parser Installation
Expand Down
7 changes: 6 additions & 1 deletion binding.gyp

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

File renamed without changes.
4 changes: 3 additions & 1 deletion bindings/go/binding.go

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

2 changes: 1 addition & 1 deletion bindings/go/binding_test.go

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

Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
package io.github.treesitter.jtreesitter.asm;

import java.lang.foreign.*;

public final class TreeSitterAsm {
private static final ValueLayout VOID_PTR =
ValueLayout.ADDRESS.withTargetLayout(MemoryLayout.sequenceLayout(Long.MAX_VALUE, ValueLayout.JAVA_BYTE));
private static final FunctionDescriptor FUNC_DESC = FunctionDescriptor.of(VOID_PTR);
private static final Linker LINKER = Linker.nativeLinker();
private static final TreeSitterAsm INSTANCE = new TreeSitterAsm();

private final Arena arena = Arena.ofAuto();
private volatile SymbolLookup lookup = null;

private TreeSitterAsm() {}

/**
* Get the tree-sitter language for this grammar.
*/
public static MemorySegment language() {
if (INSTANCE.lookup == null)
INSTANCE.lookup = INSTANCE.findLibrary();
return language(INSTANCE.lookup);
}

/**
* Get the tree-sitter language for this grammar.
*
* <strong>The {@linkplain Arena} used in the {@code lookup}
* must not be closed while the language is being used.</strong>
*/
public static MemorySegment language(SymbolLookup lookup) {
return call(lookup, "tree_sitter_asm");
}

private SymbolLookup findLibrary() {
try {
var library = System.mapLibraryName("tree-sitter-asm");
return SymbolLookup.libraryLookup(library, arena);
} catch (IllegalArgumentException ex1) {
try {
System.loadLibrary("tree-sitter-asm");
return SymbolLookup.loaderLookup();
} catch (UnsatisfiedLinkError ex2) {
ex1.addSuppressed(ex2);
throw ex1;
}
}
}

private static UnsatisfiedLinkError unresolved(String name) {
return new UnsatisfiedLinkError("Unresolved symbol: %s".formatted(name));
}

@SuppressWarnings("SameParameterValue")
private static MemorySegment call(SymbolLookup lookup, String name) throws UnsatisfiedLinkError {
var address = lookup.find(name).orElseThrow(() -> unresolved(name));
try {
var function = LINKER.downcallHandle(address, FUNC_DESC);
return (MemorySegment) function.invokeExact();
} catch (Throwable e) {
throw new RuntimeException("Call to %s failed".formatted(name), e);
}
}
}
12 changes: 12 additions & 0 deletions bindings/java/test/TreeSitterAsmTest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import io.github.treesitter.jtreesitter.Language;
import io.github.treesitter.jtreesitter.asm.TreeSitterAsm;
import org.junit.jupiter.api.Test;

import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;

public class TreeSitterAsmTest {
@Test
public void testCanLoadLanguage() {
assertDoesNotThrow(() -> new Language(TreeSitterAsm.language()));
}
}
1 change: 0 additions & 1 deletion bindings/node/binding.cc

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

12 changes: 7 additions & 5 deletions bindings/node/binding_test.js

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

40 changes: 36 additions & 4 deletions bindings/node/index.d.ts

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

42 changes: 34 additions & 8 deletions bindings/node/index.js

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

5 changes: 3 additions & 2 deletions bindings/python/tests/test_binding.py

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

Loading
Loading