MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / tokenize_simple_if

Function tokenize_simple_if

nodedb/src/control/planner/procedural/tokenizer.rs:286–294  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

284
285 #[test]
286 fn tokenize_simple_if() {
287 let tokens = tokenize("IF x > 0 THEN RETURN 1; END IF;").unwrap();
288 assert_eq!(tokens[0], Token::If);
289 assert_eq!(tokens[1], Token::Ident("x".into()));
290 // '>' is captured as Ident(">")
291 assert!(tokens.contains(&Token::Then));
292 assert!(tokens.contains(&Token::Return));
293 assert!(tokens.contains(&Token::EndIf));
294 }
295
296 #[test]
297 fn tokenize_begin_end() {

Callers

nothing calls this directly

Calls 1

tokenizeFunction · 0.70

Tested by

no test coverage detected