This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import "fmt" | |
import "sort" | |
type B struct { | |
l, r, id int | |
} | |
type Bs []B |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Round floating point numbers | |
import std.stdio; | |
import std.algorithm; | |
const int N = 200000, NN = 1 << 18, Q = 200000, MAX = 1000001, MOD = 1000000007; | |
int ri() | |
{ | |
int x; | |
readf(" %s", &x); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MODULE A; | |
IMPORT Random, Commands, Kernel; | |
VAR | |
A, B, C : ARRAY [*,*] OF LONGREAL; | |
i, j : INTEGER; | |
S : INTEGER; | |
G : Random.Generator; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sublime, sublime_plugin | |
class OberonAssistant(sublime_plugin.EventListener): | |
rs = {} | |
inProcess = False | |
keywords = ['ARRAY', 'IMPORT', 'THEN', 'BEGIN', 'IN', 'TO', 'BY', 'IS', 'TRUE', 'CASE', 'MOD', 'TYPE', 'CONST', 'MODULE', 'UNTIL', 'DIV', 'NIL', 'VAR', 'DO', 'OF', 'WHILE', 'ELSE', 'OR', 'ELSIF', 'POINTER', 'END', 'PROCEDURE', 'FALSE', 'RECORD', 'FOR', 'REPEAT', 'IF', 'RETURN', 'ABS', 'ASR', 'ASSERT', 'BOOLEAN', 'BYTE', 'CHAR', 'CHR', 'DEC', 'EXCL', 'FLOOR', 'FLT', 'INC', 'INCL', 'INTEGER', 'LEN', 'LSL', 'NEW', 'ODD', 'ORD', 'PACK', 'REAL', 'ROR', 'SET', 'UNPK'] | |
def on_modified(self,view): | |
if len(view.sel())==1 and not self.inProcess: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MODULE A; | |
IMPORT StdLog; | |
TYPE | |
T0* = EXTENSIBLE RECORD END; | |
PT* = POINTER TO T0; | |
VAR | |
r* : PT; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MOFULE A; | |
CONST | |
pi = 3.1415; | |
TYPE | |
Foo = RECORD END; | |
VAR | |
some : INTEGER; | |
PROCEDURE Boo(); | |
CONST |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MOFULE A; | |
CONST | |
pi = 3.1415; | |
TYPE | |
Foo = RECORD END; | |
VAR | |
some : INTEGER; | |
PROCEDURE Boo(); | |
CONST |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PROCEDURE Pos* (self : Type): INTEGER ; RETURN self.pos END Pos; | |
PROCEDURE Size* (self : Type): INTEGER ; RETURN self.size END Size; | |
PROCEDURE Foo* (self : Type): REAL ; RETURN self.foo END Foo; | |
PROCEDURE Bar* (self : Type): INTEGER ; RETURN self.bar END Bar; | |
PROCEDURE Color* (self : Type): ColorT ; RETURN self.color END Color; | |
PROCEDURE Top* (self : Type): INTEGER ; RETURN self.top END Top; | |
PROCEDURE Width* (self : Type): INTEGER ; RETURN self.width END Width; | |
PROCEDURE Options* (self : Type): SET ; RETURN self.options END Options; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MODULE A; | |
VAR | |
p : PROCEDURE | |
PROCEDURE SetP*(pp:PROCEDURE); | |
BEGIN | |
p:=pp; | |
END SetP; | |
PROCEDURE Start*; | |
BEGIN |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MODULE A; | |
PROCEDURE P*; END P; | |
END A. | |
MODULE B; | |
IMPORT A; | |
VAR | |
p* : PROCEDURE | |
BEGIN | |
p := A.P; |