修复了大量存在的问题,增加了假鸭子类型等等机制
This commit is contained in:
159
Test/ForAndLoopTest/App/main.py
Normal file
159
Test/ForAndLoopTest/App/main.py
Normal file
@@ -0,0 +1,159 @@
|
||||
import t
|
||||
import c
|
||||
import stdio
|
||||
import stdlib
|
||||
import string
|
||||
import mbuddy
|
||||
import testcheck
|
||||
import _fakeduck
|
||||
|
||||
|
||||
def test_for_in_range():
|
||||
testcheck.section("Test 1: for i in range(n)")
|
||||
s: t.CInt = 0
|
||||
for i in range(10):
|
||||
s += i
|
||||
testcheck.check(s == 45, "range sum OK (45)", "range sum FAILED expect 45")
|
||||
|
||||
|
||||
def test_for_in_str():
|
||||
testcheck.section("Test 2: for ch in str")
|
||||
cnt: t.CInt = 0
|
||||
for ch in "hello":
|
||||
cnt += 1
|
||||
testcheck.check(cnt == 5, "str iter OK (5)", "str iter FAILED expect 5")
|
||||
|
||||
|
||||
def test_for_in_list():
|
||||
testcheck.section("Test 3: for v in list[str]")
|
||||
arena: bytes = stdlib.malloc(65536)
|
||||
bd: mbuddy.MBuddy | t.CPtr = mbuddy.MBuddy(arena, 65536)
|
||||
src: str = "x,y,z,w"
|
||||
src.__mbuddy__ = bd
|
||||
lst: list[str] = src.split(',')
|
||||
total: t.CInt = 0
|
||||
for v in lst:
|
||||
total += 1
|
||||
testcheck.check(total == 4, "list iter OK (4)", "list iter FAILED expect 4")
|
||||
stdlib.free(arena)
|
||||
|
||||
|
||||
def test_zip_list_list():
|
||||
testcheck.section("Test 4: zip(list, list)")
|
||||
arena: bytes = stdlib.malloc(65536)
|
||||
bd: mbuddy.MBuddy | t.CPtr = mbuddy.MBuddy(arena, 65536)
|
||||
a: str = "a,b,c"
|
||||
a.__mbuddy__ = bd
|
||||
b: str = "1,2,3"
|
||||
b.__mbuddy__ = bd
|
||||
la: list[str] = a.split(',')
|
||||
lb: list[str] = b.split(',')
|
||||
cnt: t.CInt = 0
|
||||
for ca, cb in zip(la, lb):
|
||||
stdio.printf("zip[%d]: '%s'='%s'\n", cnt, ca, cb)
|
||||
cnt += 1
|
||||
testcheck.check(cnt == 3, "zip list+list OK (3)", "zip list+list FAILED")
|
||||
stdlib.free(arena)
|
||||
|
||||
|
||||
def test_zip_range_list():
|
||||
testcheck.section("Test 5: zip(range, list)")
|
||||
arena: bytes = stdlib.malloc(65536)
|
||||
bd: mbuddy.MBuddy | t.CPtr = mbuddy.MBuddy(arena, 65536)
|
||||
s: str = "p,q,r"
|
||||
s.__mbuddy__ = bd
|
||||
lst: list[str] = s.split(',')
|
||||
cnt: t.CInt = 0
|
||||
for n, v in zip(range(3), lst):
|
||||
stdio.printf("zip range+list[%d]: %d='%s'\n", cnt, n, v)
|
||||
cnt += 1
|
||||
testcheck.check(cnt == 3, "zip range+list OK (3)", "zip range+list FAILED")
|
||||
stdlib.free(arena)
|
||||
|
||||
|
||||
def test_zip_str_str():
|
||||
testcheck.section("Test 6: zip(str, str)")
|
||||
sa: str = "abc"
|
||||
sb: str = "123"
|
||||
cnt: t.CInt = 0
|
||||
for ca, cb in zip(sa, sb):
|
||||
stdio.printf("zip str+str[%d]: '%c'%c\n", cnt, ca, cb)
|
||||
cnt += 1
|
||||
testcheck.check(cnt == 3, "zip str+str OK (3)", "zip str+str FAILED")
|
||||
|
||||
|
||||
def test_zip_range_len_list():
|
||||
testcheck.section("Test 7: zip(range(len), list)")
|
||||
arena: bytes = stdlib.malloc(65536)
|
||||
bd: mbuddy.MBuddy | t.CPtr = mbuddy.MBuddy(arena, 65536)
|
||||
s: str = "www.gvsds.com"
|
||||
s.__mbuddy__ = bd
|
||||
lst: list[str] = s.split('.')
|
||||
cnt: t.CInt = 0
|
||||
for idx, v in zip(range(len(lst)), lst):
|
||||
stdio.printf("lst[%d]='%s'\n", idx, v)
|
||||
cnt += 1
|
||||
testcheck.check(cnt == 3, "zip(range(len),list) OK (3)", "zip(range(len),list) FAILED")
|
||||
stdlib.free(arena)
|
||||
|
||||
|
||||
def test_enumerate_list():
|
||||
testcheck.section("Test 8: enumerate(list)")
|
||||
arena: bytes = stdlib.malloc(65536)
|
||||
bd: mbuddy.MBuddy | t.CPtr = mbuddy.MBuddy(arena, 65536)
|
||||
s: str = "alpha,beta,gamma"
|
||||
s.__mbuddy__ = bd
|
||||
lst: list[str] = s.split(',')
|
||||
cnt: t.CInt = 0
|
||||
last_idx: t.CInt = -1
|
||||
for idx, v in enumerate(lst):
|
||||
stdio.printf("enum[%d]='%s'\n", idx, v)
|
||||
last_idx = idx
|
||||
cnt += 1
|
||||
testcheck.check(cnt == 3, "enumerate list OK (3)", "enumerate list FAILED")
|
||||
testcheck.check(last_idx == 2, "enumerate last_idx OK (2)", "enumerate last_idx FAILED expect 2")
|
||||
stdlib.free(arena)
|
||||
|
||||
|
||||
def test_enumerate_str():
|
||||
testcheck.section("Test 9: enumerate(str)")
|
||||
cnt: t.CInt = 0
|
||||
last_idx: t.CInt = -1
|
||||
for idx, ch in enumerate("ABCD"):
|
||||
stdio.printf("enum str[%d]='%c'\n", idx, ch)
|
||||
last_idx = idx
|
||||
cnt += 1
|
||||
testcheck.check(cnt == 4, "enumerate str OK (4)", "enumerate str FAILED expect 4")
|
||||
testcheck.check(last_idx == 3, "enumerate str last_idx OK (3)", "enumerate str last_idx FAILED expect 3")
|
||||
|
||||
|
||||
def test_enumerate_range():
|
||||
testcheck.section("Test 10: enumerate(range)")
|
||||
cnt: t.CInt = 0
|
||||
last_idx: t.CInt = -1
|
||||
last_val: t.CInt = -1
|
||||
for idx, v in enumerate(range(5)):
|
||||
stdio.printf("enum range[%d]=%d\n", idx, v)
|
||||
last_idx = idx
|
||||
last_val = v
|
||||
cnt += 1
|
||||
testcheck.check(cnt == 5, "enumerate range OK (5)", "enumerate range FAILED expect 5")
|
||||
testcheck.check(last_idx == 4, "enumerate range last_idx OK (4)", "enumerate range last_idx FAILED expect 4")
|
||||
testcheck.check(last_val == 4, "enumerate range last_val OK (4)", "enumerate range last_val FAILED expect 4")
|
||||
|
||||
|
||||
def main() -> t.CInt:
|
||||
testcheck.begin("ForAndLoopTest: 迭代器与循环测试")
|
||||
|
||||
test_for_in_range()
|
||||
test_for_in_str()
|
||||
test_for_in_list()
|
||||
test_zip_list_list()
|
||||
test_zip_range_list()
|
||||
test_zip_str_str()
|
||||
test_zip_range_len_list()
|
||||
test_enumerate_list()
|
||||
test_enumerate_str()
|
||||
test_enumerate_range()
|
||||
|
||||
return testcheck.end()
|
||||
1
Test/ForAndLoopTest/output/0eaa586c42dcd931.deps.json
Normal file
1
Test/ForAndLoopTest/output/0eaa586c42dcd931.deps.json
Normal file
@@ -0,0 +1 @@
|
||||
{"mbuddy": "0eaa586c42dcd931", "atom": "271ea3decb810db2", "main": "2e079471575f937d", "stdint": "49bd8cba55979f76", "stdlib": "6c2029b306556c00", "stdio": "73edbcf76e32d00b", "_fakeduck": "9163064cf3eb88f4", "testcheck": "9dbecd0942a39782", "string": "b5f1dc665c52a1bd"}
|
||||
1
Test/ForAndLoopTest/output/271ea3decb810db2.deps.json
Normal file
1
Test/ForAndLoopTest/output/271ea3decb810db2.deps.json
Normal file
@@ -0,0 +1 @@
|
||||
{"mbuddy": "0eaa586c42dcd931", "atom": "271ea3decb810db2", "main": "2e079471575f937d", "stdint": "49bd8cba55979f76", "stdlib": "6c2029b306556c00", "stdio": "73edbcf76e32d00b", "_fakeduck": "9163064cf3eb88f4", "testcheck": "9dbecd0942a39782", "string": "b5f1dc665c52a1bd"}
|
||||
1
Test/ForAndLoopTest/output/2e079471575f937d.deps.json
Normal file
1
Test/ForAndLoopTest/output/2e079471575f937d.deps.json
Normal file
@@ -0,0 +1 @@
|
||||
{"mbuddy": "0eaa586c42dcd931", "atom": "271ea3decb810db2", "stdint": "49bd8cba55979f76", "stdlib": "6c2029b306556c00", "stdio": "73edbcf76e32d00b", "_fakeduck": "9163064cf3eb88f4", "testcheck": "9dbecd0942a39782", "string": "b5f1dc665c52a1bd"}
|
||||
1
Test/ForAndLoopTest/output/9163064cf3eb88f4.deps.json
Normal file
1
Test/ForAndLoopTest/output/9163064cf3eb88f4.deps.json
Normal file
@@ -0,0 +1 @@
|
||||
{"mbuddy": "0eaa586c42dcd931", "atom": "271ea3decb810db2", "main": "2e079471575f937d", "stdint": "49bd8cba55979f76", "stdlib": "6c2029b306556c00", "stdio": "73edbcf76e32d00b", "_fakeduck": "9163064cf3eb88f4", "testcheck": "9dbecd0942a39782", "string": "b5f1dc665c52a1bd"}
|
||||
1
Test/ForAndLoopTest/output/9dbecd0942a39782.deps.json
Normal file
1
Test/ForAndLoopTest/output/9dbecd0942a39782.deps.json
Normal file
@@ -0,0 +1 @@
|
||||
{"mbuddy": "0eaa586c42dcd931", "atom": "271ea3decb810db2", "main": "2e079471575f937d", "stdint": "49bd8cba55979f76", "stdlib": "6c2029b306556c00", "stdio": "73edbcf76e32d00b", "_fakeduck": "9163064cf3eb88f4", "testcheck": "9dbecd0942a39782", "string": "b5f1dc665c52a1bd"}
|
||||
1
Test/ForAndLoopTest/output/b5f1dc665c52a1bd.deps.json
Normal file
1
Test/ForAndLoopTest/output/b5f1dc665c52a1bd.deps.json
Normal file
@@ -0,0 +1 @@
|
||||
{"mbuddy": "0eaa586c42dcd931", "atom": "271ea3decb810db2", "main": "2e079471575f937d", "stdint": "49bd8cba55979f76", "stdlib": "6c2029b306556c00", "stdio": "73edbcf76e32d00b", "_fakeduck": "9163064cf3eb88f4", "testcheck": "9dbecd0942a39782", "string": "b5f1dc665c52a1bd"}
|
||||
29
Test/ForAndLoopTest/project.json
Normal file
29
Test/ForAndLoopTest/project.json
Normal file
@@ -0,0 +1,29 @@
|
||||
{
|
||||
"$schema": "https://raw.githubusercontent.com/TermiNexus/TransPyC/main/schemas/project-schema.json",
|
||||
"name": "ForAndLoopTest",
|
||||
"version": "1.0.0",
|
||||
"source_dir": "./App",
|
||||
"temp_dir": "./temp",
|
||||
"output_dir": "./output",
|
||||
"compiler": {
|
||||
"cmd": "llc",
|
||||
"flags": ["-filetype=obj", "-relocation-model=pic"]
|
||||
},
|
||||
"linker": {
|
||||
"cmd": "clang++",
|
||||
"flags": ["-Wl,--allow-multiple-definition", "-lmsvcrt", "-lucrt", "-lpthread", "-lmingwex", "-lkernel32"],
|
||||
"output": "ForAndLoopTest.exe"
|
||||
},
|
||||
"includes": [
|
||||
"../../includes"
|
||||
],
|
||||
"target": {
|
||||
"triple": "x86_64-pc-windows-gnu",
|
||||
"datalayout": "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
|
||||
},
|
||||
"options": {
|
||||
"slice_level": 3,
|
||||
"target": "llvm",
|
||||
"strict_mode": true
|
||||
}
|
||||
}
|
||||
49
Test/ForAndLoopTest/temp/0eaa586c42dcd931.pyi
Normal file
49
Test/ForAndLoopTest/temp/0eaa586c42dcd931.pyi
Normal file
@@ -0,0 +1,49 @@
|
||||
"""
|
||||
Auto-generated Python stub file from mbuddy.py
|
||||
Module: mbuddy
|
||||
"""
|
||||
|
||||
|
||||
import t, c
|
||||
from stdint import *
|
||||
import string
|
||||
import atom
|
||||
|
||||
MBUDDY_MIN_BLOCK: t.CDefine = 32 # 最小块大小 (字节),需 >= 16 以容纳链表指针
|
||||
MBUDDY_MAX_ORDERS: t.CDefine = 32 # 最大阶数数量
|
||||
MBUDDY_HEADER_SIZE: t.CDefine = 8 # 块头大小 (存储阶数)
|
||||
|
||||
def _largest_pow2_le(val: t.CSizeT) -> t.CSizeT: pass
|
||||
|
||||
def _block_size_at_order(order: t.CInt) -> t.CSizeT: pass
|
||||
|
||||
|
||||
class MBuddy:
|
||||
__provides__: list[str] = ['__mbuddy__']
|
||||
mem: t.CVoid | t.CPtr
|
||||
mem_size: t.CSizeT
|
||||
max_order: t.CInt
|
||||
free_lists: t.CUInt64T | t.CPtr
|
||||
lock_val: t.CVolatile | t.CInt
|
||||
def __init__(self: MBuddy, arena: t.CVoid | t.CPtr, arena_size: t.CSizeT) -> t.CInt: pass
|
||||
def __enter__(self: MBuddy) -> 'MBuddy' | t.CPtr: pass
|
||||
def __exit__(self: MBuddy) -> t.CInt: pass
|
||||
def reset(self: MBuddy) -> t.CInt: pass
|
||||
def _fl_push(self: MBuddy, order: t.CInt, block: t.CVoid | t.CPtr) -> t.CInt: pass
|
||||
def _fl_pop(self: MBuddy, order: t.CInt) -> t.CVoid | t.CPtr: pass
|
||||
def _fl_find_and_remove(self: MBuddy, order: t.CInt, target: t.CVoid | t.CPtr) -> t.CInt: pass
|
||||
def _buddy_of(self: MBuddy, block: t.CVoid | t.CPtr, order: t.CInt) -> t.CVoid | t.CPtr: pass
|
||||
def _order_for_size(self: MBuddy, size: t.CSizeT) -> t.CInt: pass
|
||||
def _split_to_order(self: MBuddy, to_order: t.CInt) -> t.CVoid | t.CPtr: pass
|
||||
def _coalesce(self: MBuddy, block: t.CVoid | t.CPtr, order: t.CInt) -> t.CInt: pass
|
||||
def _is_valid_ptr(self: MBuddy, ptr: t.CVoid | t.CPtr) -> t.CInt: pass
|
||||
def _fl_count(self: MBuddy, order: t.CInt) -> t.CSizeT: pass
|
||||
def _lock(self: MBuddy) -> t.CInt: pass
|
||||
def _unlock(self: MBuddy) -> t.CInt: pass
|
||||
def alloc(self: MBuddy, size: t.CSizeT) -> t.CVoid | t.CPtr: pass
|
||||
def free(self: MBuddy, ptr: t.CVoid | t.CPtr) -> t.CInt: pass
|
||||
def calloc(self: MBuddy, count: t.CSizeT, size: t.CSizeT) -> t.CVoid | t.CPtr: pass
|
||||
def realloc(self: MBuddy, ptr: t.CVoid | t.CPtr, new_size: t.CSizeT) -> t.CVoid | t.CPtr: pass
|
||||
def stats(self: MBuddy) -> t.CSizeT: pass
|
||||
def free_count(self: MBuddy) -> t.CSizeT: pass
|
||||
def self_check(self: MBuddy) -> t.CInt: pass
|
||||
26
Test/ForAndLoopTest/temp/271ea3decb810db2.pyi
Normal file
26
Test/ForAndLoopTest/temp/271ea3decb810db2.pyi
Normal file
@@ -0,0 +1,26 @@
|
||||
"""
|
||||
Auto-generated Python stub file from atom.py
|
||||
Module: atom
|
||||
"""
|
||||
|
||||
|
||||
import t, c
|
||||
|
||||
ATOMIC_RELAXED: t.CDefine = 0
|
||||
ATOMIC_CONSUME: t.CDefine = 1
|
||||
ATOMIC_ACQUIRE: t.CDefine = 2
|
||||
ATOMIC_RELEASE: t.CDefine = 3
|
||||
ATOMIC_ACQ_REL: t.CDefine = 4
|
||||
ATOMIC_SEQ_CST: t.CDefine = 5
|
||||
|
||||
def __atomic_test_and_set(ptr: t.CUInt64T | t.CPtr, order: t.CInt) -> t.CBool: pass
|
||||
|
||||
def __atomic_clear(ptr: t.CUInt64T | t.CPtr, order: t.CInt) -> t.CVoid: pass
|
||||
|
||||
def __atomic_thread_fence(order: t.CInt) -> t.CVoid: pass
|
||||
|
||||
def __atomic_signal_fence(order: t.CInt) -> t.CVoid: pass
|
||||
|
||||
def __atomic_always_lock_free(size: t.CSizeT, ptr: t.CVoid | t.CPtr) -> t.CBool: pass
|
||||
|
||||
def __atomic_is_lock_free(size: t.CSizeT, ptr: t.CVoid | t.CPtr) -> t.CBool: pass
|
||||
36
Test/ForAndLoopTest/temp/2e079471575f937d.pyi
Normal file
36
Test/ForAndLoopTest/temp/2e079471575f937d.pyi
Normal file
@@ -0,0 +1,36 @@
|
||||
"""
|
||||
Auto-generated Python stub file from main.py
|
||||
Module: main
|
||||
"""
|
||||
|
||||
|
||||
import t
|
||||
import c
|
||||
import stdio
|
||||
import stdlib
|
||||
import string
|
||||
import mbuddy
|
||||
import testcheck
|
||||
import _fakeduck
|
||||
|
||||
def test_for_in_range() -> t.CInt: pass
|
||||
|
||||
def test_for_in_str() -> t.CInt: pass
|
||||
|
||||
def test_for_in_list() -> t.CInt: pass
|
||||
|
||||
def test_zip_list_list() -> t.CInt: pass
|
||||
|
||||
def test_zip_range_list() -> t.CInt: pass
|
||||
|
||||
def test_zip_str_str() -> t.CInt: pass
|
||||
|
||||
def test_zip_range_len_list() -> t.CInt: pass
|
||||
|
||||
def test_enumerate_list() -> t.CInt: pass
|
||||
|
||||
def test_enumerate_str() -> t.CInt: pass
|
||||
|
||||
def test_enumerate_range() -> t.CInt: pass
|
||||
|
||||
def main() -> t.CInt: pass
|
||||
75
Test/ForAndLoopTest/temp/49bd8cba55979f76.pyi
Normal file
75
Test/ForAndLoopTest/temp/49bd8cba55979f76.pyi
Normal file
@@ -0,0 +1,75 @@
|
||||
"""
|
||||
Auto-generated Python stub file from stdint.py
|
||||
Module: stdint
|
||||
"""
|
||||
|
||||
import c
|
||||
|
||||
|
||||
import t
|
||||
|
||||
INT: t.CTypedef = t.CInt
|
||||
INTPTR: t.CTypedef = t.CInt | t.CPtr
|
||||
BOOL: t.CTypedef = t.CInt
|
||||
UINT: t.CTypedef = t.CUnsignedInt
|
||||
UINTPTR: t.CTypedef = UINT | t.CPtr
|
||||
BYTE: t.CTypedef = t.CUnsignedChar
|
||||
BYTEPTR: t.CTypedef = BYTE | t.CPtr
|
||||
WORD: t.CTypedef = t.CUInt16T
|
||||
DWORD: t.CTypedef = t.CUInt32T
|
||||
QWORD: t.CTypedef = t.CUInt64T
|
||||
TCHAR: t.CTypedef = t.CChar
|
||||
CHARLIST: t.CTypedef = str | t.CPtr
|
||||
VOID: t.CTypedef = t.CVoid
|
||||
SHORT: t.CTypedef = t.CShort
|
||||
SHORTPTR: t.CTypedef = t.CShort | t.CPtr
|
||||
USHORT: t.CTypedef = t.CUnsignedShort
|
||||
USHORTPTR: t.CTypedef = t.CUnsignedShort | t.CPtr
|
||||
LONGLONG: t.CTypedef = t.CLong | t.CLong
|
||||
ULONGLONG: t.CTypedef = t.CUnsignedLong | t.CLong
|
||||
LONG: t.CTypedef = t.CLong
|
||||
ULONG: t.CTypedef = t.CUnsignedLong
|
||||
WCHAR: t.CTypedef = WORD
|
||||
WCHARPTR: t.CTypedef = WORD | t.CPtr
|
||||
CHARPTR: t.CTypedef = t.CChar | t.CPtr
|
||||
FSIZE_t: t.CTypedef = DWORD
|
||||
LBA_t: t.CTypedef = DWORD
|
||||
UINTPTR: t.CTypedef = t.CUnsignedInt | t.CPtr
|
||||
VOIDPTR: t.CTypedef = t.CVoid | t.CPtr
|
||||
FLOAT: t.CTypedef = t.CFloat
|
||||
DOUBLE: t.CTypedef = t.CDouble
|
||||
FLOAT8: t.CTypedef = t.CFloat8T
|
||||
FLOAT16: t.CTypedef = t.CFloat16T
|
||||
FLOAT32: t.CTypedef = t.CFloat32T
|
||||
FLOAT64: t.CTypedef = t.CFloat64T
|
||||
FLOAT128: t.CTypedef = t.CFloat128T
|
||||
INT8: t.CTypedef = t.CInt8T
|
||||
INT16: t.CTypedef = t.CInt16T
|
||||
INT32: t.CTypedef = t.CInt32T
|
||||
INT64: t.CTypedef = t.CInt64T
|
||||
UINT8: t.CTypedef = t.CUInt8T
|
||||
UINT16: t.CTypedef = t.CUInt16T
|
||||
UINT32: t.CTypedef = t.CUInt32T
|
||||
UINT64: t.CTypedef = t.CUInt64T
|
||||
INT8PTR: t.CTypedef = t.CInt8T | t.CPtr
|
||||
INT16PTR: t.CTypedef = t.CInt16T | t.CPtr
|
||||
INT32PTR: t.CTypedef = t.CInt32T | t.CPtr
|
||||
INT64PTR: t.CTypedef = t.CInt64T | t.CPtr
|
||||
UINT8PTR: t.CTypedef = t.CUInt8T | t.CPtr
|
||||
UINT16PTR: t.CTypedef = t.CUInt16T | t.CPtr
|
||||
UINT32PTR: t.CTypedef = t.CUInt32T | t.CPtr
|
||||
UINT64PTR: t.CTypedef = t.CUInt64T | t.CPtr
|
||||
CHAR8: t.CTypedef = t.CChar8T
|
||||
CHAR16: t.CTypedef = t.CChar16T
|
||||
CHAR32: t.CTypedef = t.CChar32T
|
||||
CHAR8PTR: t.CTypedef = t.CChar8T | t.CPtr
|
||||
CHAR16PTR: t.CTypedef = t.CChar16T | t.CPtr
|
||||
CHAR32PTR: t.CTypedef = t.CChar32T | t.CPtr
|
||||
i8: t.CTypedef = t.CInt8T
|
||||
i16: t.CTypedef = t.CInt16T
|
||||
i32: t.CTypedef = t.CInt32T
|
||||
i64: t.CTypedef = t.CInt64T
|
||||
u8: t.CTypedef = t.CUInt8T
|
||||
u16: t.CTypedef = t.CUInt16T
|
||||
u32: t.CTypedef = t.CUInt32T
|
||||
u64: t.CTypedef = t.CUInt64T
|
||||
18
Test/ForAndLoopTest/temp/6c2029b306556c00.pyi
Normal file
18
Test/ForAndLoopTest/temp/6c2029b306556c00.pyi
Normal file
@@ -0,0 +1,18 @@
|
||||
"""
|
||||
Auto-generated Python stub file from stdlib.py
|
||||
Module: stdlib
|
||||
"""
|
||||
|
||||
import c
|
||||
|
||||
|
||||
from stdint import *
|
||||
import t
|
||||
|
||||
def malloc(size: t.CSizeT) -> t.CVoid | t.CPtr | t.State | t.CExtern | t.CExport: pass
|
||||
|
||||
def calloc(nmemb: t.CSizeT, size: t.CSizeT) -> t.CVoid | t.CPtr | t.State | t.CExtern | t.CExport: pass
|
||||
|
||||
def realloc(p: t.CVoid | t.CPtr, size: t.CSizeT) -> t.CVoid | t.CPtr | t.State | t.CExtern | t.CExport: pass
|
||||
|
||||
def free(p: t.CVoid | t.CPtr) -> None | t.State | t.CExtern | t.CExport: pass
|
||||
28
Test/ForAndLoopTest/temp/73edbcf76e32d00b.pyi
Normal file
28
Test/ForAndLoopTest/temp/73edbcf76e32d00b.pyi
Normal file
@@ -0,0 +1,28 @@
|
||||
"""
|
||||
Auto-generated Python stub file from stdio.py
|
||||
Module: stdio
|
||||
"""
|
||||
|
||||
|
||||
import t, c
|
||||
|
||||
def printf(fmt: t.CChar | t.CConst | t.CPtr, *args) -> t.CInt | t.CExtern | t.CExport: pass
|
||||
|
||||
def fprintf(stream: t.CVoid | t.CPtr, fmt: t.CChar | t.CConst | t.CPtr, *args) -> t.CInt | t.CExtern | t.CExport: pass
|
||||
|
||||
def sprintf(buf: t.CChar | t.CPtr, fmt: t.CChar | t.CConst | t.CPtr, *args) -> t.CInt | t.CExtern | t.CExport: pass
|
||||
|
||||
def snprintf(buf: t.CChar | t.CPtr, size: t.CSizeT, fmt: t.CChar | t.CConst | t.CPtr, *args) -> t.CInt | t.CExtern | t.CExport: pass
|
||||
|
||||
def puts(s: t.CChar | t.CConst | t.CPtr) -> t.CInt | t.CExtern | t.CExport: pass
|
||||
|
||||
def fputs(s: t.CChar | t.CConst | t.CPtr, stream: t.CVoid | t.CPtr) -> t.CInt | t.CExtern | t.CExport: pass
|
||||
|
||||
def fgets(buf: t.CChar | t.CPtr, size: t.CInt, stream: t.CVoid | t.CPtr) -> t.CChar | t.CPtr | t.CExtern | t.CExport: pass
|
||||
|
||||
def fflush(stream: t.CVoid | t.CPtr) -> t.CInt | t.CExtern | t.CExport: pass
|
||||
|
||||
|
||||
stdin: t.CExtern | t.CVoid | t.CPtr
|
||||
stdout: t.CExtern | t.CVoid | t.CPtr
|
||||
stderr: t.CExtern | t.CVoid | t.CPtr
|
||||
35
Test/ForAndLoopTest/temp/9163064cf3eb88f4.pyi
Normal file
35
Test/ForAndLoopTest/temp/9163064cf3eb88f4.pyi
Normal file
@@ -0,0 +1,35 @@
|
||||
"""
|
||||
Auto-generated Python stub file from _fakeduck.py
|
||||
Module: _fakeduck
|
||||
"""
|
||||
|
||||
import c
|
||||
|
||||
|
||||
import t
|
||||
import mbuddy
|
||||
import string
|
||||
|
||||
class _Type:
|
||||
def type_id(self: _Type) -> int: pass
|
||||
class _str:
|
||||
__requires__: list[str] = ['__mbuddy__']
|
||||
__data__: str
|
||||
__mbuddy__: mbuddy.MBuddy | t.CPtr
|
||||
def b(self: _str) -> int: pass
|
||||
def SELF(self: _str) -> str: pass
|
||||
def upper(self: _str) -> str: pass
|
||||
def lower(self: _str) -> str: pass
|
||||
def capitalize(self: _str) -> str: pass
|
||||
def swapcase(self: _str) -> str: pass
|
||||
def title(self: _str) -> str: pass
|
||||
def casefold(self: _str) -> str: pass
|
||||
def isupper(self: _str) -> int: pass
|
||||
def islower(self: _str) -> int: pass
|
||||
def isalpha(self: _str) -> int: pass
|
||||
def isdigit(self: _str) -> int: pass
|
||||
def isalnum(self: _str) -> int: pass
|
||||
def isspace(self: _str) -> int: pass
|
||||
def isascii(self: _str) -> int: pass
|
||||
def istitle(self: _str) -> int: pass
|
||||
def split(self: _str, delimiter: str) -> list[str]: pass
|
||||
25
Test/ForAndLoopTest/temp/9dbecd0942a39782.pyi
Normal file
25
Test/ForAndLoopTest/temp/9dbecd0942a39782.pyi
Normal file
@@ -0,0 +1,25 @@
|
||||
"""
|
||||
Auto-generated Python stub file from testcheck.py
|
||||
Module: testcheck
|
||||
"""
|
||||
|
||||
|
||||
import t, c
|
||||
import stdio
|
||||
|
||||
_pass_count: t.CExtern | t.CInt
|
||||
_fail_count: t.CExtern | t.CInt
|
||||
|
||||
def begin(name: str) -> t.CInt: pass
|
||||
|
||||
def section(name: str) -> t.CInt: pass
|
||||
|
||||
def ok(msg: str) -> t.CInt: pass
|
||||
|
||||
def fail(msg: str) -> t.CInt: pass
|
||||
|
||||
def check(cond: t.CInt, ok_msg: str, fail_msg: str) -> t.CInt: pass
|
||||
|
||||
def info(msg: str) -> t.CInt: pass
|
||||
|
||||
def end() -> t.CInt: pass
|
||||
9
Test/ForAndLoopTest/temp/_sha1_map.txt
Normal file
9
Test/ForAndLoopTest/temp/_sha1_map.txt
Normal file
@@ -0,0 +1,9 @@
|
||||
0eaa586c42dcd931:includes/mbuddy.py
|
||||
271ea3decb810db2:includes/atom.py
|
||||
2e079471575f937d:main.py
|
||||
49bd8cba55979f76:includes/stdint.py
|
||||
6c2029b306556c00:includes/stdlib.py
|
||||
73edbcf76e32d00b:includes/stdio.py
|
||||
9163064cf3eb88f4:includes/_fakeduck.py
|
||||
9dbecd0942a39782:includes/testcheck.py
|
||||
b5f1dc665c52a1bd:includes/string.py
|
||||
44
Test/ForAndLoopTest/temp/b5f1dc665c52a1bd.pyi
Normal file
44
Test/ForAndLoopTest/temp/b5f1dc665c52a1bd.pyi
Normal file
@@ -0,0 +1,44 @@
|
||||
"""
|
||||
Auto-generated Python stub file from string.py
|
||||
Module: string
|
||||
"""
|
||||
|
||||
|
||||
from stdint import *
|
||||
import t, c
|
||||
|
||||
def strcpy(dest: str, src: str) -> str: pass
|
||||
|
||||
def strncpy(dest: str, src: str, n: t.CSizeT) -> str: pass
|
||||
|
||||
def strlen(src: str) -> t.CSizeT | t.CExport: pass
|
||||
|
||||
def strcmp(str1: str, str2: str) -> t.CInt: pass
|
||||
|
||||
def samestr(str1: str, str2: str) -> bool: pass
|
||||
|
||||
def strncmp(str1: str, str2: str, n: t.CSizeT) -> t.CInt: pass
|
||||
|
||||
def memcmp(ptr1: t.CVoid | t.CPtr, ptr2: t.CVoid | t.CPtr, n: t.CSizeT) -> t.CInt: pass
|
||||
|
||||
def strchr(s: str, cr: t.CInt) -> str: pass
|
||||
|
||||
def strrchr(s: str, cr: t.CInt) -> str: pass
|
||||
|
||||
def strspn(s: str, skip: str) -> int: pass
|
||||
|
||||
def memset(ptr: t.CVoid | t.CPtr, value: t.CInt, num: t.CSizeT) -> t.CVoid | t.CPtr | t.CExport: pass
|
||||
|
||||
def memset32(ptr: t.CVoid | t.CPtr, value: t.CUInt32T, count: t.CSizeT) -> t.CVoid | t.CPtr: pass
|
||||
|
||||
def memcpy(dest: t.CVoid | t.CPtr, src: t.CVoid | t.CPtr, num: t.CSizeT) -> t.CVoid | t.CPtr | t.CExport: pass
|
||||
|
||||
def memmove(dest: t.CVoid | t.CPtr, src: t.CVoid | t.CPtr, num: t.CSizeT) -> t.CVoid | t.CPtr: pass
|
||||
|
||||
def atoi(src: str) -> t.CInt: pass
|
||||
|
||||
def atoll(src: str) -> t.CInt64T: pass
|
||||
|
||||
def atof(src: str) -> t.CDouble: pass
|
||||
|
||||
def split(s: str, delim: str, result: t.CArray[str]) -> int: pass
|
||||
Reference in New Issue
Block a user