Name | tree-sitter-move JSON |
Version |
0.0.2
JSON |
| download |
home_page | None |
Summary | Move grammar for tree-sitter |
upload_time | 2025-07-30 04:27:25 |
maintainer | None |
docs_url | None |
author | Tree-sitter Move Contributors |
requires_python | >=3.8 |
license | Copyright © Aptos Foundation
SPDX-License-Identifier: Apache-2.0
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright 2024 Aptos Foundation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
|
keywords |
incremental
parsing
tree-sitter
move
blockchain
aptos
|
VCS |
 |
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# Tree-sitter Move Parser
A Python library for parsing Aptos Move smart contract language, built on tree-sitter.
source:
https://github.com/BradMoonUESTC/tree-sitter-move
## ✨ Features
- **Pure Python Environment**: No need to install npm, cargo or other toolchains
- **Plug and Play**: Includes pre-compiled grammar files, ready to use out of the box
- **Complete Functionality**: Supports full Move language syntax parsing and analysis
- **Easy Integration**: Provides clean Python API interface
- **Comprehensive Testing**: Successfully parses all valid Move code samples
## 🚀 Quick Start
### Requirements
- Python 3.8+
- pip
### Installation
**Option 1: One-click Installation (Recommended)**
```bash
./setup.sh
```
**Option 2: Manual Installation**
```bash
# Create and activate virtual environment
python3 -m venv venv
source venv/bin/activate
# Install dependencies
pip install tree-sitter --trusted-host pypi.org --trusted-host files.pythonhosted.org
# Install this package
pip install -e .
# Run demo
python move_parser_demo.py
```
### Quick Test
```bash
# Run basic demo
python move_parser_demo.py
# Run comprehensive tests
python comprehensive_move_test.py
```
## 💻 Usage Example
### Basic Usage
```python
import tree_sitter_move as ts_move
from tree_sitter import Language, Parser
# Create parser
move_language = Language(ts_move.language())
parser = Parser()
parser.language = move_language
# Parse Move code
move_code = """
module 0x1::coin {
struct Coin has key, store {
value: u64,
}
public fun mint(value: u64): Coin {
Coin { value }
}
public fun get_value(coin: &Coin): u64 {
coin.value
}
}
"""
tree = parser.parse(bytes(move_code, "utf8"))
# Check parsing result
if tree.root_node.has_error:
print("❌ Syntax error")
else:
print("✅ Parsing successful")
print(f"Root node type: {tree.root_node.type}")
print(f"Number of child nodes: {tree.root_node.child_count}")
```
### Advanced AST Analysis
```python
def analyze_ast(node, depth=0):
indent = " " * depth
print(f"{indent}├─ {node.type}")
for child in node.children:
if depth < 3: # Limit depth
analyze_ast(child, depth + 1)
# Analyze the AST structure
analyze_ast(tree.root_node)
```
## 📊 Test Results
The parser has been thoroughly tested with various Move code samples:
| File | Size | Lines | Description | Result |
|------|------|-------|-------------|---------|
| `basic_coin.move` | 1.9KB | 58 | Basic coin module with mint/transfer functions | ✅ Pass |
| `nft_collection.move` | 4.0KB | 150 | NFT collection with complex events and vectors | ✅ Pass |
| `defi_swap.move` | 6.9KB | 203 | DeFi swap module with generics and algorithms | ✅ Pass |
| `script_example.move` | 770B | 23 | Move script example | ✅ Pass |
| `syntax_error.move` | 579B | 29 | File with intentional syntax errors | ❌ Fail (Expected) |
**Overall Success Rate: 100% (4/4 valid files, 1 syntax error file correctly detected)**
## 🔧 Supported Move Syntax
### ✅ Successfully Parsed Features:
- Module definitions (`module 0x1::name`)
- Struct definitions with abilities (`has key, store`)
- Function definitions with visibility modifiers (`public fun`)
- Generic type parameters (`<T>`, `phantom`)
- References and borrowing (`&`, `&mut`)
- Complex expressions and control flow
- Script definitions (`script { }`)
- Comments and documentation
- Import statements (`use`)
- Error handling (`assert!`, `abort`)
### ✅ Advanced Features:
- Resource management (`move_to`, `borrow_global`)
- Event emission (`event::emit`)
- Vector operations
- String handling
- Conditional expressions and loops
### ✅ Error Detection:
- Accurately identifies syntax error locations
- Provides detailed error information
- Distinguishes between legal and illegal syntax structures
## 📁 Project Structure
```
tree-sitter-move/
├── src/ # Pre-compiled grammar files
│ ├── grammar.json # Grammar rules
│ ├── parser.c # Parser C code
│ └── scanner.c # External scanner
├── bindings/python/ # Python bindings
├── move_test_files/ # Test Move files
│ ├── basic_coin.move # Basic coin module
│ ├── nft_collection.move # NFT collection
│ ├── defi_swap.move # DeFi swap module
│ └── script_example.move # Script example
├── move_parser_demo.py # Basic demo script
├── comprehensive_move_test.py # Comprehensive test script
├── setup.py # Python package configuration
├── setup.sh # Installation script
└── README.md # This documentation
```
## 🌲 AST Analysis
The parser generates complete Abstract Syntax Trees (AST) including:
- Root node type identification
- Complete node hierarchy structure
- Detailed node type statistics
- Accurate position information
## 🎯 Use Cases
- Move code syntax analysis
- Smart contract code validation
- IDE syntax highlighting support
- Code formatting tools
- Documentation generation
- Code refactoring tools
- Static analysis tools
- Educational and learning tools
## 🔍 Troubleshooting
### SSL Certificate Error
```bash
pip install tree-sitter --trusted-host pypi.org --trusted-host files.pythonhosted.org --trusted-host pypi.python.org
```
### Import Error: No module named 'tree_sitter_move'
```bash
pip install -e .
```
### Virtual Environment Not Activated
```bash
source venv/bin/activate
```
## 🚀 Getting Started Tips
1. Use virtual environment to isolate dependencies
2. Perfect for Move code syntax analysis, highlighting, refactoring tool development
3. Suitable for integration into IDE plugins or code analysis tools
4. Tested with Python 3.13 on macOS, compatible with Python 3.8+
## 📄 License
Apache License 2.0 - See [LICENSE](LICENSE) file for details
---
🎉 **Enjoy using Tree-sitter Move Parser!**
## 🎉 打包完成!您的tree-sitter-move包已经成功构建
### ✅ 完成的工作
1. **包配置完善**
- 更新了 `pyproject.toml` 配置文件
- 添加了作者信息、依赖关系、项目URL
- 创建了 `MANIFEST.in` 文件管理包文件
2. **成功构建了两种分发包**
- **Wheel包** (154KB): `tree_sitter_move-0.0.1-cp38-abi3-macosx_10_13_universal2.whl`
- **源码包** (344KB): `tree_sitter_move-0.0.1.tar.gz`
3. **质量验证通过**
- ✅ `twine check` 验证通过
- ✅ 独立环境安装测试通过
- ✅ 功能测试通过(可以正常解析Move代码)
### 🚀 如何使用您的包
#### 方法1: 本地安装(推荐)
```bash
<code_block_to_apply_from>
```
#### 方法2: 发布到PyPI
```bash
# 上传到Test PyPI(测试用)
twine upload --repository testpypi dist/*
# 上传到PyPI(正式发布)
twine upload dist/*
```
#### 方法3: 从源码安装
```bash
# 开发模式安装
pip install -e .
```
### 📋 包信息
- **包名**: `tree-sitter-move`
- **版本**: `0.0.1`
- **支持Python**: 3.8+
- **依赖**: `tree-sitter>=0.21.0`
- **许可证**: Apache License 2.0
### 🧪 使用示例
```python
import tree_sitter_move as ts_move
from tree_sitter import Language, Parser
# 创建解析器
move_language = Language(ts_move.language())
parser = Parser(move_language)
# 解析Move代码
code = "module 0x1::hello { public fun world() {} }"
tree = parser.parse(bytes(code, "utf8"))
print("✅ 解析成功!" if not tree.root_node.has_error else "❌ 解析失败")
```
### 📖 完整文档
详细的安装和使用指南已保存在 `PACKAGING_GUIDE.md` 文件中。
现在您的tree-sitter-move包已经可以:
- ✅ 本地安装使用
- ✅ 分发给其他用户
- ✅ 上传到PyPI供全球用户使用
**🎊 恭喜!您已经成功创建了一个可分发的Python包!**
Raw data
{
"_id": null,
"home_page": null,
"name": "tree-sitter-move",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": null,
"keywords": "incremental, parsing, tree-sitter, move, blockchain, aptos",
"author": "Tree-sitter Move Contributors",
"author_email": null,
"download_url": "https://files.pythonhosted.org/packages/88/e4/78fff98742190d2d3640308f79bd3f27f35b1914d0c4f8d7835758d98d60/tree_sitter_move-0.0.2.tar.gz",
"platform": null,
"description": "# Tree-sitter Move Parser\n\nA Python library for parsing Aptos Move smart contract language, built on tree-sitter.\n\nsource:\nhttps://github.com/BradMoonUESTC/tree-sitter-move\n\n## \u2728 Features\n\n- **Pure Python Environment**: No need to install npm, cargo or other toolchains\n- **Plug and Play**: Includes pre-compiled grammar files, ready to use out of the box\n- **Complete Functionality**: Supports full Move language syntax parsing and analysis\n- **Easy Integration**: Provides clean Python API interface\n- **Comprehensive Testing**: Successfully parses all valid Move code samples\n\n## \ud83d\ude80 Quick Start\n\n### Requirements\n\n- Python 3.8+\n- pip\n\n### Installation\n\n**Option 1: One-click Installation (Recommended)**\n```bash\n./setup.sh\n```\n\n**Option 2: Manual Installation**\n```bash\n# Create and activate virtual environment\npython3 -m venv venv\nsource venv/bin/activate\n\n# Install dependencies\npip install tree-sitter --trusted-host pypi.org --trusted-host files.pythonhosted.org\n\n# Install this package\npip install -e .\n\n# Run demo\npython move_parser_demo.py\n```\n\n### Quick Test\n\n```bash\n# Run basic demo\npython move_parser_demo.py\n\n# Run comprehensive tests\npython comprehensive_move_test.py\n```\n\n## \ud83d\udcbb Usage Example\n\n### Basic Usage\n\n```python\nimport tree_sitter_move as ts_move\nfrom tree_sitter import Language, Parser\n\n# Create parser\nmove_language = Language(ts_move.language())\nparser = Parser()\nparser.language = move_language\n\n# Parse Move code\nmove_code = \"\"\"\nmodule 0x1::coin {\n struct Coin has key, store {\n value: u64,\n }\n \n public fun mint(value: u64): Coin {\n Coin { value }\n }\n \n public fun get_value(coin: &Coin): u64 {\n coin.value\n }\n}\n\"\"\"\n\ntree = parser.parse(bytes(move_code, \"utf8\"))\n\n# Check parsing result\nif tree.root_node.has_error:\n print(\"\u274c Syntax error\")\nelse:\n print(\"\u2705 Parsing successful\")\n print(f\"Root node type: {tree.root_node.type}\")\n print(f\"Number of child nodes: {tree.root_node.child_count}\")\n```\n\n### Advanced AST Analysis\n\n```python\ndef analyze_ast(node, depth=0):\n indent = \" \" * depth\n print(f\"{indent}\u251c\u2500 {node.type}\")\n \n for child in node.children:\n if depth < 3: # Limit depth\n analyze_ast(child, depth + 1)\n\n# Analyze the AST structure\nanalyze_ast(tree.root_node)\n```\n\n## \ud83d\udcca Test Results\n\nThe parser has been thoroughly tested with various Move code samples:\n\n| File | Size | Lines | Description | Result |\n|------|------|-------|-------------|---------|\n| `basic_coin.move` | 1.9KB | 58 | Basic coin module with mint/transfer functions | \u2705 Pass |\n| `nft_collection.move` | 4.0KB | 150 | NFT collection with complex events and vectors | \u2705 Pass |\n| `defi_swap.move` | 6.9KB | 203 | DeFi swap module with generics and algorithms | \u2705 Pass |\n| `script_example.move` | 770B | 23 | Move script example | \u2705 Pass |\n| `syntax_error.move` | 579B | 29 | File with intentional syntax errors | \u274c Fail (Expected) |\n\n**Overall Success Rate: 100% (4/4 valid files, 1 syntax error file correctly detected)**\n\n## \ud83d\udd27 Supported Move Syntax\n\n### \u2705 Successfully Parsed Features:\n- Module definitions (`module 0x1::name`)\n- Struct definitions with abilities (`has key, store`)\n- Function definitions with visibility modifiers (`public fun`)\n- Generic type parameters (`<T>`, `phantom`)\n- References and borrowing (`&`, `&mut`)\n- Complex expressions and control flow\n- Script definitions (`script { }`)\n- Comments and documentation\n- Import statements (`use`)\n- Error handling (`assert!`, `abort`)\n\n### \u2705 Advanced Features:\n- Resource management (`move_to`, `borrow_global`)\n- Event emission (`event::emit`)\n- Vector operations\n- String handling\n- Conditional expressions and loops\n\n### \u2705 Error Detection:\n- Accurately identifies syntax error locations\n- Provides detailed error information\n- Distinguishes between legal and illegal syntax structures\n\n## \ud83d\udcc1 Project Structure\n\n```\ntree-sitter-move/\n\u251c\u2500\u2500 src/ # Pre-compiled grammar files\n\u2502 \u251c\u2500\u2500 grammar.json # Grammar rules\n\u2502 \u251c\u2500\u2500 parser.c # Parser C code\n\u2502 \u2514\u2500\u2500 scanner.c # External scanner\n\u251c\u2500\u2500 bindings/python/ # Python bindings\n\u251c\u2500\u2500 move_test_files/ # Test Move files\n\u2502 \u251c\u2500\u2500 basic_coin.move # Basic coin module\n\u2502 \u251c\u2500\u2500 nft_collection.move # NFT collection\n\u2502 \u251c\u2500\u2500 defi_swap.move # DeFi swap module\n\u2502 \u2514\u2500\u2500 script_example.move # Script example\n\u251c\u2500\u2500 move_parser_demo.py # Basic demo script\n\u251c\u2500\u2500 comprehensive_move_test.py # Comprehensive test script\n\u251c\u2500\u2500 setup.py # Python package configuration\n\u251c\u2500\u2500 setup.sh # Installation script\n\u2514\u2500\u2500 README.md # This documentation\n```\n\n## \ud83c\udf32 AST Analysis\n\nThe parser generates complete Abstract Syntax Trees (AST) including:\n- Root node type identification\n- Complete node hierarchy structure\n- Detailed node type statistics\n- Accurate position information\n\n## \ud83c\udfaf Use Cases\n\n- Move code syntax analysis\n- Smart contract code validation\n- IDE syntax highlighting support\n- Code formatting tools\n- Documentation generation\n- Code refactoring tools\n- Static analysis tools\n- Educational and learning tools\n\n## \ud83d\udd0d Troubleshooting\n\n### SSL Certificate Error\n```bash\npip install tree-sitter --trusted-host pypi.org --trusted-host files.pythonhosted.org --trusted-host pypi.python.org\n```\n\n### Import Error: No module named 'tree_sitter_move'\n```bash\npip install -e .\n```\n\n### Virtual Environment Not Activated\n```bash\nsource venv/bin/activate\n```\n\n## \ud83d\ude80 Getting Started Tips\n\n1. Use virtual environment to isolate dependencies\n2. Perfect for Move code syntax analysis, highlighting, refactoring tool development\n3. Suitable for integration into IDE plugins or code analysis tools\n4. Tested with Python 3.13 on macOS, compatible with Python 3.8+\n\n## \ud83d\udcc4 License\n\nApache License 2.0 - See [LICENSE](LICENSE) file for details\n\n---\n\n\ud83c\udf89 **Enjoy using Tree-sitter Move Parser!**\n\n## \ud83c\udf89 \u6253\u5305\u5b8c\u6210\uff01\u60a8\u7684tree-sitter-move\u5305\u5df2\u7ecf\u6210\u529f\u6784\u5efa\n\n### \u2705 \u5b8c\u6210\u7684\u5de5\u4f5c\n\n1. **\u5305\u914d\u7f6e\u5b8c\u5584**\n - \u66f4\u65b0\u4e86 `pyproject.toml` \u914d\u7f6e\u6587\u4ef6\n - \u6dfb\u52a0\u4e86\u4f5c\u8005\u4fe1\u606f\u3001\u4f9d\u8d56\u5173\u7cfb\u3001\u9879\u76eeURL\n - \u521b\u5efa\u4e86 `MANIFEST.in` \u6587\u4ef6\u7ba1\u7406\u5305\u6587\u4ef6\n\n2. **\u6210\u529f\u6784\u5efa\u4e86\u4e24\u79cd\u5206\u53d1\u5305**\n - **Wheel\u5305** (154KB): `tree_sitter_move-0.0.1-cp38-abi3-macosx_10_13_universal2.whl`\n - **\u6e90\u7801\u5305** (344KB): `tree_sitter_move-0.0.1.tar.gz`\n\n3. **\u8d28\u91cf\u9a8c\u8bc1\u901a\u8fc7**\n - \u2705 `twine check` \u9a8c\u8bc1\u901a\u8fc7\n - \u2705 \u72ec\u7acb\u73af\u5883\u5b89\u88c5\u6d4b\u8bd5\u901a\u8fc7\n - \u2705 \u529f\u80fd\u6d4b\u8bd5\u901a\u8fc7\uff08\u53ef\u4ee5\u6b63\u5e38\u89e3\u6790Move\u4ee3\u7801\uff09\n\n### \ud83d\ude80 \u5982\u4f55\u4f7f\u7528\u60a8\u7684\u5305\n\n#### \u65b9\u6cd51: \u672c\u5730\u5b89\u88c5\uff08\u63a8\u8350\uff09\n```bash\n<code_block_to_apply_from>\n```\n\n#### \u65b9\u6cd52: \u53d1\u5e03\u5230PyPI\n```bash\n# \u4e0a\u4f20\u5230Test PyPI\uff08\u6d4b\u8bd5\u7528\uff09\ntwine upload --repository testpypi dist/*\n\n# \u4e0a\u4f20\u5230PyPI\uff08\u6b63\u5f0f\u53d1\u5e03\uff09\ntwine upload dist/*\n```\n\n#### \u65b9\u6cd53: \u4ece\u6e90\u7801\u5b89\u88c5\n```bash\n# \u5f00\u53d1\u6a21\u5f0f\u5b89\u88c5\npip install -e .\n```\n\n### \ud83d\udccb \u5305\u4fe1\u606f\n- **\u5305\u540d**: `tree-sitter-move`\n- **\u7248\u672c**: `0.0.1`\n- **\u652f\u6301Python**: 3.8+\n- **\u4f9d\u8d56**: `tree-sitter>=0.21.0`\n- **\u8bb8\u53ef\u8bc1**: Apache License 2.0\n\n### \ud83e\uddea \u4f7f\u7528\u793a\u4f8b\n```python\nimport tree_sitter_move as ts_move\nfrom tree_sitter import Language, Parser\n\n# \u521b\u5efa\u89e3\u6790\u5668\nmove_language = Language(ts_move.language())\nparser = Parser(move_language)\n\n# \u89e3\u6790Move\u4ee3\u7801\ncode = \"module 0x1::hello { public fun world() {} }\"\ntree = parser.parse(bytes(code, \"utf8\"))\n\nprint(\"\u2705 \u89e3\u6790\u6210\u529f!\" if not tree.root_node.has_error else \"\u274c \u89e3\u6790\u5931\u8d25\")\n```\n\n### \ud83d\udcd6 \u5b8c\u6574\u6587\u6863\n\u8be6\u7ec6\u7684\u5b89\u88c5\u548c\u4f7f\u7528\u6307\u5357\u5df2\u4fdd\u5b58\u5728 `PACKAGING_GUIDE.md` \u6587\u4ef6\u4e2d\u3002\n\n\u73b0\u5728\u60a8\u7684tree-sitter-move\u5305\u5df2\u7ecf\u53ef\u4ee5\uff1a\n- \u2705 \u672c\u5730\u5b89\u88c5\u4f7f\u7528\n- \u2705 \u5206\u53d1\u7ed9\u5176\u4ed6\u7528\u6237\n- \u2705 \u4e0a\u4f20\u5230PyPI\u4f9b\u5168\u7403\u7528\u6237\u4f7f\u7528\n\n**\ud83c\udf8a \u606d\u559c\uff01\u60a8\u5df2\u7ecf\u6210\u529f\u521b\u5efa\u4e86\u4e00\u4e2a\u53ef\u5206\u53d1\u7684Python\u5305\uff01**\n",
"bugtrack_url": null,
"license": "Copyright \u00a9 Aptos Foundation\n SPDX-License-Identifier: Apache-2.0\n \n Apache License\n Version 2.0, January 2004\n http://www.apache.org/licenses/\n \n TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n \n 1. Definitions.\n \n \"License\" shall mean the terms and conditions for use, reproduction,\n and distribution as defined by Sections 1 through 9 of this document.\n \n \"Licensor\" shall mean the copyright owner or entity authorized by\n the copyright owner that is granting the License.\n \n \"Legal Entity\" shall mean the union of the acting entity and all\n other entities that control, are controlled by, or are under common\n control with that entity. For the purposes of this definition,\n \"control\" means (i) the power, direct or indirect, to cause the\n direction or management of such entity, whether by contract or\n otherwise, or (ii) ownership of fifty percent (50%) or more of the\n outstanding shares, or (iii) beneficial ownership of such entity.\n \n \"You\" (or \"Your\") shall mean an individual or Legal Entity\n exercising permissions granted by this License.\n \n \"Source\" form shall mean the preferred form for making modifications,\n including but not limited to software source code, documentation\n source, and configuration files.\n \n \"Object\" form shall mean any form resulting from mechanical\n transformation or translation of a Source form, including but\n not limited to compiled object code, generated documentation,\n and conversions to other media types.\n \n \"Work\" shall mean the work of authorship, whether in Source or\n Object form, made available under the License, as indicated by a\n copyright notice that is included in or attached to the work\n (an example is provided in the Appendix below).\n \n \"Derivative Works\" shall mean any work, whether in Source or Object\n form, that is based on (or derived from) the Work and for which the\n editorial revisions, annotations, elaborations, or other modifications\n represent, as a whole, an original work of authorship. For the purposes\n of this License, Derivative Works shall not include works that remain\n separable from, or merely link (or bind by name) to the interfaces of,\n the Work and Derivative Works thereof.\n \n \"Contribution\" shall mean any work of authorship, including\n the original version of the Work and any modifications or additions\n to that Work or Derivative Works thereof, that is intentionally\n submitted to Licensor for inclusion in the Work by the copyright owner\n or by an individual or Legal Entity authorized to submit on behalf of\n the copyright owner. For the purposes of this definition, \"submitted\"\n means any form of electronic, verbal, or written communication sent\n to the Licensor or its representatives, including but not limited to\n communication on electronic mailing lists, source code control systems,\n and issue tracking systems that are managed by, or on behalf of, the\n Licensor for the purpose of discussing and improving the Work, but\n excluding communication that is conspicuously marked or otherwise\n designated in writing by the copyright owner as \"Not a Contribution.\"\n \n \"Contributor\" shall mean Licensor and any individual or Legal Entity\n on behalf of whom a Contribution has been received by Licensor and\n subsequently incorporated within the Work.\n \n 2. Grant of Copyright License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n copyright license to reproduce, prepare Derivative Works of,\n publicly display, publicly perform, sublicense, and distribute the\n Work and such Derivative Works in Source or Object form.\n \n 3. Grant of Patent License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n (except as stated in this section) patent license to make, have made,\n use, offer to sell, sell, import, and otherwise transfer the Work,\n where such license applies only to those patent claims licensable\n by such Contributor that are necessarily infringed by their\n Contribution(s) alone or by combination of their Contribution(s)\n with the Work to which such Contribution(s) was submitted. If You\n institute patent litigation against any entity (including a\n cross-claim or counterclaim in a lawsuit) alleging that the Work\n or a Contribution incorporated within the Work constitutes direct\n or contributory patent infringement, then any patent licenses\n granted to You under this License for that Work shall terminate\n as of the date such litigation is filed.\n \n 4. Redistribution. You may reproduce and distribute copies of the\n Work or Derivative Works thereof in any medium, with or without\n modifications, and in Source or Object form, provided that You\n meet the following conditions:\n \n (a) You must give any other recipients of the Work or\n Derivative Works a copy of this License; and\n \n (b) You must cause any modified files to carry prominent notices\n stating that You changed the files; and\n \n (c) You must retain, in the Source form of any Derivative Works\n that You distribute, all copyright, patent, trademark, and\n attribution notices from the Source form of the Work,\n excluding those notices that do not pertain to any part of\n the Derivative Works; and\n \n (d) If the Work includes a \"NOTICE\" text file as part of its\n distribution, then any Derivative Works that You distribute must\n include a readable copy of the attribution notices contained\n within such NOTICE file, excluding those notices that do not\n pertain to any part of the Derivative Works, in at least one\n of the following places: within a NOTICE text file distributed\n as part of the Derivative Works; within the Source form or\n documentation, if provided along with the Derivative Works; or,\n within a display generated by the Derivative Works, if and\n wherever such third-party notices normally appear. The contents\n of the NOTICE file are for informational purposes only and\n do not modify the License. You may add Your own attribution\n notices within Derivative Works that You distribute, alongside\n or as an addendum to the NOTICE text from the Work, provided\n that such additional attribution notices cannot be construed\n as modifying the License.\n \n You may add Your own copyright statement to Your modifications and\n may provide additional or different license terms and conditions\n for use, reproduction, or distribution of Your modifications, or\n for any such Derivative Works as a whole, provided Your use,\n reproduction, and distribution of the Work otherwise complies with\n the conditions stated in this License.\n \n 5. Submission of Contributions. Unless You explicitly state otherwise,\n any Contribution intentionally submitted for inclusion in the Work\n by You to the Licensor shall be under the terms and conditions of\n this License, without any additional terms or conditions.\n Notwithstanding the above, nothing herein shall supersede or modify\n the terms of any separate license agreement you may have executed\n with Licensor regarding such Contributions.\n \n 6. Trademarks. This License does not grant permission to use the trade\n names, trademarks, service marks, or product names of the Licensor,\n except as required for reasonable and customary use in describing the\n origin of the Work and reproducing the content of the NOTICE file.\n \n 7. Disclaimer of Warranty. Unless required by applicable law or\n agreed to in writing, Licensor provides the Work (and each\n Contributor provides its Contributions) on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n implied, including, without limitation, any warranties or conditions\n of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n PARTICULAR PURPOSE. You are solely responsible for determining the\n appropriateness of using or redistributing the Work and assume any\n risks associated with Your exercise of permissions under this License.\n \n 8. Limitation of Liability. In no event and under no legal theory,\n whether in tort (including negligence), contract, or otherwise,\n unless required by applicable law (such as deliberate and grossly\n negligent acts) or agreed to in writing, shall any Contributor be\n liable to You for damages, including any direct, indirect, special,\n incidental, or consequential damages of any character arising as a\n result of this License or out of the use or inability to use the\n Work (including but not limited to damages for loss of goodwill,\n work stoppage, computer failure or malfunction, or any and all\n other commercial damages or losses), even if such Contributor\n has been advised of the possibility of such damages.\n \n 9. Accepting Warranty or Additional Liability. While redistributing\n the Work or Derivative Works thereof, You may choose to offer,\n and charge a fee for, acceptance of support, warranty, indemnity,\n or other liability obligations and/or rights consistent with this\n License. However, in accepting such obligations, You may act only\n on Your own behalf and on Your sole responsibility, not on behalf\n of any other Contributor, and only if You agree to indemnify,\n defend, and hold each Contributor harmless for any liability\n incurred by, or claims asserted against, such Contributor by reason\n of your accepting any such warranty or additional liability.\n \n END OF TERMS AND CONDITIONS\n \n APPENDIX: How to apply the Apache License to your work.\n \n To apply the Apache License to your work, attach the following\n boilerplate notice, with the fields enclosed by brackets \"[]\"\n replaced with your own identifying information. (Don't include\n the brackets!) The text should be enclosed in the appropriate\n comment syntax for the file format. We also recommend that a\n file or class name and description of purpose be included on the\n same \"printed page\" as the copyright notice for easier\n identification within third-party archives.\n \n Copyright 2024 Aptos Foundation \n \n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n \n http://www.apache.org/licenses/LICENSE-2.0\n \n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n ",
"summary": "Move grammar for tree-sitter",
"version": "0.0.2",
"project_urls": {
"Homepage": "https://github.com/tree-sitter/tree-sitter-move",
"Issues": "https://github.com/tree-sitter/tree-sitter-move/issues",
"Repository": "https://github.com/tree-sitter/tree-sitter-move"
},
"split_keywords": [
"incremental",
" parsing",
" tree-sitter",
" move",
" blockchain",
" aptos"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "155ce472b8a8023f00e7c6596a6b6c210d6e7622ba14c967185cba4a5260e7e2",
"md5": "821485e658d9410fc8ddd85a1b2d6dfb",
"sha256": "2149de4dea9f168f5dbb8c714928d3a5fad4215bfd172f9fe0e3c455307ff47c"
},
"downloads": -1,
"filename": "tree_sitter_move-0.0.2-cp38-abi3-macosx_10_13_universal2.whl",
"has_sig": false,
"md5_digest": "821485e658d9410fc8ddd85a1b2d6dfb",
"packagetype": "bdist_wheel",
"python_version": "cp38",
"requires_python": ">=3.8",
"size": 158794,
"upload_time": "2025-07-30T04:27:20",
"upload_time_iso_8601": "2025-07-30T04:27:20.533988Z",
"url": "https://files.pythonhosted.org/packages/15/5c/e472b8a8023f00e7c6596a6b6c210d6e7622ba14c967185cba4a5260e7e2/tree_sitter_move-0.0.2-cp38-abi3-macosx_10_13_universal2.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "88e478fff98742190d2d3640308f79bd3f27f35b1914d0c4f8d7835758d98d60",
"md5": "baa0a7ce1f92c31a0f4554f836161e50",
"sha256": "62d7a979b1f464bbbf6c3bbd39e01bfdfe51c6ba3c889fd4824cc505b4ed628a"
},
"downloads": -1,
"filename": "tree_sitter_move-0.0.2.tar.gz",
"has_sig": false,
"md5_digest": "baa0a7ce1f92c31a0f4554f836161e50",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 354465,
"upload_time": "2025-07-30T04:27:25",
"upload_time_iso_8601": "2025-07-30T04:27:25.032760Z",
"url": "https://files.pythonhosted.org/packages/88/e4/78fff98742190d2d3640308f79bd3f27f35b1914d0c4f8d7835758d98d60/tree_sitter_move-0.0.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-07-30 04:27:25",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "tree-sitter",
"github_project": "tree-sitter-move",
"github_not_found": true,
"lcname": "tree-sitter-move"
}