-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
/
index.html
206 lines (196 loc) · 9.83 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
<!DOCTYPE html>
<html lang="en">
<head>
<title>Compiler Explorer</title>
<link href="ext/bootstrap/css/bootstrap.css" rel="stylesheet">
<link href="ext/codemirror/codemirror.css" rel="stylesheet">
<link href="gcc.css" rel="stylesheet">
<script src="client-options.js"></script>
<script src="ext/codemirror/codemirror.js"></script>
<script src="asm-mode.js"></script>
<script src="ext/jquery/jquery-1.7.1.min.js"></script>
<script src="compiler.js"></script>
<script src="gcc.js"></script>
<script src="ext/bootstrap/js/bootstrap.js"></script>
<script src="ext/lz-string/lz-string-1.3.3-min.js"></script>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', OPTIONS.google_analytics_account]);
_gaq.push(['_trackPageview']);
setTimeout(function () {
"use strict";
function create_script_element(id, url) {
var el = document.createElement('script');
el.type = 'text/javascript';
el.async = true;
el.id = id;
el.src = url;
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(el, s);
}
create_script_element('urlshortener', 'urlshorten-' + OPTIONS.urlshortener + ".js");
if (OPTIONS.google_analytics_enabled)
create_script_element('ga', ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js');
if (OPTIONS.sharing_enabled) {
create_script_element('gp', 'https://apis.google.com/js/plusone.js');
create_script_element('twitter-wjs', '//platform.twitter.com/widgets.js');
(function (document, script, id) {
var js, r = document.getElementsByTagName(script)[0], protocol = /^http:/.test(document.location) ? 'http' : 'https';
if (!document.getElementById(id)) {
js = document.createElement(script);
js.id = id;
js.src = protocol + '://widgets.changetip.com/public/js/widgets.js';
r.parentNode.insertBefore(js, r)
}
}(document, 'script', 'changetip_w_0'));
(function(document, i) {
var f,s=document.getElementById(i);
f=document.createElement('iframe');
f.src='//api.flattr.com/button/view/?uid=mattgodbolt&button=compact&url='+encodeURIComponent(document.URL);
f.title='Flattr';
f.height=20;
f.width=110;
f.style.borderWidth=0;
s.appendChild(f);
}(document, 'flattr_button'));
}
}, 0);
</script>
</head>
<body>
<div class="navbar navbar-fixed-top">
<div class="navbar-inner">
<div class="container-fluid">
<a class="brand" href="#">Interactive compiler - <span class="language-name"></span></a>
<ul class="nav pull-left">
<li id="changetip_tipme_button" data-bid="MzRgCSeSnVWvAP9SVRoYFC" data-uid="Qy46jQ356qex2GD2JGaHaK" style=""></li>
<li id="flattr_button"></li>
</ul>
<ul class="nav pull-right">
<li class="dropdown">
<a href="#" class="dropdown-toggle" id="share" data-toggle="dropdown">Share<b class="caret"></b></a>
<ul class="dropdown-menu">
<li class="social"><g:plusone annotation="inline" width="150"></g:plusone></li>
<li class="social"><a href="https://twitter.com/share" class="twitter-share-button" data-via="mattgodbolt">Tweet</a></li>
</ul>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">About<b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="https://plus.google.com/112384289668860490877" rel="publisher">Google+ page</a></li>
<li><a href="https://plus.google.com/105166465490735292917" rel="author">About Matt</a></li>
<li><a href="mailto:matt@godbolt.org">Contact Matt</a></li>
</ul>
</li>
</ul>
</div>
</div>
</div>
<section id="main" class="container-fluid">
<div class="row-fluid">
<div class="span6">
<form class="well form-inline files">
<div>
<label>Source: <select class="source" style="width:3m"></select></label>
<label>Name: <select class="filename"></select></label>
</div>
<div class="btn-group">
<button class="btn load">Load</button>
<button class="btn save">Save</button>
<button class="btn saveas">Save as...</button>
<button class="btn permalink">Permalink</button>
</div>
<div class="collapse permalink-collapse">
<label>Permalink: <input class="input-uneditable" type="text" placeholder="Loading" readonly id="permalink"></input></label>
</div>
</form>
</div>
<div class="span6">
<form class="well form-inline">
<label>Compiler: <select class="compiler"></select></label>
<label>Compiler options: <input class="compiler_options" style="width: 30em;" type="text" value=""></label>
<table><tbody><tr><td>Filter: </td>
<td>
<div class="btn-group filter">
<button class="btn" type="button" value="binary">Binary</button>
<button class="btn active nonbinary" type="button" value="labels">Unused labels</button>
<button class="btn active nonbinary" type="button" value="directives">Directives</button>
<button class="btn active nonbinary" type="button" value="commentOnly">Comment-only lines</button>
<button class="btn" type="button" value="intel">Intel syntax</button>
<button class="btn" type="button" value="colouriseAsm">Colourise</button>
</div>
</td></table>
</form>
</div>
</div>
<div class="row-fluid">
<div class="span6 editor">
<div class="topbar indented">Code editor</div>
<textarea>// Type your code here, or load an example.</textarea>
</div>
<div class="span6 asm">
<div class="topbar indented">Assembly output</div>
<textarea>Awaiting</textarea>
</div>
</div>
<div class="row-fluid result">
<div class="topbar">Compiler output — <span class="compilerVersion"></span></div>
<div class="output">
<div class="template"></div>
</div>
</div>
</section>
<div class="modal hide" id="saveDialog">
<div class="modal-header">
<button class="close" data-dismiss="modal">×</button>
<h3>Save as...</h3>
</div>
<div class="modal-body">
<label>Filename: <input class="save-filename" style="width: 30em;" type="text"></label>
</div>
<div class="modal-footer">
<a href="#" data-dismiss="modal" class="btn">Cancel</a>
<a href="#" class="btn btn-primary save">Save</a>
</div>
</div>
<div class="template lang c">// Type your code here, or load an example.
int square(int num) {
return num * num;
}</div>
<div class="template lang rust">// Type your code here, or load an example.
pub fn square(num: i32) -> i32 {
num * num
}</div>
<div class="template lang go">// Type your code here, or load an example.
// Your function name should start with a capital letter.
package main
func Square(x int) int {
return x * x
}
func main() {}
</div>
<div class="template lang d">// Type your code here, or load an example.</div>
<map name="ghm">
<area shape="poly" coords="16,0,149,133,149,0" href="https://github.com/mattgodbolt/gcc-explorer">
</map>
<script type="text/javascript">
(function () {
if (!OPTIONS.sharing_enabled)
$('#share').remove();
if (OPTIONS.github_ribbon_enabled) {
$(document.createElement('img'))
.css({
position: "absolute",
top: "40px",
right: 0,
border: 0
})
.attr('src', 'https://s3.amazonaws.com/github/ribbons/forkme_right_green_007200.png')
.attr('alt', 'Fork me on GitHub')
.attr('useMap', '#ghm')
.appendTo(document.body)
}
})();
</script>
</body>
</html>