Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 45 lines (36 sloc) 1.126 kB
78d3259 @gatesphere auto
authored
1 // silica programming language
2 // Jacob M. Peck
18d19d4 @gatesphere Initial commit.
authored
3 // silica REPL namespace and loader
4
5 silica REPL := Object clone // namespace
6
a1934e9 @gatesphere Added some structure and self-documentation.
authored
7 // load REPL files
78d3259 @gatesphere auto
authored
8 if(?REPL_DEBUG, writeln("Loading REPL files..."))
a1e00ed @gatesphere Beginnings of a REPL. No functionality yet, but it has history.
authored
9
a1934e9 @gatesphere Added some structure and self-documentation.
authored
10 silica replFileList := list(
6d729ee @gatesphere Parser restructuring, part 1
authored
11 "Parser.io",
a1934e9 @gatesphere Added some structure and self-documentation.
authored
12 "REPL.io"
18d19d4 @gatesphere Initial commit.
authored
13 )
a1e00ed @gatesphere Beginnings of a REPL. No functionality yet, but it has history.
authored
14
a1934e9 @gatesphere Added some structure and self-documentation.
authored
15 silica replFileList foreach(f,
16 doRelativeFile(f)
17 )
78d3259 @gatesphere auto
authored
18
19 // initialize everything
20 if(?REPL_DEBUG, writeln("Initializing REPL..."))
a1e00ed @gatesphere Beginnings of a REPL. No functionality yet, but it has history.
authored
21 if(?REPL_DEBUG, writeln(" + Initializing prompt..."))
22 silica REPL REPL initialize
23
24 if(?REPL_DEBUG, writeln(" + Loading REPL command history..."))
900de90 @gatesphere Fixed 3 bugs, added -remove.
authored
25 if(REPL_LOAD_HISTORY,
26 silica REPL REPL loadHistory
27 REPL_LOAD_HISTORY = false
28 )
a1e00ed @gatesphere Beginnings of a REPL. No functionality yet, but it has history.
authored
29
b7de43d @gatesphere Added support for autoexec.silica
authored
30 if(?REPL_DEBUG, writeln(" + Autoexec..."))
31 if(?AUTOEXEC,
32 if(File with(AUTOEXEC) exists,
33 if(?REPL_DEBUG, writeln(" + autoexec.silica found. Loading..."))
34 silica exit := false
35 silica REPL REPL run(AUTOEXEC, true)
36 ,
37 if(?REPL_DEBUG, writeln(" + autoexec.silica not found. Skipping..."))
38 )
39 )
40
a1e00ed @gatesphere Beginnings of a REPL. No functionality yet, but it has history.
authored
41 if(?REPL_DEBUG, writeln(" + Starting REPL..."))
543af14 @gatesphere macros and commands now work.
authored
42 silica exit := false
c354af6 @gatesphere More namespace stuff... also scripting now.
authored
43 silica REPL REPL run(SCRIPT_FILE)
1883124 @gatesphere In scripting mode, now checks for file existence, exiting gracefully …
authored
44 if(?REPL_DEBUG, writeln(" + Exiting..."))
Something went wrong with that request. Please try again.