-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e168158
commit 849ae9f
Showing
21 changed files
with
86 additions
and
3 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
// Copyright (c) 2024, David Rubin <[email protected]> | ||
// | ||
// SPDX-License-Identifier: GPL-3.0-only | ||
|
||
const std = @import("std"); | ||
const CpythonStep = @import("build/CpythonStep.zig"); | ||
|
||
|
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
# Copyright (c) 2024, David Rubin <[email protected]> | ||
# | ||
# SPDX-License-Identifier: GPL-3.0-only | ||
|
||
import struct | ||
import matplotlib.pyplot as plt | ||
import networkx as nx | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
// Copyright (c) 2024, David Rubin <[email protected]> | ||
// | ||
// SPDX-License-Identifier: GPL-3.0-only | ||
|
||
//! A 3.10 CodeObject | ||
|
||
const std = @import("std"); | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
// Copyright (c) 2024, David Rubin <[email protected]> | ||
// | ||
// SPDX-License-Identifier: GPL-3.0-only | ||
|
||
//! A thin wrapper around the 2 bytes that makeup the bytecode | ||
|
||
const Instruction = @This(); | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
// Copyright (c) 2024, David Rubin <[email protected]> | ||
// | ||
// SPDX-License-Identifier: GPL-3.0-only | ||
|
||
//! Serialization of PYC files. | ||
|
||
const std = @import("std"); | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
// Copyright (c) 2024, David Rubin <[email protected]> | ||
// | ||
// SPDX-License-Identifier: GPL-3.0-only | ||
|
||
/// Object types | ||
pub const ObjType = enum(u8) { | ||
TYPE_NULL = '0', | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
// This file was autogenerated by tools/opcode2zig.zig | ||
// DO NOT EDIT | ||
// Copyright (c) 2024, David Rubin <[email protected]> | ||
// | ||
// SPDX-License-Identifier: GPL-3.0-only | ||
|
||
/// Op Codes | ||
pub const OpCode = enum(u8) { | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
// Copyright (c) 2024, David Rubin <[email protected]> | ||
// | ||
// SPDX-License-Identifier: GPL-3.0-only | ||
|
||
//! Overrides the panics to provide more information | ||
//! Slightly stolen from the Zig Compiler :P | ||
|
||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
// Copyright (c) 2024, David Rubin <[email protected]> | ||
// | ||
// SPDX-License-Identifier: GPL-3.0-only | ||
|
||
//! Inputs python source and outputs Bytecode | ||
|
||
pub const Error = error{ | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
// Copyright (c) 2024, David Rubin <[email protected]> | ||
// | ||
// SPDX-License-Identifier: GPL-3.0-only | ||
|
||
//! CPython bindings for compiling source code into bytecode. | ||
|
||
const std = @import("std"); | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
// Copyright (c) 2024, David Rubin <[email protected]> | ||
// | ||
// SPDX-License-Identifier: GPL-3.0-only | ||
|
||
//! Creates a temporal graph of a CodeObject | ||
|
||
const std = @import("std"); | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
// Copyright (c) 2024, David Rubin <[email protected]> | ||
// | ||
// SPDX-License-Identifier: GPL-3.0-only | ||
|
||
const std = @import("std"); | ||
const builtin = @import("builtin"); | ||
|
||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
// Copyright (c) 2024, David Rubin <[email protected]> | ||
// | ||
// SPDX-License-Identifier: GPL-3.0-only | ||
|
||
//! Scope References to builtin functions | ||
// NOTE: Builtin functions are expected to append their returns to the stack themselves. | ||
|
||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
// Copyright (c) 2024, David Rubin <[email protected]> | ||
// | ||
// SPDX-License-Identifier: GPL-3.0-only | ||
|
||
//! Logic to print a CodeObject in a tasteful manner. | ||
|
||
const std = @import("std"); | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
// Copyright (c) 2024, David Rubin <[email protected]> | ||
// | ||
// SPDX-License-Identifier: GPL-3.0-only | ||
|
||
const Object = @This(); | ||
|
||
const std = @import("std"); | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
// Copyright (c) 2024, David Rubin <[email protected]> | ||
// | ||
// SPDX-License-Identifier: GPL-3.0-only | ||
|
||
//! Virtual Machine that runs Python Bytecode blazingly fast | ||
|
||
const std = @import("std"); | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
// Copyright (c) 2024, David Rubin <[email protected]> | ||
// | ||
// SPDX-License-Identifier: GPL-3.0-only | ||
|
||
//! Handles error creation, serialisation, and printing | ||
|
||
const std = @import("std"); | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
// Copyright (c) 2024, David Rubin <[email protected]> | ||
// | ||
// SPDX-License-Identifier: GPL-3.0-only | ||
|
||
const std = @import("std"); | ||
const matrix = @import("matrix.zig"); | ||
|
||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
// Copyright (c) 2024, David Rubin <[email protected]> | ||
// | ||
// SPDX-License-Identifier: GPL-3.0-only | ||
|
||
const std = @import("std"); | ||
const File = std.fs.File; | ||
const Allocator = std.mem.Allocator; | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
// Copyright (c) 2024, David Rubin <[email protected]> | ||
// | ||
// SPDX-License-Identifier: GPL-3.0-only | ||
|
||
//! Converts "opcode.h" into a zig enum. | ||
|
||
const std = @import("std"); | ||
|