Class: Jekyll::PseudoCodeB::MockBrush

Inherits:
Brush
  • Object
show all
Defined in:
lib/jekyll-pseudocode-b/mock_brush.rb

Instance Method Summary collapse

Methods inherited from Brush

#special

Instance Method Details

#comment(txt) ⇒ Object



34
35
36
# File 'lib/jekyll-pseudocode-b/mock_brush.rb', line 34

def comment(txt)
  "c(#{txt})"
end

#fn(txt) ⇒ Object



10
11
12
# File 'lib/jekyll-pseudocode-b/mock_brush.rb', line 10

def fn(txt)
  "fn(#{txt})"
end

#indent(txt) ⇒ Object



46
47
48
# File 'lib/jekyll-pseudocode-b/mock_brush.rb', line 46

def indent(txt)
  "i(#{txt})"
end

#math(txt) ⇒ Object



50
51
52
# File 'lib/jekyll-pseudocode-b/mock_brush.rb', line 50

def math(txt)
  "math(#{txt})"
end

#number(txt) ⇒ Object



22
23
24
# File 'lib/jekyll-pseudocode-b/mock_brush.rb', line 22

def number(txt)
  "num(#{txt})"
end

#objfn(obj, fnc) ⇒ Object



14
15
16
# File 'lib/jekyll-pseudocode-b/mock_brush.rb', line 14

def objfn(obj, fnc)
  "v(#{obj})op(.)fn(#{fnc})"
end

#op(txt) ⇒ Object



38
39
40
# File 'lib/jekyll-pseudocode-b/mock_brush.rb', line 38

def op(txt)
  "op(#{txt})"
end

#plain(txt) ⇒ Object



54
55
56
# File 'lib/jekyll-pseudocode-b/mock_brush.rb', line 54

def plain(txt)
  txt
end

#string(txt) ⇒ Object



42
43
44
# File 'lib/jekyll-pseudocode-b/mock_brush.rb', line 42

def string(txt)
  "str(#{txt})"
end

#sym(txt) ⇒ Object



6
7
8
# File 'lib/jekyll-pseudocode-b/mock_brush.rb', line 6

def sym(txt)
  "sym(#{txt})"
end

#var(txt, sub) ⇒ Object



26
27
28
29
30
31
32
# File 'lib/jekyll-pseudocode-b/mock_brush.rb', line 26

def var(txt, sub)
  if sub
    "#{txt}sub(#{sub.slice(1,sub.size)})"
  else
    txt
  end
end

#variable(txt) ⇒ Object



18
19
20
# File 'lib/jekyll-pseudocode-b/mock_brush.rb', line 18

def variable(txt)
  "v(#{txt})"
end