summaryrefslogtreecommitdiffstats
path: root/media/CodeMirror-0.62/contrib/lua/index.html
blob: 03a32299839fb763fb7e186fef472025bad09760 (plain)
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
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <script src="../../js/codemirror.js" type="text/javascript"></script>
    <title>CodeMirror: Lua demonstration</title>
  </head>
  <body style="padding: 20px;">

<p>This page demonstrates <a href="../../index.html">CodeMirror</a>'s
Lua parser. Written by <a href="http://francio.pl/">Franciszek
Wawrzak</a>, released under a BSD-style <a
href="LICENSE">license</a>.</p>

<div style="border: 1px solid black; padding: 0px;">
<textarea id="code" cols="120" rows="30">
--[[
example useless code to show lua syntax highlighting
this is multiline comment
]]

function blahblahblah(x)

  local table = {
    "asd" = 123,
    "x" = 0.34,  
  }
  if x ~= 3 then
    print( x )
  elseif x == "string"
    my_custom_function( 0x34 )
  else
    unknown_function( "some string" )
  end

  --single line comment
  
end

function blablabla3()

  for k,v in ipairs( table ) do
    --abcde..
    y=[=[
  x=[[
      x is a multi line string
   ]]
  but its definition is iside a highest level string!
  ]=]
    print(" \"\" ")
  --this marks a parser error:
  s = [== asdasdasd]]

    s = math.sin( x )
  end

end
</textarea>
</div>

<script type="text/javascript">
  var editor = CodeMirror.fromTextArea('code', {
    height: "350px",
    parserfile: "../contrib/lua/js/parselua.js",
    stylesheet: "css/luacolors.css",
    path: "../../js/"
  });
</script>
  </body>
</html>