-
Notifications
You must be signed in to change notification settings - Fork 125
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: rename symbol Signed-off-by: xiarui.xr <[email protected]> * rename: support new name validity check Signed-off-by: xiarui.xr <[email protected]> * minor fixes Signed-off-by: xiarui.xr <[email protected]> * minor updates Signed-off-by: xiarui.xr <[email protected]> --------- Signed-off-by: xiarui.xr <[email protected]>
- Loading branch information
1 parent
db59124
commit 4486c08
Showing
9 changed files
with
273 additions
and
80 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,12 @@ | ||
use regex::Regex; | ||
|
||
#[inline] | ||
pub fn is_private_field(name: &str) -> bool { | ||
name.starts_with('_') | ||
} | ||
|
||
#[inline] | ||
pub fn is_valid_kcl_name(name: &str) -> bool { | ||
let re = Regex::new(r#"^[a-zA-Z_][a-zA-Z0-9_]*$"#).unwrap(); | ||
re.is_match(name) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import .pkg.vars | ||
|
||
Bob = vars.Person { | ||
name: "Bob" | ||
age: 30 | ||
} |
Oops, something went wrong.