-
Notifications
You must be signed in to change notification settings - Fork 93
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
1,032 additions
and
25 deletions.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"libraries": { | ||
"OSS": "./oss.dara" | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import OSS | ||
|
||
model mainFile extends OSS.File { | ||
size: number, | ||
} | ||
|
||
exception MainFileError extends OSS.File { | ||
size: number, | ||
} | ||
|
||
exception ExtendFileError extends OSS.FileError { | ||
size: number, | ||
} | ||
|
||
exception ExtendSubFileError extends OSS.SubFile.file { | ||
size: number, | ||
} | ||
|
||
static function call(size: number): void { | ||
var file = new mainFile{ | ||
name = 'name', | ||
size = 100, | ||
}; | ||
if(size > file.size) { | ||
throw new MainFileError{ | ||
name = 'name', | ||
size = 100, | ||
} | ||
} else if (size == file.size){ | ||
throw new ExtendFileError{ | ||
code = 'name', | ||
size = 100, | ||
} | ||
} else { | ||
throw new ExtendSubFileError{ | ||
name = 'name', | ||
size = 100, | ||
} | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
|
||
model File = { | ||
name: string, | ||
}; | ||
|
||
exception FileError = { | ||
code: string, | ||
} | ||
|
||
model SubFile = { | ||
file: { | ||
name: string, | ||
} | ||
} | ||
|
Oops, something went wrong.