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
f2e35572
Commit
f2e35572
authored
Jan 15, 2016
by
Andrew Twyman
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #190 from guycnicholas/root_djinni_file_error
Fix imports for files in the root directory
parents
1a25dbb4
bd30f7ee
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
7 deletions
+12
-7
src/source/parser.scala
src/source/parser.scala
+12
-7
No files found.
src/source/parser.scala
View file @
f2e35572
...
@@ -39,14 +39,19 @@ private object IdlParser extends RegexParsers {
...
@@ -39,14 +39,19 @@ private object IdlParser extends RegexParsers {
def
idlFile
(
origin
:
String
)
:
Parser
[
IdlFile
]
=
rep
(
importFile
)
~
rep
(
typeDecl
(
origin
))
^^
{
case
imp
~
types
=>
IdlFile
(
imp
,
types
)
}
def
idlFile
(
origin
:
String
)
:
Parser
[
IdlFile
]
=
rep
(
importFile
)
~
rep
(
typeDecl
(
origin
))
^^
{
case
imp
~
types
=>
IdlFile
(
imp
,
types
)
}
def
importFile
:
Parser
[
FileRef
]
=
(
"@"
~>
directive
)
~
(
"\""
~>
filePath
<~
"\""
)
^^
{
def
importFile
:
Parser
[
FileRef
]
=
{
def
fileParent
:
String
=
if
(
fileStack
.
top
.
getParent
()
!=
null
)
return
fileStack
.
top
.
getParent
()
+
"/"
else
return
""
(
"@"
~>
directive
)
~
(
"\""
~>
filePath
<~
"\""
)
^^
{
case
"import"
~
x
=>
case
"import"
~
x
=>
val
newPath
=
fileStack
.
top
.
getParent
()
+
"/"
+
x
val
newPath
=
fileParent
+
x
new
IdlFileRef
(
new
File
(
newPath
))
new
IdlFileRef
(
new
File
(
newPath
))
case
"extern"
~
x
=>
case
"extern"
~
x
=>
val
newPath
=
fileStack
.
top
.
getParent
()
+
"/"
+
x
val
newPath
=
fileParent
+
x
new
ExternFileRef
(
new
File
(
newPath
))
new
ExternFileRef
(
new
File
(
newPath
))
}
}
}
def
filePath
=
"[^\"]*"
.
r
def
filePath
=
"[^\"]*"
.
r
def
directive
=
importDirective
|
externDirective
def
directive
=
importDirective
|
externDirective
...
...
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