17 Repos
Identifying code fragments using a combination of literals, regular expressions, and flexible AST bindings.
Distinct from Text Pattern Matching: Distinct from simple text search or binary matching; it operates on the structure of source code.
Explore 17 awesome GitHub repositories matching programming languages & runtimes · Structural Pattern Matching. Refine with filters or upvote what's useful.
xi-editor is a high-performance text editor core written in Rust. It employs a client-server architecture that separates the backend editor logic from the user interface, allowing diverse frontends to communicate with the core via a standardized protocol. The project is distinguished by its use of rope-based text buffers for efficient manipulation of large documents and a collaborative engine powered by conflict-free replicated data types to synchronize concurrent edits. It further features an extensible plugin system that integrates external binaries and third-party tools through JSON-based
Employs non-commutative monoids to track nesting balance for fast identification of matching parentheses and brackets.
Reason is a strongly typed functional language and multi-target compiler designed to produce either JavaScript for web environments or native machine code for operating systems. It serves as an OCaml-compatible language that shares an abstract syntax tree with OCaml, providing a practical syntax for the OCaml ecosystem. The project functions as a type-safe frontend language, incorporating JSX support to build user interfaces through structural elements that translate into type-safe function calls. It enables deep integration with the JavaScript ecosystem, allowing the use of existing librarie
Ships powerful structural pattern matching to execute conditional logic based on data shapes.
emmet-vim is a plugin for Vim that functions as a markup automation tool and code expander. It allows for the rapid generation of HTML and CSS structures by expanding shorthand text expressions into full code elements. The tool provides a set of shortcuts for wrapping, balancing, and manipulating tags. It includes a text object extension that enables navigation and editing commands for jumping between nested element boundaries. The project covers a range of capabilities for frontend code refactoring and document hierarchy restructuring. These include tag wrapping, element removal, attribute
Enables moving the cursor across element boundaries to navigate and edit nested structures quickly.
attrs is a Python library that automatically generates initialization, representation, equality, hashing, and ordering methods from declarative class attribute definitions. At its core, it provides a class decorator metaprogramming framework that intercepts class creation to rewrite the class body, producing dunder methods without manual boilerplate. The library includes a comprehensive attribute validation toolkit with built-in validators for type checks, range constraints, regex matching, length limits, and logical composition of validation rules. The library distinguishes itself through it
Generates match arguments to enable structural pattern matching on instances in Python 3.10+.
This is a TC39 proposal to add declarative pattern matching syntax to the ECMAScript language. It introduces a match expression that allows developers to inspect and branch on data structures using patterns with destructuring, guards, and logical combinators. The proposal defines a custom matcher protocol via a well-known symbol, enabling objects to implement user-defined matching logic with arbitrary extraction and decomposition. The proposal supports matching against literal primitives using SameValue equality with special handling for signed zero and NaN, as well as relational comparison
Extends language grammar with a match expression that destructures values against nested patterns declaratively.
Scala.js ist ein Compiler- und plattformübergreifendes Sprach-Toolchain-Projekt, das Scala-Quellcode in JavaScript oder WebAssembly transformiert. Es fungiert als statisch typisiertes Tool für das JavaScript-Ökosystem und ermöglicht die Entwicklung von Anwendungen für Webbrowser und Node.js-Umgebungen. Das Projekt dient als JavaScript-Interop-Framework, das die Erstellung typsicherer Facaden und Bindings ermöglicht, um mit externen Bibliotheken und globalen Objekten zu interagieren. Es bietet Mechanismen für sowohl statische als auch dynamische JavaScript-Aufrufe, einschließlich der Generierung von TypeScript-Bindings und der Möglichkeit, interne Logik für die Verwendung in externem JavaScript-Code zu exportieren. Die Toolchain enthält ein Frontend-Build-Tool für Production-Bundling und Output-Optimierung, einschließlich Dead-Code-Elimination und Modul-Splitting. Sie deckt ein breites Funktionsspektrum ab, einschließlich DOM-Element-Typ-Checking für UI-Entwicklung, plattformübergreifendes Code-Sharing für Full-Stack-Entwicklung sowie verschiedene Test-Frameworks zur Verifizierung optimierter Build-Artefakte. Kompilierte Skripte können direkt innerhalb einer Command-Line-Umgebung mittels eines JavaScript-Interpreters ausgeführt werden.
Extracts values from nested data structures using pattern matching to replace traditional conditional logic.
Vis ist ein terminalbasierter modaler Texteditor, der vi-Keybindings und ein System struktureller regulärer Ausdrücke verwendet. Er fungiert als skriptbare Umgebung, in der Lua für Konfiguration, benutzerdefinierte Tastenzuweisungen und Plugin-Entwicklung verwendet wird. Der Editor zeichnet sich durch ein Syntax-Highlighting-System aus, das auf Parsing Expression Grammars basiert, sowie durch eine Pattern-Matching-Engine, die Text als Struktur für komplexe Suchen-und-Ersetzen-Operationen behandelt. Er integriert sich zudem direkt in die System-Shell, sodass Benutzer Textbereiche an externe Befehle weiterleiten und die resultierende Ausgabe erfassen können. Das Projekt bietet breite Funktionen für die Textmanipulation, einschließlich der Verwendung mehrerer Cursor und Selektionen, eines gerichteten Graphen für nicht-lineare Undo- und Redo-Historien sowie einer Multi-Window-Schnittstelle, die über VT-100-Escape-Sequenzen gerendert wird. Benutzer können benutzerdefinierte Bewegungen und Operatoren über die eingebettete Skript-API definieren. Die Anwendung kann für Portabilität in eine einzige statisch gelinkte Binärdatei kompiliert werden.
Identifies text ranges using extended regular expressions to target specific patterns for commands.
c2rust is a source-to-source translation suite and C-to-Rust transpiler designed to convert C source code and libraries into functionally equivalent unsafe Rust code. It operates as a pipeline that preserves original behavior and data structures, producing translated code that compiles as compatible shared libraries or Rust crates. The system includes an automated Rust refactoring framework that uses pattern-based AST rewriting to transform unsafe Rust into safe, idiomatic constructs. It utilizes an ownership inference engine to determine when raw pointers can be converted into safe reference
Parses pattern strings into syntax fragments and matches them against source code to extract transformation bindings.
Sugar ist eine JavaScript-Utility-Bibliothek, die darauf ausgelegt ist, native Objekte und Prototypen um zusätzliche Methoden zur Datenmanipulation und -transformation zu erweitern. Sie fungiert als Toolkit für Objekt-Utilities, Datumsmanipulation, String-Inflektion und das Polyfilling fehlender oder fehlerhafter Standard-Sprachfunktionen. Die Bibliothek bietet die Möglichkeit, Utility-Methoden direkt auf eingebaute Prototypen zu mappen oder Werte in temporäre Objekte zu wrappen, um Method-Chaining zu ermöglichen, ohne globale Prototypen zu modifizieren. Sie enthält zudem ein Polyfill-System, um konsistentes Verhalten über verschiedene Ausführungsumgebungen hinweg sicherzustellen, indem fehlende moderne Sprachfunktionen implementiert werden. Die Funktionen umfassen internationale Datumsformatierung und das Parsen von humanisierten Datums-Strings. Die Bibliothek handhabt zudem natürliche Sprachverarbeitung durch String-Inflektion und Normalisierung, tiefe Eigenschaftstraversierung verschachtelter Objekte und locale-bewusste Array-Sortierung. Zusätzlich bietet sie Tools zum Klonen veränderbarer Objekte und zur Definition von Wertebereichen für Zahlen, Daten und Strings.
Simplifies array element matching using strings, regular expressions, or partial object shortcuts.
GritQL is an AST-based code transformation engine and structural search tool. It uses a declarative query language to identify and rewrite source code patterns across multiple programming languages by matching abstract syntax tree nodes rather than literal text. The system functions as an automated refactoring framework for large-scale migrations and API updates. It distinguishes itself by utilizing sequential transformation pipelines and reusable blueprints that can be synced between local environments and remote repositories. The tool covers a broad range of capabilities including static a
Restricts a pattern's matches to nodes that satisfy additional structural conditions like parent or sibling relationships.
Codemod is a set of software tools for performing structural source code transformations. It functions as an automated codebase migration tool that utilizes abstract syntax tree manipulations rather than simple regular expressions to execute large-scale refactors across multiple files. The project distinguishes itself through an interactive transformation interface that provides colored diffs, allowing users to manually review, accept, or modify each match. It also supports a distributed refactoring workflow, which enables the segmentation of a codebase into assigned work blocks to divide mig
Identifies specific code fragments using structural pattern matching based on AST bindings and regular expressions.
Memgraph is an in-memory, distributed graph database designed for high-performance labeled property graph management. It utilizes a Cypher query engine for declarative data retrieval and manipulation, providing a scalable knowledge graph backend that integrates vector search and graph traversals. The system distinguishes itself as a real-time graph analytics platform, employing native C++ and CUDA implementations to execute complex network analysis and dynamic community detection on streaming data. It provides specialized support for AI integration, including GraphRAG capabilities, the constr
Retrieves nodes and relationships that match structural patterns, labels, or paths.
FluentAssertions is a library of extension methods for .NET that provides a human-readable syntax for verifying expectations in unit tests. It serves as a validation layer that integrates with MSTest, NUnit, and xUnit to throw framework-specific exceptions upon assertion failure. The project includes a structural equivalency engine that performs deep member-by-member validation of .NET objects using configurable matching rules. It is designed for test-driven and behavior-driven development by generating descriptive failure messages that explain the difference between actual and expected resul
Provides a deep member-by-member validation engine for .NET objects with configurable matching rules.
OpenRewrite is an automated refactoring engine and source-to-source migration framework. It uses a lossless semantic tree parser to represent source code as type-aware trees that preserve original whitespace and formatting, enabling precise and deterministic modifications. The project utilizes a declarative refactoring pipeline where sequences of transformations are defined in YAML to resolve breaking changes and technical debt. It features type-aware pattern matching and cross-language model mapping to apply similar refactoring patterns across different programming languages. The framework
Identifies specific code structures using textual templates and AST bindings to extract parameters for transformations.
Places match on the same line as the method declaration and avoids expanding all arguments for type-only matches.
Comby is a command-line utility designed for structural code search and transformation across diverse programming languages. It functions as a code transformation engine that identifies and modifies source code patterns by utilizing syntax-aware templates, ensuring that operations respect language boundaries such as nested blocks, strings, and comments. The tool distinguishes itself by mapping various programming languages to a unified structural representation, allowing for consistent pattern matching that ignores irrelevant whitespace and formatting. It performs these operations by executin
Matches code patterns by parsing syntax boundaries into abstract templates that ignore irrelevant whitespace.
Z is a pattern matching library for JavaScript that evaluates variables against structural shapes, data types, and literal values to branch program execution conditionally. It functions as a functional programming utility designed to deconstruct arrays and objects into parts during conditional evaluation. The library transforms human-friendly pattern matching syntax into optimized nested conditional statements during compilation or initialization phases, evaluating complex structural conditions and returning matching branch results directly as standard expression values. It inspects runtime d
Evaluates target objects against structural templates to extract inner values and execute corresponding handler functions conditionally.