Skip to content

Commit

Permalink
chore: remove unused AST module name
Browse files Browse the repository at this point in the history
Signed-off-by: peefy <[email protected]>
  • Loading branch information
Peefy committed Oct 24, 2024
1 parent 3cbb37d commit 80f89d0
Show file tree
Hide file tree
Showing 155 changed files with 1 addition and 157 deletions.
2 changes: 1 addition & 1 deletion kclvm/api/src/testdata/parse-file.response.json

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion kclvm/ast/src/ast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,6 @@ impl Program {
pub struct Module {
pub filename: String,
pub doc: Option<NodeRef<String>>,
pub name: String,
pub body: Vec<NodeRef<Stmt>>,
pub comments: Vec<NodeRef<Comment>>,
}
Expand Down
3 changes: 0 additions & 3 deletions kclvm/ast/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,6 @@ fn test_filter_schema_with_no_schema() {
let ast_mod = Module {
filename: "".to_string(),
doc: Some(node_ref!("".to_string())),
name: "".to_string(),
body: vec![],
comments: vec![],
};
Expand All @@ -193,7 +192,6 @@ fn test_filter_schema_with_one_schema() {
let mut ast_mod = Module {
filename: "".to_string(),
doc: Some(node_ref!("".to_string())),
name: "".to_string(),
body: vec![],
comments: vec![],
};
Expand All @@ -209,7 +207,6 @@ fn test_filter_schema_with_mult_schema() {
let mut ast_mod = Module {
filename: "".to_string(),
doc: Some(node_ref!("".to_string())),
name: "".to_string(),
body: vec![],
comments: vec![],
};
Expand Down
1 change: 0 additions & 1 deletion kclvm/parser/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,6 @@ pub fn parse_file_with_session(
let mut p = parser::Parser::new(&sess, stream);
let mut m = p.parse_module();
m.filename = filename.to_string().adjust_canonicalization();
m.name = kclvm_ast::MAIN_PKG.to_string();

Ok(m)
}
Expand Down
1 change: 0 additions & 1 deletion kclvm/parser/src/parser/module.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ impl<'a> Parser<'a> {
let body = self.parse_body();
Module {
filename: "".to_string(),
name: "".to_string(),
doc,
comments: self.comments.clone(),
body,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ expression: "crate::tests::parsing_file_ast_json(\"hello.k\", r####\"a=123\"####
{
"filename": "hello.k",
"doc": null,
"name": "__main__",
"body": [
{
"node": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ expression: "crate::tests::parsing_file_ast_json(\"hello.k\",\n r####\"\n# co
{
"filename": "hello.k",
"doc": null,
"name": "__main__",
"body": [
{
"node": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ expression: "crate::tests::parsing_file_ast_json(\"hello.k\",\n r####\"\na =
{
"filename": "hello.k",
"doc": null,
"name": "__main__",
"body": [
{
"node": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ expression: "crate::tests::parsing_file_ast_json(\"hello.k\",\n r####\"\ndata
{
"filename": "hello.k",
"doc": null,
"name": "__main__",
"body": [
{
"node": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ expression: "crate::tests::parsing_file_ast_json(\"hello.k\",\n r####\"\nsche
{
"filename": "hello.k",
"doc": null,
"name": "__main__",
"body": [
{
"node": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ expression: "crate::tests::parsing_module_string(r#\"assert\"#)"
Module {
filename: "",
doc: None,
name: "",
body: [
Node {
node: Assert(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ expression: "crate::tests::parsing_module_string(r#\"assert a.\"#)"
Module {
filename: "",
doc: None,
name: "",
body: [
Node {
node: Assert(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ expression: "crate::tests::parsing_module_string(r#\"assert True,,, 'msg'\"#)"
Module {
filename: "",
doc: None,
name: "",
body: [
Node {
node: Assert(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ expression: "crate::tests::parsing_module_string(r#\"assert True if data else 'm
Module {
filename: "",
doc: None,
name: "",
body: [
Node {
node: Assert(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ expression: "crate::tests::parsing_module_string(r#\"a = \"#)"
Module {
filename: "",
doc: None,
name: "",
body: [
Node {
node: Assign(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ expression: "crate::tests::parsing_module_string(r#\" = 1\"#)"
Module {
filename: "",
doc: None,
name: "",
body: [
Node {
node: Expr(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ expression: "crate::tests::parsing_module_string(r#\"a[0] -= 1\"#)"
Module {
filename: "",
doc: None,
name: "",
body: [
Node {
node: AugAssign(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ expression: "crate::tests::parsing_module_string(r#\"a[0].b -= 1\"#)"
Module {
filename: "",
doc: None,
name: "",
body: [
Node {
node: AugAssign(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ expression: "crate::tests::parsing_module_string(r#\"a.b[0] = 1\"#)"
Module {
filename: "",
doc: None,
name: "",
body: [
Node {
node: Assign(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ expression: "crate::tests::parsing_module_string(r#\"a().b = 1\"#)"
Module {
filename: "",
doc: None,
name: "",
body: [
Node {
node: Assign(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ expression: "crate::tests::parsing_module_string(r#\"a.b[1:2] = 1\"#)"
Module {
filename: "",
doc: None,
name: "",
body: [
Node {
node: Assign(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ expression: "crate::tests::parsing_module_string(r#\"a.b[1::2].c = 1\"#)"
Module {
filename: "",
doc: None,
name: "",
body: [
Node {
node: Assign(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ expression: "crate::tests::parsing_module_string(r#\"a.b[c.d].e = 1\"#)"
Module {
filename: "",
doc: None,
name: "",
body: [
Node {
node: Assign(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ expression: "crate::tests::parsing_module_string(r#\"a.b[1 + 1].e = 1\"#)"
Module {
filename: "",
doc: None,
name: "",
body: [
Node {
node: Assign(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ expression: "crate::tests::parsing_module_string(r#\"a.b[f()].e = 1\"#)"
Module {
filename: "",
doc: None,
name: "",
body: [
Node {
node: Assign(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ expression: "crate::tests::parsing_module_string(r#\"a: int =\"#)"
Module {
filename: "",
doc: None,
name: "",
body: [
Node {
node: Assign(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ expression: "crate::tests::parsing_module_string(r#\"a: a = 1\"#)"
Module {
filename: "",
doc: None,
name: "",
body: [
Node {
node: Assign(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ expression: "crate::tests::parsing_module_string(r#\"a:\"#)"
Module {
filename: "",
doc: None,
name: "",
body: [
Node {
node: Assign(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ expression: "crate::tests::parsing_module_string(r#\"a = b = \"#)"
Module {
filename: "",
doc: None,
name: "",
body: [
Node {
node: Assign(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ expression: "crate::tests::parsing_module_string(r#\"a() = b. = c\"#)"
Module {
filename: "",
doc: None,
name: "",
body: [
Node {
node: Assign(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ expression: "crate::tests::parsing_module_string(r#\"a: () = 0\"#)"
Module {
filename: "",
doc: None,
name: "",
body: [
Node {
node: Assign(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ expression: "crate::tests::parsing_module_string(r#\"a: () = 0\"#)"
Module {
filename: "",
doc: None,
name: "",
body: [
Node {
node: Assign(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ expression: "crate::tests::parsing_module_string(r#\"a ++= 1\"#)"
Module {
filename: "",
doc: None,
name: "",
body: [],
comments: [],
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ expression: "crate::tests::parsing_module_string(r#\"a:(\"#)"
Module {
filename: "",
doc: None,
name: "",
body: [
Node {
node: Assign(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ expression: "crate::tests::parsing_module_string(r#\"a:(i\"#)"
Module {
filename: "",
doc: None,
name: "",
body: [
Node {
node: Assign(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ expression: "crate::tests::parsing_module_string(r#\"a:({\"#)"
Module {
filename: "",
doc: None,
name: "",
body: [
Node {
node: Assign(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ expression: "crate::tests::parsing_module_string(r#\"a:({i\"#)"
Module {
filename: "",
doc: None,
name: "",
body: [
Node {
node: Assign(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ expression: "crate::tests::parsing_module_string(r#\"a:({i:\"#)"
Module {
filename: "",
doc: None,
name: "",
body: [
Node {
node: Assign(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ expression: "crate::tests::parsing_module_string(r#\"a:({i:i\"#)"
Module {
filename: "",
doc: None,
name: "",
body: [
Node {
node: Assign(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ expression: "crate::tests::parsing_module_string(r#\"a:({i:int\"#)"
Module {
filename: "",
doc: None,
name: "",
body: [
Node {
node: Assign(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ expression: "crate::tests::parsing_module_string(r#\"a:({i:int]\"#)"
Module {
filename: "",
doc: None,
name: "",
body: [
Node {
node: Assign(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ expression: "crate::tests::parsing_module_string(r#\"a:({str:int]\"#)"
Module {
filename: "",
doc: None,
name: "",
body: [
Node {
node: Assign(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ expression: "crate::tests::parsing_module_string(r#\"a:({str:int}\"#)"
Module {
filename: "",
doc: None,
name: "",
body: [
Node {
node: Assign(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ expression: "crate::tests::parsing_module_string(r#\"a:({str:int} ->\"#)"
Module {
filename: "",
doc: None,
name: "",
body: [
Node {
node: Assign(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ expression: "crate::tests::parsing_module_string(r#\"a:({str:int}) -> i\"#)"
Module {
filename: "",
doc: None,
name: "",
body: [
Node {
node: Assign(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ expression: "crate::tests::parsing_module_string(r#\"a:(int\"#)"
Module {
filename: "",
doc: None,
name: "",
body: [
Node {
node: Assign(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ expression: "crate::tests::parsing_module_string(r#\"a:(str|int) -> i\"#)"
Module {
filename: "",
doc: None,
name: "",
body: [
Node {
node: Assign(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ expression: "crate::tests::parsing_module_string(r#\"a:(str|int, int) -> i\"#)"
Module {
filename: "",
doc: None,
name: "",
body: [
Node {
node: Assign(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ expression: "crate::tests::parsing_module_string(r#\"a:(str|int, int|\"#)"
Module {
filename: "",
doc: None,
name: "",
body: [
Node {
node: Assign(
Expand Down
Loading

0 comments on commit 80f89d0

Please sign in to comment.