mirror of
https://github.com/KevinMidboe/linguist.git
synced 2025-10-29 17:50:22 +00:00
@@ -515,6 +515,12 @@ Dylan:
|
||||
- .intr
|
||||
- .lid
|
||||
|
||||
E:
|
||||
type: programming
|
||||
color: "#ccce35"
|
||||
lexer: Text only
|
||||
primary_extension: .E
|
||||
|
||||
Ecere Projects:
|
||||
type: data
|
||||
group: JavaScript
|
||||
|
||||
@@ -115,6 +115,9 @@
|
||||
"Dogescript": [
|
||||
".djs"
|
||||
],
|
||||
"E": [
|
||||
".E"
|
||||
],
|
||||
"Eagle": [
|
||||
".brd",
|
||||
".sch"
|
||||
@@ -647,8 +650,8 @@
|
||||
".gemrc"
|
||||
]
|
||||
},
|
||||
"tokens_total": 581051,
|
||||
"languages_total": 683,
|
||||
"tokens_total": 581652,
|
||||
"languages_total": 689,
|
||||
"tokens": {
|
||||
"ABAP": {
|
||||
"*/**": 1,
|
||||
@@ -17203,6 +17206,160 @@
|
||||
"but": 1,
|
||||
"module.exports": 1
|
||||
},
|
||||
"E": {
|
||||
"def": 24,
|
||||
"makeVehicle": 3,
|
||||
"(": 65,
|
||||
"self": 1,
|
||||
")": 64,
|
||||
"{": 57,
|
||||
"vehicle": 2,
|
||||
"to": 27,
|
||||
"milesTillEmpty": 1,
|
||||
"return": 19,
|
||||
"self.milesPerGallon": 1,
|
||||
"*": 1,
|
||||
"self.getFuelRemaining": 1,
|
||||
"}": 57,
|
||||
"makeCar": 4,
|
||||
"var": 6,
|
||||
"fuelRemaining": 4,
|
||||
"car": 8,
|
||||
"extends": 2,
|
||||
"milesPerGallon": 2,
|
||||
"getFuelRemaining": 2,
|
||||
"makeJet": 1,
|
||||
"jet": 3,
|
||||
"println": 2,
|
||||
"The": 2,
|
||||
"can": 1,
|
||||
"go": 1,
|
||||
"car.milesTillEmpty": 1,
|
||||
"miles.": 1,
|
||||
"name": 4,
|
||||
"x": 3,
|
||||
"y": 3,
|
||||
"moveTo": 1,
|
||||
"newX": 2,
|
||||
"newY": 2,
|
||||
"getX": 1,
|
||||
"getY": 1,
|
||||
"setName": 1,
|
||||
"newName": 2,
|
||||
"getName": 1,
|
||||
"sportsCar": 1,
|
||||
"sportsCar.moveTo": 1,
|
||||
"sportsCar.getName": 1,
|
||||
"is": 1,
|
||||
"at": 1,
|
||||
"X": 1,
|
||||
"location": 1,
|
||||
"sportsCar.getX": 1,
|
||||
"makeVOCPair": 1,
|
||||
"brandName": 3,
|
||||
"String": 1,
|
||||
"near": 6,
|
||||
"myTempContents": 6,
|
||||
"none": 2,
|
||||
"brand": 5,
|
||||
"__printOn": 4,
|
||||
"out": 4,
|
||||
"TextWriter": 4,
|
||||
"void": 5,
|
||||
"out.print": 4,
|
||||
"ProveAuth": 2,
|
||||
"<$brandName>": 3,
|
||||
"prover": 1,
|
||||
"getBrand": 4,
|
||||
"coerce": 2,
|
||||
"specimen": 2,
|
||||
"optEjector": 3,
|
||||
"sealedBox": 2,
|
||||
"offerContent": 1,
|
||||
"CheckAuth": 2,
|
||||
"checker": 3,
|
||||
"template": 1,
|
||||
"match": 4,
|
||||
"[": 10,
|
||||
"get": 2,
|
||||
"authList": 2,
|
||||
"any": 2,
|
||||
"]": 10,
|
||||
"specimenBox": 2,
|
||||
"null": 1,
|
||||
"if": 2,
|
||||
"specimenBox.__respondsTo": 1,
|
||||
"specimenBox.offerContent": 1,
|
||||
"else": 1,
|
||||
"for": 3,
|
||||
"auth": 3,
|
||||
"in": 1,
|
||||
"throw.eject": 1,
|
||||
"Unmatched": 1,
|
||||
"authorization": 1,
|
||||
"__respondsTo": 2,
|
||||
"_": 3,
|
||||
"true": 1,
|
||||
"false": 1,
|
||||
"__getAllegedType": 1,
|
||||
"null.__getAllegedType": 1,
|
||||
"#File": 1,
|
||||
"objects": 1,
|
||||
"hardwired": 1,
|
||||
"files": 1,
|
||||
"file1": 1,
|
||||
"<file:myFile.txt>": 1,
|
||||
"file2": 1,
|
||||
"<file:/home/marcs/myFile.txt>": 1,
|
||||
"#Using": 2,
|
||||
"a": 4,
|
||||
"variable": 1,
|
||||
"file": 3,
|
||||
"filePath": 2,
|
||||
"file3": 1,
|
||||
"<file>": 1,
|
||||
"single": 1,
|
||||
"character": 1,
|
||||
"specify": 1,
|
||||
"Windows": 1,
|
||||
"drive": 1,
|
||||
"file4": 1,
|
||||
"<file:c:/docs/myFile.txt>": 1,
|
||||
"file5": 1,
|
||||
"<c:/docs/myFile.txt>": 1,
|
||||
"file6": 1,
|
||||
"<c:\\docs\\myFile.txt>": 1,
|
||||
"pragma.syntax": 1,
|
||||
"send": 1,
|
||||
"message": 4,
|
||||
"when": 2,
|
||||
"friend": 4,
|
||||
"<-receive(message))>": 1,
|
||||
"chatUI.showMessage": 4,
|
||||
"catch": 2,
|
||||
"prob": 2,
|
||||
"receive": 1,
|
||||
"receiveFriend": 2,
|
||||
"friendRcvr": 2,
|
||||
"bind": 2,
|
||||
"save": 1,
|
||||
"file.setText": 1,
|
||||
"makeURIFromObject": 1,
|
||||
"chatController": 2,
|
||||
"load": 1,
|
||||
"getObjectFromURI": 1,
|
||||
"file.getText": 1,
|
||||
"<": 1,
|
||||
"-": 2,
|
||||
"tempVow": 2,
|
||||
"#...use": 1,
|
||||
"#....": 1,
|
||||
"report": 1,
|
||||
"problem": 1,
|
||||
"finally": 1,
|
||||
"#....log": 1,
|
||||
"event": 1
|
||||
},
|
||||
"Eagle": {
|
||||
"<?xml>": 2,
|
||||
"version=": 4,
|
||||
@@ -60589,6 +60746,7 @@
|
||||
"Diff": 16,
|
||||
"DM": 169,
|
||||
"Dogescript": 30,
|
||||
"E": 601,
|
||||
"Eagle": 30089,
|
||||
"ECL": 281,
|
||||
"edn": 227,
|
||||
@@ -60759,6 +60917,7 @@
|
||||
"Diff": 1,
|
||||
"DM": 1,
|
||||
"Dogescript": 1,
|
||||
"E": 6,
|
||||
"Eagle": 2,
|
||||
"ECL": 1,
|
||||
"edn": 1,
|
||||
@@ -60896,5 +61055,5 @@
|
||||
"YAML": 2,
|
||||
"Zephir": 2
|
||||
},
|
||||
"md5": "9841f9a393cc7a4683cc6edf9b313627"
|
||||
"md5": "12052e16c15c5b8a548563cbb6a8c45c"
|
||||
}
|
||||
31
samples/E/Extends.E
Normal file
31
samples/E/Extends.E
Normal file
@@ -0,0 +1,31 @@
|
||||
# from
|
||||
# http://wiki.erights.org/wiki/Walnut/Ordinary_Programming/Objects_and_Functions
|
||||
def makeVehicle(self) {
|
||||
def vehicle {
|
||||
to milesTillEmpty() {
|
||||
return self.milesPerGallon() * self.getFuelRemaining()
|
||||
}
|
||||
}
|
||||
return vehicle
|
||||
}
|
||||
|
||||
def makeCar() {
|
||||
var fuelRemaining := 20
|
||||
def car extends makeVehicle(car) {
|
||||
to milesPerGallon() {return 19}
|
||||
to getFuelRemaining() {return fuelRemaining}
|
||||
}
|
||||
return car
|
||||
}
|
||||
|
||||
def makeJet() {
|
||||
var fuelRemaining := 2000
|
||||
def jet extends makeVehicle(jet) {
|
||||
to milesPerGallon() {return 2}
|
||||
to getFuelRemaining() {return fuelRemaining}
|
||||
}
|
||||
return jet
|
||||
}
|
||||
|
||||
def car := makeCar()
|
||||
println(`The car can go ${car.milesTillEmpty()} miles.`)
|
||||
21
samples/E/Functions.E
Normal file
21
samples/E/Functions.E
Normal file
@@ -0,0 +1,21 @@
|
||||
# from
|
||||
# http://wiki.erights.org/wiki/Walnut/Ordinary_Programming/Objects_and_Functions
|
||||
def makeCar(var name) {
|
||||
var x := 0
|
||||
var y := 0
|
||||
def car {
|
||||
to moveTo(newX,newY) {
|
||||
x := newX
|
||||
y := newY
|
||||
}
|
||||
to getX() {return x}
|
||||
to getY() {return y}
|
||||
to setName(newName) {name := newName}
|
||||
to getName() {return name}
|
||||
}
|
||||
return car
|
||||
}
|
||||
# Now use the makeCar function to make a car, which we will move and print
|
||||
def sportsCar := makeCar("Ferrari")
|
||||
sportsCar.moveTo(10,20)
|
||||
println(`The car ${sportsCar.getName()} is at X location ${sportsCar.getX()}`)
|
||||
69
samples/E/Guards.E
Normal file
69
samples/E/Guards.E
Normal file
@@ -0,0 +1,69 @@
|
||||
# from
|
||||
# http://wiki.erights.org/wiki/Walnut/Advanced_Topics/Build_your_Own_Guards
|
||||
def makeVOCPair(brandName :String) :near {
|
||||
|
||||
var myTempContents := def none {}
|
||||
|
||||
def brand {
|
||||
to __printOn(out :TextWriter) :void {
|
||||
out.print(brandName)
|
||||
}
|
||||
}
|
||||
|
||||
def ProveAuth {
|
||||
to __printOn(out :TextWriter) :void {
|
||||
out.print(`<$brandName prover>`)
|
||||
}
|
||||
to getBrand() :near { return brand }
|
||||
to coerce(specimen, optEjector) :near {
|
||||
def sealedBox {
|
||||
to getBrand() :near { return brand }
|
||||
to offerContent() :void {
|
||||
myTempContents := specimen
|
||||
}
|
||||
}
|
||||
return sealedBox
|
||||
}
|
||||
}
|
||||
def CheckAuth {
|
||||
to __printOn(out :TextWriter) :void {
|
||||
out.print(`<$brandName checker template>`)
|
||||
}
|
||||
to getBrand() :near { return brand }
|
||||
match [`get`, authList :any[]] {
|
||||
def checker {
|
||||
to __printOn(out :TextWriter) :void {
|
||||
out.print(`<$brandName checker>`)
|
||||
}
|
||||
to getBrand() :near { return brand }
|
||||
to coerce(specimenBox, optEjector) :any {
|
||||
myTempContents := null
|
||||
if (specimenBox.__respondsTo("offerContent", 0)) {
|
||||
# XXX Using __respondsTo/2 here is a kludge
|
||||
specimenBox.offerContent()
|
||||
} else {
|
||||
myTempContents := specimenBox
|
||||
}
|
||||
for auth in authList {
|
||||
if (auth == myTempContents) {
|
||||
return auth
|
||||
}
|
||||
}
|
||||
myTempContents := none
|
||||
throw.eject(optEjector,
|
||||
`Unmatched $brandName authorization`)
|
||||
}
|
||||
}
|
||||
}
|
||||
match [`__respondsTo`, [`get`, _]] {
|
||||
true
|
||||
}
|
||||
match [`__respondsTo`, [_, _]] {
|
||||
false
|
||||
}
|
||||
match [`__getAllegedType`, []] {
|
||||
null.__getAllegedType()
|
||||
}
|
||||
}
|
||||
return [ProveAuth, CheckAuth]
|
||||
}
|
||||
14
samples/E/IO.E
Normal file
14
samples/E/IO.E
Normal file
@@ -0,0 +1,14 @@
|
||||
# E sample from
|
||||
# http://wiki.erights.org/wiki/Walnut/Ordinary_Programming/InputOutput
|
||||
#File objects for hardwired files:
|
||||
def file1 := <file:myFile.txt>
|
||||
def file2 := <file:/home/marcs/myFile.txt>
|
||||
|
||||
#Using a variable for a file name:
|
||||
def filePath := "c:\\docs\\myFile.txt"
|
||||
def file3 := <file>[filePath]
|
||||
|
||||
#Using a single character to specify a Windows drive
|
||||
def file4 := <file:c:/docs/myFile.txt>
|
||||
def file5 := <c:/docs/myFile.txt>
|
||||
def file6 := <c:\docs\myFile.txt>
|
||||
9
samples/E/Promises.E
Normal file
9
samples/E/Promises.E
Normal file
@@ -0,0 +1,9 @@
|
||||
# E snippet from
|
||||
# http://wiki.erights.org/wiki/Walnut/Distributed_Computing/Promises
|
||||
when (tempVow) -> {
|
||||
#...use tempVow
|
||||
} catch prob {
|
||||
#.... report problem
|
||||
} finally {
|
||||
#....log event
|
||||
}
|
||||
18
samples/E/minChat.E
Normal file
18
samples/E/minChat.E
Normal file
@@ -0,0 +1,18 @@
|
||||
# from
|
||||
# http://wiki.erights.org/wiki/Walnut/Secure_Distributed_Computing/Auditing_minChat
|
||||
pragma.syntax("0.9")
|
||||
to send(message) {
|
||||
when (friend<-receive(message)) -> {
|
||||
chatUI.showMessage("self", message)
|
||||
} catch prob {chatUI.showMessage("system", "connection lost")}
|
||||
}
|
||||
to receive(message) {chatUI.showMessage("friend", message)}
|
||||
to receiveFriend(friendRcvr) {
|
||||
bind friend := friendRcvr
|
||||
chatUI.showMessage("system", "friend has arrived")
|
||||
}
|
||||
to save(file) {file.setText(makeURIFromObject(chatController))}
|
||||
to load(file) {
|
||||
bind friend := getObjectFromURI(file.getText())
|
||||
friend <- receiveFriend(chatController)
|
||||
}
|
||||
Reference in New Issue
Block a user