17 مستودعات
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 هو مترجم وسلسلة أدوات لغة عبر المنصات تحول كود مصدر Scala إلى JavaScript أو WebAssembly. تعمل كأداة مكتوبة بشكل ثابت لنظام JavaScript البيئي، مما يتيح تطوير تطبيقات لمتصفحات الويب وبيئات Node.js. يعمل المشروع كإطار عمل للتوافق مع JavaScript، مما يسمح بإنشاء واجهات وربط آمنة للأنواع للتفاعل مع المكتبات الخارجية والكائنات العالمية. يوفر آليات لاستدعاء JavaScript الثابت والديناميكي، بما في ذلك إنشاء روابط TypeScript والقدرة على تصدير المنطق الداخلي للاستخدام في كود JavaScript خارجي. تتضمن سلسلة الأدوات أداة بناء واجهة أمامية لتجميع الإنتاج وتحسين المخرجات، بما في ذلك إزالة الكود الميت وتقسيم الوحدات. تغطي مساحة واسعة من القدرات بما في ذلك التحقق من نوع عنصر DOM لتطوير واجهة المستخدم، ومشاركة الكود عبر المنصات للتطوير الكامل (full-stack)، وأطر اختبار متنوعة للتحقق من عناصر البناء المحسنة. يمكن تنفيذ النصوص المجمعة مباشرة داخل بيئة سطر الأوامر باستخدام مترجم JavaScript.
Extracts values from nested data structures using pattern matching to replace traditional conditional logic.
Vis هو محرر نصوص قائم على الطرفية (terminal) يستخدم اختصارات vi ونظاماً من التعبيرات النمطية الهيكلية. يعمل كبيئة قابلة للبرمجة حيث يتم استخدام Lua للتكوين، وتعيينات المفاتيح المخصصة، وتطوير الإضافات. يتميز المحرر بنظام تمييز الصيغة القائم على قواعد التعبير النمطي (Parsing Expression Grammars) ومحرك مطابقة أنماط يعامل النص كهيكل لعمليات البحث والاستبدال المعقدة. كما يتكامل مباشرة مع صدفة النظام (shell)، مما يسمح للمستخدمين بتوجيه نطاقات النص إلى أوامر خارجية والتقاط المخرجات الناتجة. يوفر المشروع قدرات واسعة لمعالجة النصوص، بما في ذلك استخدام مؤشرات وتحديدات متعددة، ومخطط موجه لسجل التراجع والإعادة غير الخطي، وواجهة متعددة النوافذ يتم عرضها عبر تسلسلات هروب VT-100. يمكن للمستخدمين تحديد حركات وعوامل تشغيل مخصصة من خلال واجهة برمجة التطبيقات النصية المضمنة. يمكن تجميع التطبيق في ملف ثنائي واحد مرتبط ساكناً لسهولة النقل.
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 هي مكتبة أدوات JavaScript مصممة لتوسيع الكائنات والنماذج الأولية الأصلية بطرق إضافية لمعالجة البيانات وتحويلها. تعمل كمجموعة أدوات لكائنات الأدوات، ومعالجة التاريخ، وتصريف السلاسل، وتعبئة الميزات اللغوية القياسية المفقودة أو المعطلة. توفر المكتبة القدرة على تعيين طرق الأداة مباشرة على النماذج الأولية المدمجة أو تغليف القيم في كائنات مؤقتة لتمكين تسلسل الطرق دون تعديل النماذج الأولية العالمية. كما تتضمن نظام تعبئة لضمان سلوك متسق عبر بيئات تنفيذ مختلفة من خلال تنفيذ وظائف اللغة الحديثة المفقودة. تشمل القدرات تنسيق التاريخ الدولي وتحليل سلاسل التاريخ المؤنسنة. تتعامل المكتبة أيضاً مع معالجة اللغة الطبيعية من خلال تصريف السلاسل والتطبيع، واجتياز الخصائص العميق للكائنات المتداخلة، وفرز المصفوفات المدرك للمحلية. بالإضافة إلى ذلك، توفر أدوات لاستنساخ الكائنات القابلة للتغيير وتحديد نطاقات القيم للأرقام والتواريخ والسلاسل.
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 هي مجموعة من أدوات البرمجيات لإجراء تحويلات هيكلية للكود المصدري. تعمل كأداة لأتمتة ترحيل قاعدة الكود تستخدم معالجات شجرة بناء الجملة المجردة (AST) بدلاً من التعبيرات النمطية البسيطة لتنفيذ عمليات إعادة هيكلة واسعة النطاق عبر ملفات متعددة. يتميز المشروع بواجهة تحويل تفاعلية توفر فروقات ملونة، مما يسمح للمستخدمين بمراجعة كل تطابق يدوياً أو قبوله أو تعديله. كما يدعم سير عمل إعادة الهيكلة الموزع، والذي يمكن من تقسيم قاعدة الكود إلى كتل عمل مخصصة لتقسيم مهام الترحيل بين مساهمين متعددين. تغطي مجموعة الأدوات إمكانيات واسعة لمنطق التحويل القابل للبرمجة، ومحركات بحث مطابقة الأنماط، وتصفية الملفات القائمة على الإضافات لتقييد العمليات على مجموعات فرعية محددة من المشروع.
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 هي أداة سطر أوامر مصممة للبحث عن الكود الهيكلي والتحويل عبر لغات برمجة متنوعة. تعمل كمحرك لتحويل الكود يحدد ويعدل أنماط الكود المصدري باستخدام قوالب مدركة للبنية (syntax-aware)، مما يضمن أن العمليات تحترم حدود اللغة مثل الكتل المتداخلة، والسلاسل، والتعليقات. تتميز الأداة بتعيين لغات برمجة مختلفة إلى تمثيل هيكلي موحد، مما يسمح بمطابقة أنماط متسقة تتجاهل المسافات البيضاء والتنسيق غير ذي الصلة. تقوم بهذه العمليات عن طريق تنفيذ مهام البحث والاستبدال من خلال آلة حالة تتحقق من السلامة الهيكلية، مما يتيح تعديلات دقيقة مع الحفاظ على المسافة البادئة الأصلية والاصطلاحات الأسلوبية لملفات المصدر. بعيداً عن البحث والاستبدال البسيط، تدعم الأداة عمليات ترحيل قاعدة الكود واسعة النطاق وإعادة الهيكلة الآلية من خلال تطبيق تحديثات البنية على مستوى المشروع. يمكن للمستخدمين التحقق من هذه التعديلات من خلال واجهة طرفية تفاعلية، والتي تسمح بفحص وتسوية التغييرات بشكل انتقائي قبل الالتزام بها في نظام الملفات.
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.