From fd85e9980c0305c6dfb91aaeb199430a89163c3e Mon Sep 17 00:00:00 2001 From: geno Date: Thu, 27 Jun 2024 20:49:56 +0200 Subject: fixed comp_for and added reseved word type --- src/ast/types/ContinueBreakType.java | 10 ---------- src/ast/types/NoneType.java | 16 ++++++++++++++++ src/ast/types/ReservedWordsType.java | 10 ++++++++++ 3 files changed, 26 insertions(+), 10 deletions(-) delete mode 100644 src/ast/types/ContinueBreakType.java create mode 100644 src/ast/types/NoneType.java create mode 100644 src/ast/types/ReservedWordsType.java (limited to 'src/ast/types') diff --git a/src/ast/types/ContinueBreakType.java b/src/ast/types/ContinueBreakType.java deleted file mode 100644 index dfcf1f2..0000000 --- a/src/ast/types/ContinueBreakType.java +++ /dev/null @@ -1,10 +0,0 @@ -package ast.types; - -/** - * A type for the continue and break statements. - */ -public class ContinueBreakType extends Type { - public String toPrint(String prefix) { - return prefix + "ContinueBreak\n"; - } -} diff --git a/src/ast/types/NoneType.java b/src/ast/types/NoneType.java new file mode 100644 index 0000000..42f7fd7 --- /dev/null +++ b/src/ast/types/NoneType.java @@ -0,0 +1,16 @@ +package ast.types; + +/** + * A none type. None return unit. + */ +public class NoneType extends Type { + + public String toPrint(String prefix) { + return prefix + "None\n"; + } + + @Override + public String toString() { + return "None"; + } +} diff --git a/src/ast/types/ReservedWordsType.java b/src/ast/types/ReservedWordsType.java new file mode 100644 index 0000000..f5f7ac5 --- /dev/null +++ b/src/ast/types/ReservedWordsType.java @@ -0,0 +1,10 @@ +package ast.types; + +/** + * A type for the continue and break statements. + */ +public class ReservedWordsType extends Type { + public String toPrint(String prefix) { + return prefix + "ReservedWords\n"; + } +} -- cgit v1.2.3-71-g8e6c