Noir::ClojureScanner
Low-level Clojure reader primitives, shared by the callee extractor in this
directory and by the Clojure framework analyzers — Analyzer::Clojure::Helper
is a thin delegation layer over this module, so the two never drift again.
Every offset here is a byte offset into the raw source (byte_at), never a
character index, so the values stay usable with String#byte_slice on sources
containing non-ASCII text.
Instance methods
Find the offset of the delimiter closing the one at index, skipping over
comments, string literals and character literals so a ) inside ";)" or
a \( never moves the depth counter. Returns index unchanged when no
match is found.
Line number of a byte offset, counted from start_line (1-based by
default, matching a whole-file offset).
Advance from the \ that opens a character literal to the literal's last
byte (the same "last byte consumed" contract as skip_string).
Clojure character literals are \a, \", \(, \\, \; (a single
character, reader-significant ones included), the named forms \newline,
\space, \tab, \formfeed, \backspace and \return, \uXXXX and
\oNNN. Without this, \" opens a string that runs to the next quote in
the file and \( counts as a real open paren, so depth accounting — and
with it every route below the literal — collapses.
Advance past a ; line comment, stopping on the newline that ends it.