|
Last change
on this file since 34b2f54d was f1bed857, checked in by Jiří Zárevúcky <zarevucky.jiri@…>, 4 years ago |
|
Update sysel scripts
|
-
Property mode
set to
100644
|
|
File size:
878 bytes
|
| Line | |
|---|
| 1 | --
|
|---|
| 2 | -- SPDX-FileCopyrightText: 2010 Jiri Svoboda
|
|---|
| 3 | --
|
|---|
| 4 | -- SPDX-License-Identifier: BSD-3-Clause
|
|---|
| 5 | --
|
|---|
| 6 |
|
|---|
| 7 | --
|
|---|
| 8 | -- Declarations for boxed variants of primitive types. The interpreter
|
|---|
| 9 | -- binds to these types internally. They must be declared.
|
|---|
| 10 | --
|
|---|
| 11 |
|
|---|
| 12 | class Bool is
|
|---|
| 13 | var Value : bool;
|
|---|
| 14 | end
|
|---|
| 15 |
|
|---|
| 16 | class Char is
|
|---|
| 17 | var Value : char;
|
|---|
| 18 |
|
|---|
| 19 | fun get_as_string() : string, builtin;
|
|---|
| 20 |
|
|---|
| 21 | -- String representation.
|
|---|
| 22 | prop AsString : string is
|
|---|
| 23 | get is
|
|---|
| 24 | return get_as_string();
|
|---|
| 25 | end
|
|---|
| 26 | end
|
|---|
| 27 | end
|
|---|
| 28 |
|
|---|
| 29 | class Int is
|
|---|
| 30 | var Value : int;
|
|---|
| 31 |
|
|---|
| 32 | fun get_as_string() : string, builtin;
|
|---|
| 33 |
|
|---|
| 34 | -- String representation.
|
|---|
| 35 | prop AsString : string is
|
|---|
| 36 | get is
|
|---|
| 37 | return get_as_string();
|
|---|
| 38 | end
|
|---|
| 39 | end
|
|---|
| 40 | end
|
|---|
| 41 |
|
|---|
| 42 | class String is
|
|---|
| 43 | var Value : string;
|
|---|
| 44 |
|
|---|
| 45 | fun get_length() : int, builtin;
|
|---|
| 46 |
|
|---|
| 47 | -- Length of string.
|
|---|
| 48 | prop Length : int is
|
|---|
| 49 | get is
|
|---|
| 50 | return get_length();
|
|---|
| 51 | end
|
|---|
| 52 | end
|
|---|
| 53 |
|
|---|
| 54 | -- Slice (sub-string).
|
|---|
| 55 | fun Slice(start : int; length : int) : string, builtin;
|
|---|
| 56 | end
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.