rbatis_codegen/codegen/syntax_tree_pysql/continue_node.rs
1use crate::codegen::syntax_tree_pysql::{ToHtml, Name};
2
3/// Represents a `continue` node in py_sql.
4/// It's used to skip the current iteration of a loop and proceed to the next one, typically within a `foreach` block.
5///
6/// # Example
7///
8/// PySQL syntax:
9/// ```py
10/// for item in collection:
11/// if item == 'skip_this':
12/// continue
13/// # process item
14/// ```
15#[derive(Clone, Debug, Eq, PartialEq)]
16pub struct ContinueNode {}
17
18impl ToHtml for ContinueNode {
19 fn as_html(&self) -> String {
20 format!("<continue/>")
21 }
22}
23
24impl Name for ContinueNode {
25 fn name() -> &'static str {
26 "continue"
27 }
28}