Sifter.Utils (Sifter v0.2.0)

View Source

Utilities shared by the Sifter lexer/parser.

Snakecase rules per segment (segments are dot-separated):

  • Insert _ only at lower|digit → UPPER boundaries (e.g. firstNamefirst_name, id2Xid2_x)
  • No acronym splitting (e.g. APIKeyapikey, not api_key)
  • Map - and space to _, collapse consecutive _, lowercase everything
  • Apply independently to each dot-separated segment (dots preserved)

Summary

Functions

segment_snake(seg)

@spec segment_snake(binary()) :: binary()

to_snake_case(str)

@spec to_snake_case(binary()) :: binary()