default_style

0th

Percentile

Default prettycode syntax highlighting style

A style function must return a named list of functions. Possible entries:

  • reserved: reserved words

  • number: numeric literals

  • null: the NULL constant

  • operator: operators, including assignment

  • call: function calls

  • string: character literals

  • comment: comments

Usage
default_style()
Details

Each entry in a list must be a function that takes a character scalar, and returns a character scalar. The default style adds ANSI formatting to the code.

Note that you can also change the code if you like, e.g. to include a unicode arrow character instead of the two-character assignment operator.

Aliases
  • default_style
Examples
# NOT RUN {
highlight(deparse(get), style = default_style())
# }
Documentation reproduced from package prettycode, version 1.0.2, License: MIT + file LICENSE

Community examples

Looks like there are no examples yet.