vile / scheme / syntax_match_memo.v
20 lines · 16 sloc · 452 bytes · 76646891b77a3d5c6af4a1e42b122cd61dc1654b
Raw
1module scheme
2
3struct SyntaxPatternConstants {
4 nodes map[u64]int
5}
6
7struct PlainSyntaxMatch {}
8struct SharedSyntaxMatch {}
9
10// Only completed, capture-free compound matches enter this invocation-local
11// table. Repetition lengths and captured values retain their original writes.
12struct SyntaxMatchMemo {
13mut:
14 completed map[u64]bool
15}
16
17@[inline]
18fn syntax_match_key(pattern i32, input i32) u64 {
19 return (u64(u32(pattern)) << 32) | u64(u32(input))
20}
21