types.js 598 B

123456789101112131415161718192021
  1. import { BaseTypes } from './baseTypes';
  2. import { Type } from "./type";
  3. import { MultiType } from "./multiType";
  4. const INTEGER = new Type(BaseTypes.INTEGER);
  5. const REAL = new Type(BaseTypes.REAL);
  6. const STRING = new Type(BaseTypes.STRING);
  7. const BOOLEAN = new Type(BaseTypes.BOOLEAN);
  8. const VOID = new Type(BaseTypes.VOID);
  9. const UNDEFINED = new Type(BaseTypes.UNDEFINED);
  10. const ALL = new MultiType([INTEGER, REAL, STRING, BOOLEAN]);
  11. export const Types = Object.freeze({
  12. INTEGER: INTEGER,
  13. REAL: REAL,
  14. STRING: STRING,
  15. BOOLEAN: BOOLEAN,
  16. VOID: VOID,
  17. UNDEFINED: UNDEFINED,
  18. ALL: ALL
  19. });