mirror of
https://github.com/microsoft/regorus.git
synced 2026-08-05 02:16:11 +00:00
f727096a1d
Add the compiler module structure with: - core.rs: Compiler struct, CountBinding, new(), compile() pipeline, register allocation, span/emit helpers - mod.rs: module declarations, public entry points (compile_policy_rule, compile_policy_definition, etc.) - utils.rs: pure helper functions (path splitting, JSON conversion) - Stub files for conditions, expressions, fields, template dispatch, count, effects, and metadata — real implementations follow in subsequent commits.
30 lines
737 B
Rust
30 lines
737 B
Rust
// Copyright (c) Microsoft Corporation.
|
|
// Licensed under the MIT License.
|
|
#![allow(dead_code)]
|
|
|
|
//! `count` / `count.where` loop compilation.
|
|
//!
|
|
//! Stub — real implementation added in a later commit.
|
|
|
|
use anyhow::{bail, Result};
|
|
|
|
use crate::languages::azure_policy::ast::{Condition, CountNode};
|
|
|
|
use super::core::Compiler;
|
|
|
|
impl Compiler {
|
|
pub(super) fn compile_count(&mut self, _count_node: &CountNode) -> Result<u8> {
|
|
let _ = self;
|
|
bail!("count compilation not yet implemented")
|
|
}
|
|
|
|
pub(super) const fn try_compile_count_as_any(
|
|
&mut self,
|
|
_count_node: &CountNode,
|
|
_condition: &Condition,
|
|
) -> Result<Option<u8>> {
|
|
_ = self.register_counter;
|
|
Ok(None)
|
|
}
|
|
}
|