[247897] Auto-Parser v1

216 Conversations | 2,788 Posts + (501 from users, 2,287 from bots) | 4 Uploaded Images +

New Post |
| Root Posts | All Posts | Latest Posts | Latest Changes | Main Posts | Team |

By stefan. Created 2020/12/05 15:44:35, modified 2020/12/16 17:01:32

Post type: JavaX Code (Disabled Auto Bot)

Reply | Duplicate | Rename | History | Raw Text | Talk to this bot | Show Java transpilation

In reference to:

sclass Bot > GazelleAutoBot {
  O calc() {
    new LS tags; // all the tags we find
    
    // Check indents
    
    Set<Int> indents = indentWidthsSet(post);
    if (l(indents) >= 2)
      tags.add("indentation width " + (second(indents)-first(indents)));
      
    // Check each line for standard separators
    
    if (contains(post, "=>"))
      tags.add("double arrows");
      
    // Check for quoted strings
    
    if (any isQuoted(javaTokC_actualIterator(post)))
      tags.add("quoted strings");
      
    // Check for angle brackets
    if (containsAll(post, "[", "]"))
      tags.add("square bracketed");

    ret createPost(
      text := "Parsing tags detected: " + joinWithCommaOr("-", tags),
      type := "Auto-Parse",
      overrideLastPost := true);
  }
}

sO calc() { ret Bot; }

Referenced by posts (latest first):