File tree 2 files changed +78
-0
lines changed
2 files changed +78
-0
lines changed Original file line number Diff line number Diff line change
1
+ # CEDARScript Parser
2
+
3
+ CEDARScript Parser is a Python library for parsing and interpreting CEDARScript, a domain-specific language for code editing and refactoring tasks.
4
+
5
+ ## Features
6
+
7
+ - Parse CEDARScript code into an Abstract Syntax Tree (AST)
8
+ - Support for various code manipulation commands (create, delete, move, update)
9
+ - Error handling and reporting for invalid scripts
10
+
11
+ ## Installation
12
+
13
+ You can install CEDARScript Parser using pip:
14
+
15
+ ```
16
+ pip install cedarscript-parser
17
+ ```
18
+
19
+ ## Usage
20
+
21
+ Here's a quick example of how to use CEDARScript Parser:
22
+
23
+ ``` python
24
+ from cedarscript_parser import CEDARScriptASTParser
25
+
26
+ parser = CEDARScriptASTParser()
27
+ code = """
28
+ CREATE FILE "example.py"
29
+ UPDATE FILE "example.py"
30
+ INSERT AT END OF FILE
31
+ CONTENT
32
+ print("Hello, World!")
33
+ END CONTENT
34
+ END UPDATE
35
+ """
36
+
37
+ commands, errors = parser.parse_script(code)
38
+
39
+ if errors:
40
+ for error in errors:
41
+ print (f " Error: { error} " )
42
+ else :
43
+ for command in commands:
44
+ print (f " Parsed command: { command} " )
45
+ ```
46
+
47
+ ## Contributing
48
+
49
+ Contributions are welcome! Please feel free to submit a Pull Request.
50
+
51
+ ## License
52
+
53
+ This project is licensed under the MIT License.
Original file line number Diff line number Diff line change
1
+ [build-system ]
2
+ requires = [" setuptools>=61.0" , " wheel" ]
3
+ build-backend = " setuptools.build_meta"
4
+
5
+ [project ]
6
+ name = " cedarscript-parser"
7
+ version = " 0.1.0"
8
+ description = " A parser for CEDARScript, a domain-specific language for code editing and refactoring tasks"
9
+ readme = " README.md"
10
+ authors = [{ name = " Your Name" , email = " your.email@example.com" }]
11
+ license = { file = " LICENSE" }
12
+ classifiers = [
13
+ " License :: OSI Approved :: MIT License" ,
14
+ " Programming Language :: Python" ,
15
+ " Programming Language :: Python :: 3" ,
16
+ ]
17
+ keywords = [" parser" , " ast" , " cedarscript" , " code-editing" ]
18
+ dependencies = [
19
+ " tree-sitter" ,
20
+ # Add any other dependencies your project needs
21
+ ]
22
+ requires-python = " >=3.7"
23
+
24
+ [project .urls ]
25
+ Homepage = " https://github.com/yourusername/cedarscript-parser"
You can’t perform that action at this time.
0 commit comments