Skip to content

Instantly share code, notes, and snippets.

View shreyassanthu77's full-sized avatar

Shreyas Mididoddi shreyassanthu77

View GitHub Profile
@shreyassanthu77
shreyassanthu77 / parser.ts
Created January 4, 2025 16:56
ts function extraction using tree sitter
import Parser from "npm:tree-sitter";
import treeSitterTypescript from "npm:tree-sitter-typescript";
const code = `
/**
* This is a doc comment
*
* alsdkfjlkj
*/
function foo(a: A): void;
@shreyassanthu77
shreyassanthu77 / xml.zig
Last active August 26, 2025 00:12
A very minimal and dumb xml parser written in zig
const std = @import("std");
const Self = @This();
source: [:0]const u8,
pos: usize = 0,
state: State = .start,
pub fn next(self: *Self) !Token {
var start = self.pos;
var text_end: usize = 0;