types.ts 524 B

1234567891011121314151617181920
  1. import { Type } from "./type";
  2. import { MultiType } from "./multiType";
  3. const INTEGER = new Type("integer", 0);
  4. const REAL = new Type("real", 1);
  5. const STRING = new Type("text", 2);
  6. const BOOLEAN =new Type("boolean", 3);
  7. const VOID = new Type("void", 4);
  8. const UNDEFINED = new Type("undefined", 5);
  9. const ALL = new MultiType([INTEGER, REAL, STRING, BOOLEAN]);
  10. export const Types = Object.freeze({
  11. INTEGER: INTEGER,
  12. REAL: REAL,
  13. STRING: STRING,
  14. BOOLEAN: BOOLEAN,
  15. VOID: VOID,
  16. UNDEFINED: UNDEFINED,
  17. ALL: ALL
  18. });