module Fonte module Parsers grammar SteamID include Number rule steam_id steam_id_pending / steam_id_bot / steam_id_console / steam_id_invalid / universe:steam_universe ":" id_part:steam_id_part ":" account_number:steam_account_number { def value text_value end } end rule steam_id_pending "STEAM_ID_PENDING" { def pending? true end } end rule steam_id_bot "Bot" { def bot? true end } end rule steam_id_console "Console" { def console? true end } end rule steam_id_invalid "UNKNOWN" { def unknown? true end } end rule steam_universe "STEAM_" universe:[0-9] end rule steam_id_part [01] { def value text_value.to_i end } end rule steam_account_number integer end end end end