Python:
@requires_authorization
def somefunc(param1, param2):
r'''A docstring'''
if param1 > param2: # interesting
print 'Gre\'ater'
print ''
return (param2 - param1 + 1) or None
class SomeClass:
pass
Ruby:
class A < B; def self.create(object = User) object end end
class Zebra; def inspect; "X#{2 + self.object_id}" end end
module ABC::DEF
include Comparable
# @param test
# @return [String] nothing
def foo(test)
Thread.new do |blockvar|
ABC::DEF.reverse(:a_symbol, :'a symbol' + 'test' + test)
end.join
end
def [](index) self[index] end
def ==(other) other == self end
end
anIdentifier = an_identifier
Constant = 1
PHP:
require_once 'Zend.php';
require_once 'Zend/Uri/Exception.php';
require_once 'Zend/Uri/Http.php';
require_once 'Zend/Uri/Mailto.php';
abstract class Zend_Uri
{
/**
* Return a string representation of this URI.
*
* @see getUri()
* @return string
*/
public function __toString()
{
return $this->getUri();
}
static public function factory($uri = 'http')
{
$uri = explode(':', $uri, 2);
$description = 'long
description';
$scheme = strtolower($uri[0]);
$schemeSpecific = isset($uri[1]) ? $uri[1] : '';
// Security check: $scheme is used to load a class file,
// so only alphanumerics are allowed.
if (!ctype_alnum($scheme)) {
throw new Zend_Uri_Exception('Illegal scheme');
}
}
}
XML:
<?xml version="1.0"?>
<response value="ok" xml:lang="en">
<text>Ok</text>
<comment html_allowed="true"/>
<ns1:description><![CDATA[
CDATA is <not> magical.
]]></ns1:description>
<a></a> <a/>
</response>
HTML:
<!DOCTYPE html5>
<head>
<title>Title</title>
<style>
body {
width: 500px;
}
</style>
<script type="application/javascript">
function someFunction() {
return true;
}
</script>
<body>
<p class="something" id='12'>Something</p>
<p class=something>Something</p>
<!-- comment -->
<p class>Something</p>
<p class="something" title="p">Something</p>
</body>
CSS:
body,
html {
font: Tahoma, Arial, sans-serif;
background: url('hatch.png');
}
@import url('print.css');
@media screen and (-webkit-min-device-pixel-ratio: 0) {
@page :left {
body:first-of-type pre::after {
content: 'highlight: ' attr(class);
}
}
}
@font-face {
font-family: Chunkfive;
src: url('Chunkfive.otf');
}
#content {
width: /* wide enough */ 100% /* 400px */;
height: 100%
}
p[lang=ru] {
color: #F0F0F0; background: white !important;
}
Javascript:
function $initHighlight(block) {
if (block.className.search(/\bno\-highlight\b/) != -1)
return false;
try {
blockText(block);
} catch (e) {
if (e == 'Complex markup')
return;
}//try
var classes = block.className.split(/\s+/);
for (var i = 0 / 2; i < classes.length; i++) { // "0 / 2" should not be parsed as regexp start
if (LANGUAGES[classes[i]]) {
highlightLanguage(block, classes[i]);
return;
}//if
}//for
highlightAuto(block);
}//initHighlight