Page MenuHomeWickedGov Phorge

brackets.foma
No OneTemporary

Size
740 B
Referenced Files
None
Subscribers
None

brackets.foma

# Helper functions for (non-nested) bracketing constructs
# The "[[" and "]]" are atomic tokens; they won't match any unicode input
# character. Sometime we need additional delimiters, so we've also defined
# "<<" and ">>" (which shouldn't ever appear in output).
define BRACKETS "[[" | "]]" | "<<" | ">>" ;
define REMOVEBRACKETS BRACKETS -> 0 ;
# This is useful to assert that an input doesn't have brackets, simplifying
# the FST.
define NO'BRACKETS [\BRACKETS]* ;
# Invert the sense of the brackets
# Ie, bracket the stuff not in brackets, remove brackets from bracketed stuff.
define SWAPBRACKETS [
"[["->"]]" ,,
"]]"->"[["
] .o. [
[..]->"[[" || .#. _
] .o. [
[..]->"]]" || _ .#.
] .o. [
"[[" "]]" -> 0 || .#. _ , _ .#.
];

File Metadata

Mime Type
text/plain
Expires
Oct 7 2026, 18:47 (6 w, 5 d ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
7f/89/b263f02c0694238e2e9f3d4c9525
Default Alt Text
brackets.foma (740 B)

Event Timeline