Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
baas-ide
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
guxukai
baas-ide
Commits
d26e762b
Commit
d26e762b
authored
Oct 28, 2016
by
Alex Beregszaszi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Pass previously identified sources to gatherImports
parent
850c41ea
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
9 deletions
+16
-9
compiler.js
src/app/compiler.js
+16
-9
No files found.
src/app/compiler.js
View file @
d26e762b
...
...
@@ -26,14 +26,7 @@ function Compiler (editor, handleGithubCall) {
optimize
=
_optimize
}
var
compile
=
function
(
missingInputs
)
{
editor
.
clearAnnotations
()
self
.
event
.
trigger
(
'compilationStarted'
,
[])
var
input
=
editor
.
getValue
()
editor
.
setCacheFileContent
(
input
)
var
files
=
{}
files
[
utils
.
fileNameFromKey
(
editor
.
getCacheFile
())]
=
input
var
internalCompile
=
function
(
files
,
missingInputs
)
{
gatherImports
(
files
,
missingInputs
,
function
(
input
,
error
)
{
if
(
input
===
null
)
{
self
.
lastCompilationResult
=
null
...
...
@@ -43,6 +36,17 @@ function Compiler (editor, handleGithubCall) {
}
})
}
var
compile
=
function
(
missingInputs
)
{
editor
.
clearAnnotations
()
self
.
event
.
trigger
(
'compilationStarted'
,
[])
var
input
=
editor
.
getValue
()
editor
.
setCacheFileContent
(
input
)
var
files
=
{}
files
[
utils
.
fileNameFromKey
(
editor
.
getCacheFile
())]
=
input
internalCompile
(
files
,
missingInputs
)
}
this
.
compile
=
compile
function
setCompileJSON
(
_compileJSON
)
{
...
...
@@ -118,7 +122,8 @@ function Compiler (editor, handleGithubCall) {
self
.
lastCompilationResult
=
null
self
.
event
.
trigger
(
'compilationFinished'
,
[
false
,
data
,
source
])
}
else
if
(
missingInputs
!==
undefined
&&
missingInputs
.
length
>
0
)
{
compile
(
missingInputs
)
// try compiling again with the new set of inputs
internalCompile
(
source
.
sources
,
missingInputs
)
}
else
{
self
.
lastCompilationResult
=
{
data
:
data
,
...
...
@@ -210,6 +215,8 @@ function Compiler (editor, handleGithubCall) {
cb
(
files
[
editor
.
getCacheFile
()])
return
}
// FIXME: This will only match imports if the file begins with one.
// It should tokenize by lines and check each.
// eslint-disable-next-line no-useless-escape
var
importRegex
=
/^
\s
*import
\s
*
[\'\"]([^\'\"]
+
)[\'\"]
;/g
var
reloop
=
false
...
...
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