File: Issue65.rb.styled

package info (click to toggle)
codequery 1.0.1%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 17,860 kB
  • sloc: cpp: 151,420; xml: 16,576; python: 5,602; ansic: 5,487; makefile: 559; perl: 496; ruby: 209; sql: 194; sh: 106; php: 53; vhdl: 51; erlang: 47; objc: 22; lisp: 18; cobol: 18; modula3: 17; asm: 14; fortran: 12; ml: 11; tcl: 6
file content (71 lines) | stat: -rw-r--r-- 3,263 bytes parent folder | download | duplicates (3)
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
{5}def{0} {9}dbg_args{10}({11}a{10},{0} {11}b{10}={4}1{10},{0} {11}c{14}:{10},{0} {14}d:{0} {4}6{10},{0} {10}&{11}block{10}){0} {10}={0} {11}puts{10}({6}"Args passed: {10}#{[{11}a{10},{0} {11}b{10},{0} {11}c{10},{0} {11}d{10},{0} {11}block{10}.{11}call{10}]}{6}"{10}){0}
{11}dbg_args{10}({4}0{10},{0} {14}c:{0} {4}5{10}){0} {10}{{0} {4}7{0} {10}}{0}

{5}class{0} {8}A{0}
	{5}def{0} {9}attr{0} {10}={0} {16}@attr{0}
	{5}def{0} {9}attr={10}({11}value{10}){0}
		{16}@attr{0} {10}={0} {11}value{0}
	{5}end{0}
	{5}def{0} {9}attr?{0} {10}={0} {10}!!{16}@attr{0}
	{5}def{0} {9}attr!{0} {10}={0} {16}@attr{0} {10}={0} {5}true{0}
	{2}# unary operator{0}
	{5}def{0} {10}-@{0} {10}={0} {4}1{0}
	{5}def{0} {10}+@{0} {10}={0} {4}1{0}
	{5}def{0} {10}!{0} {10}={0} {4}1{0}
	{5}def{0} {10}!@{0} {10}={0} {4}1{0}
	{2}# binary operator{0}
	{5}def{0} {10}+({11}value{10}){0} {10}={0} {4}1{0} {10}+{0} {11}value{0}
	{5}def{0} {10}-({11}value{10}){0} {10}={0} {4}1{0} {10}-{0} {11}value{0}
	{5}def{0} {10}*({11}value{10}){0} {10}={0} {4}1{0} {10}*{0} {11}value{0}
	{5}def{0} {10}**({11}value{10}){0} {10}={0} {4}1{0} {10}**{0} {11}value{0}
	{5}def{0} {10}/({11}value{10}){0} {10}={0} {4}1{0} {10}/{0} {11}value{0}
	{5}def{0} {10}%({11}value{10}){0} {10}={0} {4}1{0} {10}%{0} {11}value{0}
	{5}def{0} {10}&({11}value{10}){0} {10}={0} {4}1{0} {10}&{0} {11}value{0}
	{5}def{0} {10}^({11}value{10}){0} {10}={0} {4}1{0} {10}^{0} {11}value{0}
	{5}def{0} {10}>>({11}value{10}){0} {10}={0} {4}1{0} {10}>>{0} {11}value{0}
	{5}def{0} {10}<<({11}value{10}){0} {10}={0} {4}1{0} {10}<<{0} {11}value{0}
	{5}def{0} {10}==({11}other{10}){0} {10}={0} {5}true{0}
	{5}def{0} {10}!=({11}other{10}){0} {10}={0} {5}true{0}
	{5}def{0} {10}===({11}other{10}){0} {10}={0} {5}true{0}
	{5}def{0} {10}=~({11}other{10}){0} {10}={0} {5}true{0}
	{5}def{0} {10}<=>({11}other{10}){0} {10}={0} {5}true{0}
	{5}def{0} {10}<({11}other{10}){0} {10}={0} {5}true{0}
	{5}def{0} {10}<=({11}other{10}){0} {10}={0} {5}true{0}
	{5}def{0} {10}>({11}other{10}){0} {10}={0} {5}true{0}
	{5}def{0} {10}>=({11}other{10}){0} {10}={0} {5}true{0}
	{2}# element reference and assignment{0}
	{5}def{0} {10}[]({11}a{10},{0} {11}b{10}){0} {10}={0} {11}puts{10}({11}a{0} {10}+{0} {11}b{10}){0}
	{5}def{0} {10}[]=({11}a{10},{0} {11}b{10},{0} {11}c{10}){0}
		{11}puts{0} {11}a{0} {10}+{0} {11}b{0} {10}+{0} {11}c{0}
	{5}end{0}
	{2}# array decomposition{0}
	{5}def{0} {9}dec{10}((({11}a{10},{0} {11}b{10}),{0} {11}c{10})){0} {10}={0} {11}puts{10}({11}a{0} {10}+{0} {11}b{0} {10}+{0} {11}c{10}){0}
	{2}# class method{0}
	{5}def{0} {29}self{10}.{9}say{10}(*{11}s{10}){0} {10}={0} {11}puts{10}({11}s{10}){0}
	{2}# test short method name{0}
	{5}def{0} {9}a{0} {10}={0} {4}1{0}
	{5}def{0} {9}ab{0} {10}={0} {4}1{0}
{5}end{0}

{2}# class method{0}
{5}def{0} {11}String{10}.{9}hello{0}
  {6}"Hello, world!"{0}
{5}end{0}
{2}# singleton method{0}
{11}greeting{0} {10}={0} {6}"Hello"{0}
{5}def{0} {11}greeting{10}.{9}broaden{0}
  {5}self{0} {10}+{0} {6}", world!"{0}
{5}end{0}
{2}# one line definition{0}
{5}def{0} {9}a{10}({11}b{10},{0} {11}c{10}){0} {11}b{10};{0} {11}c{0} {5}end{0}
{2}# parentheses omitted{0}
{5}def{0} {9}ab{0} {11}c{0}
	{11}puts{0} {11}c{0}
{5}end{0}

{2}# Test folding of multi-line SCE_RB_STRING_QW{0}
{11}puts{0} {28}%W(
a
b
c
){0}