Skip to content

Commit

Permalink
feat: add file.exsits and file.abs functions (#1157)
Browse files Browse the repository at this point in the history
Signed-off-by: peefy <xpf6677@163.com>
  • Loading branch information
Peefy authored Mar 25, 2024
1 parent 19ad8ca commit dce6f11
Show file tree
Hide file tree
Showing 21 changed files with 281 additions and 191 deletions.
6 changes: 3 additions & 3 deletions kclvm/api/src/service/service_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -173,9 +173,9 @@ impl KclvmServiceImpl {
/// assert_eq!(result.type_errors.len(), 0);
/// assert_eq!(result.symbols.len(), 12);
/// assert_eq!(result.scopes.len(), 3);
/// assert_eq!(result.node_symbol_map.len(), 165);
/// assert_eq!(result.symbol_node_map.len(), 165);
/// assert_eq!(result.fully_qualified_name_map.len(), 173);
/// assert_eq!(result.node_symbol_map.len(), 167);
/// assert_eq!(result.symbol_node_map.len(), 167);
/// assert_eq!(result.fully_qualified_name_map.len(), 175);
/// assert_eq!(result.pkg_scope_map.len(), 3);
/// ```
pub fn load_package(&self, args: &LoadPackageArgs) -> anyhow::Result<LoadPackageResult> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ expression: "format!(\"{:#?}\", p.symbols.values())"
def: Some(
SymbolRef {
id: Index {
index: 153,
index: 155,
generation: 0,
},
kind: Value,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ expression: "format!(\"{:#?}\", p.symbols.values())"
def: Some(
SymbolRef {
id: Index {
index: 153,
index: 155,
generation: 0,
},
kind: Value,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ expression: "format!(\"{:#?}\", p.symbols.values())"
def: Some(
SymbolRef {
id: Index {
index: 153,
index: 155,
generation: 0,
},
kind: Value,
Expand Down
28 changes: 14 additions & 14 deletions kclvm/loader/src/snapshots/kclvm_loader__tests__builtin_call_0.snap
Original file line number Diff line number Diff line change
Expand Up @@ -88,20 +88,6 @@ expression: "format!(\"{:#?}\", p.symbols.values())"
},
),
attrs: [
SymbolRef {
id: Index {
index: 124,
generation: 0,
},
kind: Value,
},
SymbolRef {
id: Index {
index: 125,
generation: 0,
},
kind: Value,
},
SymbolRef {
id: Index {
index: 126,
Expand Down Expand Up @@ -291,6 +277,20 @@ expression: "format!(\"{:#?}\", p.symbols.values())"
},
kind: Value,
},
SymbolRef {
id: Index {
index: 153,
generation: 0,
},
kind: Value,
},
SymbolRef {
id: Index {
index: 154,
generation: 0,
},
kind: Value,
},
],
is_global: false,
},
Expand Down
90 changes: 45 additions & 45 deletions kclvm/loader/src/snapshots/kclvm_loader__tests__builtin_call_1.snap
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ expression: "format!(\"{:#?}\", p.symbols.values())"
def: Some(
SymbolRef {
id: Index {
index: 153,
index: 155,
generation: 0,
},
kind: Value,
Expand Down Expand Up @@ -180,20 +180,6 @@ expression: "format!(\"{:#?}\", p.symbols.values())"
},
),
attrs: [
SymbolRef {
id: Index {
index: 124,
generation: 0,
},
kind: Value,
},
SymbolRef {
id: Index {
index: 125,
generation: 0,
},
kind: Value,
},
SymbolRef {
id: Index {
index: 126,
Expand Down Expand Up @@ -383,6 +369,20 @@ expression: "format!(\"{:#?}\", p.symbols.values())"
},
kind: Value,
},
SymbolRef {
id: Index {
index: 153,
generation: 0,
},
kind: Value,
},
SymbolRef {
id: Index {
index: 154,
generation: 0,
},
kind: Value,
},
],
is_global: false,
},
Expand Down Expand Up @@ -415,27 +415,13 @@ expression: "format!(\"{:#?}\", p.symbols.values())"
def: Some(
SymbolRef {
id: Index {
index: 154,
index: 156,
generation: 0,
},
kind: Value,
},
),
attrs: [
SymbolRef {
id: Index {
index: 124,
generation: 0,
},
kind: Value,
},
SymbolRef {
id: Index {
index: 125,
generation: 0,
},
kind: Value,
},
SymbolRef {
id: Index {
index: 126,
Expand Down Expand Up @@ -625,6 +611,20 @@ expression: "format!(\"{:#?}\", p.symbols.values())"
},
kind: Value,
},
SymbolRef {
id: Index {
index: 153,
generation: 0,
},
kind: Value,
},
SymbolRef {
id: Index {
index: 154,
generation: 0,
},
kind: Value,
},
],
is_global: false,
},
Expand Down Expand Up @@ -664,20 +664,6 @@ expression: "format!(\"{:#?}\", p.symbols.values())"
},
),
attrs: [
SymbolRef {
id: Index {
index: 124,
generation: 0,
},
kind: Value,
},
SymbolRef {
id: Index {
index: 125,
generation: 0,
},
kind: Value,
},
SymbolRef {
id: Index {
index: 126,
Expand Down Expand Up @@ -867,6 +853,20 @@ expression: "format!(\"{:#?}\", p.symbols.values())"
},
kind: Value,
},
SymbolRef {
id: Index {
index: 153,
generation: 0,
},
kind: Value,
},
SymbolRef {
id: Index {
index: 154,
generation: 0,
},
kind: Value,
},
],
is_global: false,
},
Expand Down Expand Up @@ -899,7 +899,7 @@ expression: "format!(\"{:#?}\", p.symbols.values())"
def: Some(
SymbolRef {
id: Index {
index: 155,
index: 157,
generation: 0,
},
kind: Value,
Expand Down
Loading

0 comments on commit dce6f11

Please sign in to comment.