Skip to content

Commit

Permalink
fix: allow more builtin fields
Browse files Browse the repository at this point in the history
  • Loading branch information
Desdaemon committed May 21, 2024
1 parent 13fe489 commit 20a554a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
2 changes: 2 additions & 0 deletions src/analyze.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,10 @@ static MODEL_METHODS: phf::Set<&[u8]> = phf::phf_set!(
b"with_env",
b"sudo",
b"_for_xml_id",
b"exists",
// TODO: Limit to Forms only
b"new",
b"save",
);

/// The subset of types that may resolve to a model.
Expand Down
14 changes: 11 additions & 3 deletions src/python.rs
Original file line number Diff line number Diff line change
Expand Up @@ -998,10 +998,18 @@ impl Backend {
}

let attribute = attribute.unwrap();
static MODEL_BUILTINS: phf::Set<&str> =
phf::phf_set!("env", "id", "ids", "display_name", "create_date", "write_date");
static MODEL_BUILTINS: phf::Set<&str> = phf::phf_set!(
"env",
"id",
"ids",
"display_name",
"create_date",
"write_date",
"pool",
"record"
);
let prop = String::from_utf8_lossy(&contents[attribute.byte_range()]);
if prop.starts_with(' ') || MODEL_BUILTINS.contains(&prop) {
if prop.starts_with('_') || MODEL_BUILTINS.contains(&prop) {
return ControlFlow::Continue(entered);
}

Expand Down

0 comments on commit 20a554a

Please sign in to comment.