| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297 |
- [[
- "punctuation.definition.comment.pascal",
- ["punctuation.definition.comment.pascal","(*"],
- ["comment.block.pascal.one","****************************************************************************"]
- ],[
- "punctuation.definition.comment.pascal",
- ["comment.block.pascal.one"," * A simple bubble sort program. Reads integers, one per line, and prints *"]
- ],[
- "punctuation.definition.comment.pascal",
- ["comment.block.pascal.one"," * them out in sorted order. Blows up if there are more than 49. *"]
- ],[
- "start",
- ["comment.block.pascal.one"," ****************************************************************************"],
- ["punctuation.definition.comment.pascal","*)"]
- ],[
- "start",
- ["keyword.control.pascal","PROGRAM"],
- ["text"," Sort(input"],
- ["keyword.operator",","],
- ["text"," output)"],
- ["keyword.operator",";"]
- ],[
- "start",
- ["text"," "],
- ["keyword.control.pascal","CONST"]
- ],[
- "start",
- ["text"," "],
- ["punctuation.definition.comment.pascal","(*"],
- ["comment.block.pascal.one"," Max array size. "],
- ["punctuation.definition.comment.pascal","*)"]
- ],[
- "start",
- ["text"," MaxElts "],
- ["keyword.operator","="],
- ["text"," "],
- ["constant.numeric.pascal","50"],
- ["keyword.operator",";"]
- ],[
- "start",
- ["text"," "],
- ["keyword.control.pascal","TYPE"],
- ["text"," "]
- ],[
- "start",
- ["text"," "],
- ["punctuation.definition.comment.pascal","(*"],
- ["comment.block.pascal.one"," Type of the element array. "],
- ["punctuation.definition.comment.pascal","*)"]
- ],[
- "start",
- ["text"," IntArrType "],
- ["keyword.operator","="],
- ["text"," "],
- ["keyword.control.pascal","ARRAY"],
- ["text"," ["],
- ["constant.numeric.pascal","1"],
- ["text","..MaxElts] "],
- ["keyword.control.pascal","OF"],
- ["text"," Integer"],
- ["keyword.operator",";"]
- ],[
- "start"
- ],[
- "start",
- ["text"," "],
- ["keyword.control.pascal","VAR"]
- ],[
- "start",
- ["text"," "],
- ["punctuation.definition.comment.pascal","(*"],
- ["comment.block.pascal.one"," Indexes, exchange temp, array size. "],
- ["punctuation.definition.comment.pascal","*)"]
- ],[
- "start",
- ["text"," i"],
- ["keyword.operator",","],
- ["text"," j"],
- ["keyword.operator",","],
- ["text"," tmp"],
- ["keyword.operator",","],
- ["text"," size: integer"],
- ["keyword.operator",";"]
- ],[
- "start"
- ],[
- "start",
- ["text"," "],
- ["punctuation.definition.comment.pascal","(*"],
- ["comment.block.pascal.one"," Array of ints "],
- ["punctuation.definition.comment.pascal","*)"]
- ],[
- "start",
- ["text"," arr: IntArrType"],
- ["keyword.operator",";"]
- ],[
- "start"
- ],[
- "start",
- ["text"," "],
- ["punctuation.definition.comment.pascal","(*"],
- ["comment.block.pascal.one"," Read in the integers. "],
- ["punctuation.definition.comment.pascal","*)"]
- ],[
- "start",
- ["text"," "],
- ["variable.pascal","PROCEDURE"],
- ["text"," "],
- ["storage.type.function.pascal","ReadArr"],
- ["text","("],
- ["keyword.control.pascal","VAR"],
- ["text"," size: Integer"],
- ["keyword.operator",";"],
- ["text"," "],
- ["keyword.control.pascal","VAR"],
- ["text"," a: IntArrType)"],
- ["keyword.operator",";"],
- ["text"," "]
- ],[
- "start",
- ["text"," "],
- ["keyword.control.pascal","BEGIN"]
- ],[
- "start",
- ["text"," size "],
- ["keyword.operator",":="],
- ["text"," "],
- ["constant.numeric.pascal","1"],
- ["keyword.operator",";"]
- ],[
- "start",
- ["text"," "],
- ["keyword.control.pascal","WHILE"],
- ["text"," "],
- ["keyword.control.pascal","NOT"],
- ["text"," eof "],
- ["keyword.control.pascal","DO"],
- ["text"," "],
- ["keyword.control.pascal","BEGIN"]
- ],[
- "start",
- ["text"," readln(a[size])"],
- ["keyword.operator",";"]
- ],[
- "start",
- ["text"," "],
- ["keyword.control.pascal","IF"],
- ["text"," "],
- ["keyword.control.pascal","NOT"],
- ["text"," eof "],
- ["keyword.control.pascal","THEN"],
- ["text"," "]
- ],[
- "start",
- ["text"," size "],
- ["keyword.operator",":="],
- ["text"," size "],
- ["keyword.operator","+"],
- ["text"," "],
- ["constant.numeric.pascal","1"]
- ],[
- "start",
- ["text"," "],
- ["keyword.control.pascal","END"]
- ],[
- "start",
- ["text"," "],
- ["keyword.control.pascal","END"],
- ["keyword.operator",";"]
- ],[
- "start"
- ],[
- "start",
- ["text"," "],
- ["keyword.control.pascal","BEGIN"]
- ],[
- "start",
- ["text"," "],
- ["punctuation.definition.comment.pascal","(*"],
- ["comment.block.pascal.one"," Read "],
- ["punctuation.definition.comment.pascal","*)"]
- ],[
- "start",
- ["text"," ReadArr(size"],
- ["keyword.operator",","],
- ["text"," arr)"],
- ["keyword.operator",";"]
- ],[
- "start"
- ],[
- "start",
- ["text"," "],
- ["punctuation.definition.comment.pascal","(*"],
- ["comment.block.pascal.one"," Sort using bubble sort. "],
- ["punctuation.definition.comment.pascal","*)"]
- ],[
- "start",
- ["text"," "],
- ["keyword.control.pascal","FOR"],
- ["text"," i "],
- ["keyword.operator",":="],
- ["text"," size "],
- ["keyword.operator","-"],
- ["text"," "],
- ["constant.numeric.pascal","1"],
- ["text"," DOWNTO "],
- ["constant.numeric.pascal","1"],
- ["text"," "],
- ["keyword.control.pascal","DO"]
- ],[
- "start",
- ["text"," "],
- ["keyword.control.pascal","FOR"],
- ["text"," j "],
- ["keyword.operator",":="],
- ["text"," "],
- ["constant.numeric.pascal","1"],
- ["text"," "],
- ["keyword.control.pascal","TO"],
- ["text"," i "],
- ["keyword.control.pascal","DO"],
- ["text"," "]
- ],[
- "start",
- ["text"," "],
- ["keyword.control.pascal","IF"],
- ["text"," arr[j] > arr[j "],
- ["keyword.operator","+"],
- ["text"," "],
- ["constant.numeric.pascal","1"],
- ["text","] "],
- ["keyword.control.pascal","THEN"],
- ["text"," "],
- ["keyword.control.pascal","BEGIN"]
- ],[
- "start",
- ["text"," tmp "],
- ["keyword.operator",":="],
- ["text"," arr[j]"],
- ["keyword.operator",";"]
- ],[
- "start",
- ["text"," arr[j] "],
- ["keyword.operator",":="],
- ["text"," arr[j "],
- ["keyword.operator","+"],
- ["text"," "],
- ["constant.numeric.pascal","1"],
- ["text","]"],
- ["keyword.operator",";"]
- ],[
- "start",
- ["text"," arr[j "],
- ["keyword.operator","+"],
- ["text"," "],
- ["constant.numeric.pascal","1"],
- ["text","] "],
- ["keyword.operator",":="],
- ["text"," tmp"],
- ["keyword.operator",";"]
- ],[
- "start",
- ["text"," "],
- ["keyword.control.pascal","END"],
- ["keyword.operator",";"]
- ],[
- "start"
- ],[
- "start",
- ["text"," "],
- ["punctuation.definition.comment.pascal","(*"],
- ["comment.block.pascal.one"," Print. "],
- ["punctuation.definition.comment.pascal","*)"]
- ],[
- "start",
- ["text"," "],
- ["keyword.control.pascal","FOR"],
- ["text"," i "],
- ["keyword.operator",":="],
- ["text"," "],
- ["constant.numeric.pascal","1"],
- ["text"," "],
- ["keyword.control.pascal","TO"],
- ["text"," size "],
- ["keyword.control.pascal","DO"]
- ],[
- "start",
- ["text"," writeln(arr[i])"]
- ],[
- "start",
- ["text"," "],
- ["keyword.control.pascal","END"],
- ["text","."]
- ],[
- "start",
- ["text"," "]
- ]]
|