Skip to content

Commit 99ace3a

Browse files
authored
chore: remove unused AST module name (#1713)
Signed-off-by: peefy <[email protected]>
1 parent 3cbb37d commit 99ace3a

File tree

155 files changed

+1
-157
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

155 files changed

+1
-157
lines changed

kclvm/api/src/testdata/parse-file.response.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

kclvm/ast/src/ast.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,6 @@ impl Program {
423423
pub struct Module {
424424
pub filename: String,
425425
pub doc: Option<NodeRef<String>>,
426-
pub name: String,
427426
pub body: Vec<NodeRef<Stmt>>,
428427
pub comments: Vec<NodeRef<Comment>>,
429428
}

kclvm/ast/src/tests.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,6 @@ fn test_filter_schema_with_no_schema() {
180180
let ast_mod = Module {
181181
filename: "".to_string(),
182182
doc: Some(node_ref!("".to_string())),
183-
name: "".to_string(),
184183
body: vec![],
185184
comments: vec![],
186185
};
@@ -193,7 +192,6 @@ fn test_filter_schema_with_one_schema() {
193192
let mut ast_mod = Module {
194193
filename: "".to_string(),
195194
doc: Some(node_ref!("".to_string())),
196-
name: "".to_string(),
197195
body: vec![],
198196
comments: vec![],
199197
};
@@ -209,7 +207,6 @@ fn test_filter_schema_with_mult_schema() {
209207
let mut ast_mod = Module {
210208
filename: "".to_string(),
211209
doc: Some(node_ref!("".to_string())),
212-
name: "".to_string(),
213210
body: vec![],
214211
comments: vec![],
215212
};

kclvm/parser/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,6 @@ pub fn parse_file_with_session(
201201
let mut p = parser::Parser::new(&sess, stream);
202202
let mut m = p.parse_module();
203203
m.filename = filename.to_string().adjust_canonicalization();
204-
m.name = kclvm_ast::MAIN_PKG.to_string();
205204

206205
Ok(m)
207206
}

kclvm/parser/src/parser/module.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ impl<'a> Parser<'a> {
1212
let body = self.parse_body();
1313
Module {
1414
filename: "".to_string(),
15-
name: "".to_string(),
1615
doc,
1716
comments: self.comments.clone(),
1817
body,

kclvm/parser/src/tests/snapshots/kclvm_parser__tests__ast__assign_stmt.snap

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ expression: "crate::tests::parsing_file_ast_json(\"hello.k\", r####\"a=123\"####
55
{
66
"filename": "hello.k",
77
"doc": null,
8-
"name": "__main__",
98
"body": [
109
{
1110
"node": {

kclvm/parser/src/tests/snapshots/kclvm_parser__tests__ast__basic_stmt.snap

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ expression: "crate::tests::parsing_file_ast_json(\"hello.k\",\n r####\"\n# co
55
{
66
"filename": "hello.k",
77
"doc": null,
8-
"name": "__main__",
98
"body": [
109
{
1110
"node": {

kclvm/parser/src/tests/snapshots/kclvm_parser__tests__ast__if_stmt_0.snap

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ expression: "crate::tests::parsing_file_ast_json(\"hello.k\",\n r####\"\na =
55
{
66
"filename": "hello.k",
77
"doc": null,
8-
"name": "__main__",
98
"body": [
109
{
1110
"node": {

kclvm/parser/src/tests/snapshots/kclvm_parser__tests__ast__if_stmt_1.snap

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ expression: "crate::tests::parsing_file_ast_json(\"hello.k\",\n r####\"\ndata
55
{
66
"filename": "hello.k",
77
"doc": null,
8-
"name": "__main__",
98
"body": [
109
{
1110
"node": {

kclvm/parser/src/tests/snapshots/kclvm_parser__tests__ast__schema_stmt.snap

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ expression: "crate::tests::parsing_file_ast_json(\"hello.k\",\n r####\"\nsche
55
{
66
"filename": "hello.k",
77
"doc": null,
8-
"name": "__main__",
98
"body": [
109
{
1110
"node": {

0 commit comments

Comments
 (0)