krl.in 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  1. ; vim: set ft=krl :
  2. ; START_INDENT
  3. def One()
  4. int i
  5. If i==1 then
  6. While i>=1
  7. For i=1 to 5 step 2
  8. Loop
  9. i = i+1
  10. EndLoop
  11. EndFor
  12. EndWhile
  13. Else
  14. Repeat
  15. Switch i
  16. Case 1
  17. Skip 123
  18. i = i+1
  19. EndSkip 123
  20. Spline with $acc=100, $vel.cp=3
  21. slin {x 100}
  22. scirc {x 110, y 110}, {x 120, y 90}
  23. slin {x 200} c_dis
  24. Time_Block Start
  25. slin {x 300} c_dis
  26. Time_Block Part = 22.2
  27. slin {y 400} c_dis
  28. Time_Block Part = 33.3
  29. Time_Block End = 10
  30. slin {y 200} c_dis
  31. Const_Vel Start +100 OnStart
  32. slin {y 300} c_dis
  33. slin {x 100}
  34. Const_Vel End -5.5
  35. slin {y 200} c_dis
  36. EndSpline
  37. Case 2,3
  38. PTP_Spline with $acc=100, $vel.ptp=100
  39. sptp {a1 0} c_ptp
  40. sptp {a1 90}
  41. EndSpline c_spl
  42. Default
  43. i = i+1
  44. EndSwitch
  45. Continue
  46. Until False
  47. EndIf
  48. end
  49. DEF Two()
  50. int i
  51. END
  52. global def Three()
  53. int i
  54. end
  55. GLOBAL DEF Four()
  56. int i
  57. END
  58. Global Def Five()
  59. int i
  60. End
  61. deffct bool fOne()
  62. int i
  63. endfct
  64. DEFFCT bool fTwo()
  65. int i
  66. ENDFCT
  67. global deffct bool fThree()
  68. int i
  69. endfct
  70. GLOBAL DEFFCT bool fFour()
  71. int i
  72. ENDFCT
  73. Global DefFct bool fFive()
  74. int i
  75. EndFct
  76. DefDat datfile()
  77. global int i=1
  78. ; don't indent column 1 comments unless g:krlCommentIndent is set
  79. ; global int o=2
  80. EndDat
  81. ; END_INDENT
  82. ; START_INDENT
  83. ; INDENT_EXE let g:krlSpaceIndent = 0
  84. ; INDENT_EXE set shiftwidth=4
  85. def bla()
  86. int i
  87. end
  88. ; END_INDENT
  89. ; START_INDENT
  90. ; INDENT_EXE let g:krlCommentIndent = 1
  91. def bla()
  92. ; indent this first column comment because of g:krlCommentIndent=1
  93. end
  94. ; END_INDENT
  95. ; START_INDENT
  96. ; INDENT_EXE let g:krlIndentBetweenDef = 0
  97. def bla()
  98. int i ; don't indent this line because of g:krlIndentBetweenDef=0
  99. end
  100. ; END_INDENT
  101. ; START_INDENT
  102. ; INDENT_AT this-line
  103. def Some()
  104. int f
  105. if true then
  106. f = 1 ; this-line
  107. endif
  108. end
  109. ; END_INDENT
  110. ; START_INDENT
  111. ; INDENT_NEXT next-line
  112. def Some()
  113. int i
  114. ; next-line
  115. i = 1 ; should get indent of line 'int i' above
  116. end
  117. ; END_INDENT
  118. ; START_INDENT
  119. ; INDENT_PREV prev-line
  120. def Some()
  121. int f
  122. if true then
  123. f = 1
  124. ; prev-line
  125. endif
  126. end
  127. ; END_INDENT