Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
djinni
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
cpp-libs
djinni
Commits
512f3dc1
Commit
512f3dc1
authored
Dec 09, 2016
by
Kenny Kaye
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Finish searching for import files after one is found in the include path
parent
a8c89710
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
8 deletions
+8
-8
src/source/parser.scala
src/source/parser.scala
+8
-8
No files found.
src/source/parser.scala
View file @
512f3dc1
...
...
@@ -26,6 +26,7 @@ import java.util.{Map => JMap}
import
org.yaml.snakeyaml.Yaml
import
scala.collection.JavaConversions._
import
scala.collection.mutable
import
scala.util.control.Breaks._
import
scala.util.parsing.combinator.RegexParsers
import
scala.util.parsing.input.
{
Position
,
Positional
}
...
...
@@ -53,16 +54,15 @@ private object IdlParser extends RegexParsers {
def
importFile
(
fileName
:
String
)
:
File
=
{
var
file
:
Option
[
File
]
=
None
includePaths
.
foreach
(
path
=>
{
if
(
file
.
isEmpty
)
{
var
relPath
=
if
(
path
.
isEmpty
)
fileParent
else
path
+
"/"
val
tmp
=
new
File
(
relPath
+
fileName
);
if
(
tmp
.
exists
)
file
=
Some
(
tmp
)
}
val
path
=
includePaths
.
find
(
path
=>
{
val
relPath
=
if
(
path
.
isEmpty
)
fileParent
else
path
+
"/"
val
tmp
=
new
File
(
relPath
+
fileName
)
val
exists
=
tmp
.
exists
if
(
exists
)
file
=
Some
(
tmp
)
exists
})
if
(
file
.
isEmpty
)
throw
new
FileNotFoundException
(
"Unable to find file \""
+
fileName
+
"\" at "
+
fileStack
.
top
.
getCanonicalPath
)
if
(
path
.
isEmpty
||
file
.
isEmpty
)
throw
new
FileNotFoundException
(
"Unable to find file \""
+
fileName
+
"\" at "
+
fileStack
.
top
.
getCanonicalPath
)
return
file
.
get
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment