/**
 * @license
 * Copyright 2018 The FOAM Authors. All Rights Reserved.
 * http://www.apache.org/licenses/LICENSE-2.0
 */

package foam.lib.parse;

import foam.lib.parse.PStream;
import foam.lib.parse.Parser;
import foam.lib.parse.ParserContext;

public class LiteralIC implements Parser {
  private String string;
  private Object value;

  public LiteralIC(String s) {
    this(s, s);
  }

  public LiteralIC(String s, Object v) {
    string = s.toUpperCase();
    value = v;
  }

  public PStream parse(PStream ps, ParserContext x) {
    for ( int i = 0 ; i < string.length() ; i++ ) {
      if ( ! ps.valid() ||
          Character.toUpperCase(ps.head()) != string.charAt(i) ) {
        return null;
      }

      ps = ps.tail();
    }

    return ps.setValue(value);
  }
}

@@ -275,16 +275,19 @@
 iteralIC
+%0D%0A 
  impleme
@@ -300,21 +300,24 @@
 rser
- 
+%0D%0A
 %7B%0D%0A  pr
-ivate
+otected
  Str
@@ -337,13 +337,15 @@
   pr
-ivate
+otected
  Obj
@@ -497,16 +497,17 @@
   value 
+ 
 = v;%0D%0A  
@@ -816,12 +816,91 @@
 );%0D%0A  %7D%0D
+%0A%0D%0A  public String toString() %7B%0D%0A    return %22LiteralIC(%22 + string_ + %22)%22;%0D%0A  %7D%0D
 %0A%7D%0D%0A

Add toString to LiteralIC.