Skip to content

Commit f3e9ff4

Browse files
Add Quack API version
1 parent b631770 commit f3e9ff4

File tree

5 files changed

+166
-4
lines changed

5 files changed

+166
-4
lines changed

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright (c) 2016 Quack Lang
3+
Copyright (c) 2016 Quack Lang (Marcelo Camargo and CONTRIBUTORS)
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

api.qk

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
require once 'src.toolkit.QuackToolkit'
2+
3+
open QuackCompiler.Lexer.Tokenizer
4+
open QuackCompiler.Parser.{ SyntaxError; TokenReader }
5+
6+
if not isset _GET{ 'action' } ^
7+
let action :- _GET{ 'action' } |> base64_decode |> trim.
8+
if action = ':license' [
9+
print file_get_contents[ './LICENSE' ]
10+
break
11+
]
12+
let lexer :- #Tokenizer with { action }
13+
let parser :- #TokenReader with { lexer }
14+
try [ parser:parser! parser:dump_ast! ] rescue print

gh-fork-ribbon.css

Lines changed: 140 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,140 @@
1+
/*!
2+
* "Fork me on GitHub" CSS ribbon v0.1.1 | MIT License
3+
* https://github.com/simonwhitaker/github-fork-ribbon-css
4+
*/
5+
6+
/* Left will inherit from right (so we don't need to duplicate code) */
7+
.github-fork-ribbon {
8+
/* The right and left classes determine the side we attach our banner to */
9+
position: fixed;
10+
11+
/* Add a bit of padding to give some substance outside the "stitching" */
12+
padding: 2px 0;
13+
14+
/* Set the base colour */
15+
background-color: #a00;
16+
17+
/* Set a gradient: transparent black at the top to almost-transparent black at the bottom */
18+
background-image: -webkit-gradient(linear, left top, left bottom, from(rgba(0, 0, 0, 0)), to(rgba(0, 0, 0, 0.15)));
19+
background-image: -webkit-linear-gradient(top, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.15));
20+
background-image: -moz-linear-gradient(top, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.15));
21+
background-image: -ms-linear-gradient(top, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.15));
22+
background-image: -o-linear-gradient(top, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.15));
23+
background-image: linear-gradient(to bottom, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.15));
24+
25+
/* Add a drop shadow */
26+
-webkit-box-shadow: 0 2px 3px 0 rgba(0, 0, 0, 0.5);
27+
-moz-box-shadow: 0 2px 3px 0 rgba(0, 0, 0, 0.5);
28+
box-shadow: 0 2px 3px 0 rgba(0, 0, 0, 0.5);
29+
30+
/* Set the font */
31+
font: 700 13px "Helvetica Neue", Helvetica, Arial, sans-serif;
32+
33+
z-index: 9999;
34+
pointer-events: auto;
35+
}
36+
37+
.github-fork-ribbon a,
38+
.github-fork-ribbon a:hover {
39+
/* Set the text properties */
40+
color: #fff;
41+
text-decoration: none;
42+
text-shadow: 0 -1px rgba(0, 0, 0, 0.5);
43+
text-align: center;
44+
45+
/* Set the geometry. If you fiddle with these you'll also need
46+
to tweak the top and right values in .github-fork-ribbon. */
47+
width: 200px;
48+
line-height: 20px;
49+
50+
/* Set the layout properties */
51+
display: inline-block;
52+
padding: 2px 0;
53+
54+
/* Add "stitching" effect */
55+
border-width: 1px 0;
56+
border-style: dotted;
57+
border-color: #fff;
58+
border-color: rgba(255, 255, 255, 0.7);
59+
}
60+
61+
.github-fork-ribbon-wrapper {
62+
width: 150px;
63+
height: 150px;
64+
position: absolute;
65+
overflow: hidden;
66+
top: 0;
67+
z-index: 9999;
68+
pointer-events: none;
69+
}
70+
71+
.github-fork-ribbon-wrapper.fixed {
72+
position: fixed;
73+
}
74+
75+
.github-fork-ribbon-wrapper.left {
76+
left: 0;
77+
}
78+
79+
.github-fork-ribbon-wrapper.right {
80+
right: 0;
81+
}
82+
83+
.github-fork-ribbon-wrapper.left-bottom {
84+
position: fixed;
85+
top: inherit;
86+
bottom: 0;
87+
left: 0;
88+
}
89+
90+
.github-fork-ribbon-wrapper.right-bottom {
91+
position: fixed;
92+
top: inherit;
93+
bottom: 0;
94+
right: 0;
95+
}
96+
97+
.github-fork-ribbon-wrapper.right .github-fork-ribbon {
98+
top: 42px;
99+
right: -43px;
100+
101+
-webkit-transform: rotate(45deg);
102+
-moz-transform: rotate(45deg);
103+
-ms-transform: rotate(45deg);
104+
-o-transform: rotate(45deg);
105+
transform: rotate(45deg);
106+
}
107+
108+
.github-fork-ribbon-wrapper.left .github-fork-ribbon {
109+
top: 42px;
110+
left: -43px;
111+
112+
-webkit-transform: rotate(-45deg);
113+
-moz-transform: rotate(-45deg);
114+
-ms-transform: rotate(-45deg);
115+
-o-transform: rotate(-45deg);
116+
transform: rotate(-45deg);
117+
}
118+
119+
120+
.github-fork-ribbon-wrapper.left-bottom .github-fork-ribbon {
121+
top: 80px;
122+
left: -43px;
123+
124+
-webkit-transform: rotate(45deg);
125+
-moz-transform: rotate(45deg);
126+
-ms-transform: rotate(45deg);
127+
-o-transform: rotate(45deg);
128+
transform: rotate(45deg);
129+
}
130+
131+
.github-fork-ribbon-wrapper.right-bottom .github-fork-ribbon {
132+
top: 80px;
133+
right: -43px;
134+
135+
-webkit-transform: rotate(-45deg);
136+
-moz-transform: rotate(-45deg);
137+
-ms-transform: rotate(-45deg);
138+
-o-transform: rotate(-45deg);
139+
transform: rotate(-45deg);
140+
}

index.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,16 @@
44
<title>Quack ─ Try Online!</title>
55
<meta name="charset" content="utf-8">
66
<link rel="stylesheet" type="text/css" href="./repl.css" />
7+
<link rel="stylesheet" type="text/css" href="./gh-fork-ribbon.css" />
78
</head>
89
<body>
10+
<!-- TOP RIGHT RIBBON: START COPYING HERE -->
11+
<div class="github-fork-ribbon-wrapper right">
12+
<div class="github-fork-ribbon">
13+
<a href="https://github.com/quack/quack">Fork me on GitHub</a>
14+
</div>
15+
</div>
16+
<!-- TOP RIGHT RIBBON: END COPYING HERE -->
917
<div id="quack-repl-stdout"></div>
1018
<div id="quack-repl-stdin">
1119
<span class="quack-repl-name">Quack&gt;</span>

repl.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ var QuackRepl = (function () {
5555
this.stdout.innerHTML = "";
5656
this.history.push(':clear');
5757
break;
58+
case 'show c':
59+
text = ':license'
5860
default:
5961
this.print('<span class="quack-repl-name">Quack&gt;</span> ' + text);
6062
if (text !== '') {
@@ -83,7 +85,7 @@ var QuackRepl = (function () {
8385

8486
QuackRepl.prototype.welcome = function () {
8587
var that = this;
86-
[ "Quack · Copyright (C) 2016 Marcelo Camargo",
88+
[ "Quack · Copyright (C) 2016 Marcelo Camargo &lt;[email protected]&gt;",
8789
"This program comes with ABSOLUTELY NO WARRANTY.",
8890
"This is free software, and you are welcome to redistribute it",
8991
"under certain conditions; type 'show c' for details.",
@@ -104,5 +106,3 @@ var QuackRepl = (function () {
104106
module.repl.configureStdin();
105107
module.repl.welcome();
106108
})(window);
107-
108-

0 commit comments

Comments
 (0)