is_shebang: Identify comments that are shebangs

View source: R/expr-is.R

is_shebangR Documentation

Identify comments that are shebangs

Description

Shebangs should be preserved and no space should be inserted between ⁠#⁠ and !. A comment is a shebang if it is the first top-level token (identified with pos_id) and if it starts with ⁠#!⁠.

Usage

is_shebang(pd)

Arguments

pd

A parse table.

Examples

style_text("#!/usr/bin/env Rscript")

krlmlr/styler documentation built on April 8, 2024, 7:53 p.m.