Implement the Ident contract
%blame% (%tag% "not a string" l);
Ident = fun l s =>
+ let pattern = m#"_?[a-zA-Z][_a-zA-Z0-9]*"#m in
if %isStr% s then
- //use regex here
+ if (%strMatch% s pattern).index > -1 then
s
+ else
+ %blame% (%tag% "invalid enum tag" l)
else
%blame% (%tag% "not a string" l);
