Add Ada language support via tree-sitter-ada#1493
Open
guglxni wants to merge 1 commit into
Open
Conversation
Add extract_ada() with full AST extraction for Ada source files. Handles packages (spec and body), subprograms (procedures, functions, expression functions, null procedures), types (record, derived, interface, array, access, enumeration), subtypes, tasks, protected objects, entries, generics (packages and instantiations), exceptions, object declarations, and renaming declarations. Edge types emitted: - defines: scopes to their declarations - imports: with/use clauses to referenced modules - calls: subprogram bodies to called functions/procedures - inherits: derived types and subtypes to parent types - implements: types implementing interfaces - instantiates: generic instantiations to generic packages - references: type annotations, exception handlers, raise statements, and renaming declarations to their targets Files: - graphify/extract.py: extract_ada() implementation - graphify/detect.py: .ada/.adb/.ads in CODE_EXTENSIONS - pyproject.toml: tree-sitter-ada>=0.1.0 dependency - tests/fixtures/sample.ads: spec fixture - tests/fixtures/sample.adb: body fixture - tests/test_languages.py: 40 tests - README.md: 36 -> 37 grammars Closes Graphify-Labs#1491
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
extract_ada()for.ada,.adb, and.adsfiles using tree-sitter-ada.What it extracts
Packages (spec and body), subprograms (procedures, functions, expression functions, null procedures), types (record, derived, interface, array, access, enumeration), subtypes, tasks (type and single), protected objects (type and single), entries, generics (packages and instantiations), exceptions, object declarations, and renaming declarations.
Edges emitted
definesimportswith/useclausescallsinheritsimplementsinstantiatesreferencesraisetargets, renaming targetsChanges
graphify/extract.py—extract_ada()implementation with custom tree walkgraphify/detect.py—.ada,.adb,.adsadded toCODE_EXTENSIONSpyproject.toml—tree-sitter-ada>=0.1.0dependencytests/fixtures/sample.ads— spec fixture covering all constructstests/fixtures/sample.adb— body fixturetests/test_languages.py— 40 testsREADME.md— grammar count 36 → 37Closes #1491