Skip to content

Commit

Permalink
WIP Use readProtoFiles2 to enable proto_path
Browse files Browse the repository at this point in the history
This update Closes nfultz#29
It uses readProtoFiles2 which enables importing files from other packages by allowing the user to provide a path (protoPath)
  • Loading branch information
Shehab7osny authored Apr 23, 2020
1 parent 4461797 commit f54be23
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions R/parser.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@ read_services <- function(file){

services <- list()
pkg <- ""



import_files <- getOption("import_files", default=as.null())

doServices <- function(i){
service_name <- tokens[i+1]
# services[[service_name]] <<- list()
Expand Down Expand Up @@ -54,8 +55,11 @@ read_services <- function(file){
services[[rpc_name]] <<- fn
return(i)
}

readProtoFiles(file)

if(is.null(import_files))
readProtoFiles2(file)
else
readProtoFiles2(file, protoPath=import_files)

lines <- readLines(file)

Expand Down

0 comments on commit f54be23

Please sign in to comment.