Summary Files Commits Branches @commit @diff @stats
path: root / src / StringConsumer / WhitespaceConsumer.cl
diff options
context:
space:
mode:
1 files changed, 7 insertions, 9 deletions
-rw-r--r--src/StringConsumer/WhitespaceConsumer.cl16
diff --git a/src/StringConsumer/WhitespaceConsumer.cl b/src/StringConsumer/WhitespaceConsumer.cl
index 4c0b8b5..8f20385 100644
--- a/src/StringConsumer/WhitespaceConsumer.cl
+++ b/src/StringConsumer/WhitespaceConsumer.cl
@@ -1,12 +1,10 @@
-class WhitespaceConsumer inherits IStringConsumer {
- consume(s: String) : Int {{
- consumed_length <- 0;
- while or(s.substr(consumed_length, 1) = " ",
- s.substr(consumed_length, 1) = "\t")
- loop
- consumed_length <- consumed_length + 1
- pool;
- consumed_length;
+class WhitespaceConsumer inherits IWordConsumer {
+ init() : IStringConsumer {{
+ matched_words <- matched_words
+ .push(" ")
+ .push("\t")
+ ;
+ self;
}};
token() : IToken {