| 1 |
% Generated by roxygen2: do not edit by hand |
| 2 |
% Please edit documentation in R/decor.R |
| 3 |
\name{parse_cpp_function} |
| 4 |
\alias{parse_cpp_function} |
| 5 |
\title{Parse a C++ function} |
| 6 |
\usage{ |
| 7 |
parse_cpp_function(context, is_attribute = FALSE) |
| 8 |
} |
| 9 |
\arguments{ |
| 10 |
\item{context}{The function context, as obtained by the `context` column from [cpp_decorations()]} |
| 11 |
|
| 12 |
\item{is_attribute}{If `TRUE` the decorations are C++11 attributes, if `FALSE` they are comments.} |
| 13 |
} |
| 14 |
\value{ |
| 15 |
A tibble with the following fields: |
| 16 |
- name - The name of the function |
| 17 |
- return_type - The return type of the function |
| 18 |
- args - A list column containing a tibble of the functions arguments |
| 19 |
- type - The type of the argument |
| 20 |
- name - The name of the argument |
| 21 |
- default - The default value of the argument (if any). |
| 22 |
} |
| 23 |
\description{ |
| 24 |
Parses a C++ function returning a tibble with the function name and return |
| 25 |
type and a list column with the arguments of the function. |
| 26 |
} |
| 27 |
\examples{ |
| 28 |
# Setup |
| 29 |
context <- "int fun(int x) { return x + 1; }" |
| 30 |
|
| 31 |
# Parse the function |
| 32 |
parse_cpp_function(context) |
| 33 |
} |