Expand description
Grammar parsing for magic files using nom parser combinators
This module implements the parsing logic for magic file syntax, converting text-based magic rules into the AST representation defined in ast.rs.
Functionsยง
- has_
continuation - Check if a line ends with a continuation character ()
- is_
comment_ line - Check if a line is a comment (starts with #)
- is_
empty_ line - Check if a line is empty or contains only whitespace
- is_
strength_ directive - Check if a line is a strength directive (starts with !:strength)
- parse_
comment - Parse a comment line (starts with #)
- parse_
magic_ rule - Parse a complete magic rule line from text format
- parse_
message - Parse the message part of a magic rule
- parse_
number - Parse a decimal or hexadecimal number
- parse_
offset - Parse an offset specification for absolute offsets
- parse_
operator - Parse comparison operators for magic rules
- parse_
rule_ offset - Parse the indentation level and offset for magic rules
- parse_
strength_ directive - Parse a strength directive (
!:strengthline) - parse_
type - Parse a type specification (byte, short, long, quad, string, etc.)
- parse_
type_ and_ operator - Parse a type specification with an optional attached bitwise-AND mask operator
(e.g.,
lelong&0xf0000000). - parse_
value - Parse string and numeric literals for magic rule values