Skip to content

Instantly share code, notes, and snippets.

@samaaron
Created January 8, 2009 11:42
Show Gist options
  • Select an option

  • Save samaaron/44692 to your computer and use it in GitHub Desktop.

Select an option

Save samaaron/44692 to your computer and use it in GitHub Desktop.
{ scopeName = 'source.ioke';
firstLineMatch = '^#!/.*\bioke\b';
fileTypes = ( 'ik' );
foldingStartMarker = '(method|do|macro|fn|fnx|describe|it)\((?![^)]*+\))';
foldingStopMarker = '^\s*+\)';
patterns = (
{ name = 'constant.object.mimic.ioke';
begin = '[[:alnum:]!?_:-]+(?=[[:space:]]*=.*mimic.*($|\.))';
end = '(?=\.)|$';
patterns = (
{ include = '#operator_symbols'; },
{ include = '#operator_names'; },
{ include = '#kinds'; },
{ include = '#prototype_names'; },
);
},
{ include = '#operator_symbols'; },
{ include = '#operator_names'; },
{ include = '#kinds'; },
{ include = '#prototype_names'; },
{ name = 'comment.line.ioke';
begin = ';';
end = '$\n?';
},
{ name = 'constant.numeric.ioke';
match = '\b[[:digit:]_.eE\-]+\b';
},
{ name = 'constant.numeric.hexadecimal.ioke';
match = '\b0[xX][A-Fa-f0-9]+';
},
{ name = 'constant.kind.ioke';
match = '\b[A-Z][[:alnum:]!?_:-]*\b';
},
{ name = 'variable.assignment.ioke';
match = '[[:alnum:]!?_:-]+(?=[[:space:]]*[+*/-]?=[^=].*($|\.))';
},
{ name = 'string.literal.keyword-argument.ioke';
match = '[[:alnum:]!?_:-]+?:\s';
},
{ name = 'string.literal.symbol.ioke';
match = '[^[:alnum:]!?_:-]:[[:alnum:]!?_:-]+';
},
{ name = 'string.regexp.ioke';
match = '#/.*?/[oxpniums]*';
},
{ name = 'string.regexp.ioke';
match = '#r\[.*?\][oxpniums]*';
},
{ name = 'string.literal.symbol.ioke';
begin = ':"';
end = '"';
patterns = (
{ name = 'constant.character.escape.ioke';
match = '\\.';
},
{ name = 'source.embedded.ioke';
match = '#\{(\})';
captures = {
0 = { name = 'punctuation.section.embedded.ioke'; };
1 = { name = 'source.embedded.empty.ioke'; };
};
},
{ name = 'source.embedded.ioke';
begin = '#\{';
end = '\}';
captures = { 0 = { name = 'punctuation.section.embedded.ioke'; }; };
patterns = (
{ include = '#nest_curly_and_self'; },
{ include = '$self'; },
);
},
);
},
{ name = 'string.quoted.double.ioke';
begin = '"';
end = '"';
patterns = (
{ name = 'constant.character.escape.ioke';
match = '\\.';
},
{ name = 'source.embedded.ioke';
match = '#\{(\})';
captures = {
0 = { name = 'punctuation.section.embedded.ioke'; };
1 = { name = 'source.embedded.empty.ioke'; };
};
},
{ name = 'source.embedded.ioke';
begin = '#\{';
end = '\}';
captures = { 0 = { name = 'punctuation.section.embedded.ioke'; }; };
patterns = (
{ include = '#nest_curly_and_self'; },
{ include = '$self'; },
);
},
);
},
{ name = 'string.quoted.double.ioke';
begin = '#\[';
end = '\]';
patterns = (
{ name = 'constant.character.escape.ioke';
match = '\\.';
},
{ name = 'source.embedded.ioke';
match = '#\{(\})';
captures = {
0 = { name = 'punctuation.section.embedded.ioke'; };
1 = { name = 'source.embedded.empty.ioke'; };
};
},
{ name = 'source.embedded.ioke';
begin = '#\{';
end = '\}';
captures = { 0 = { name = 'punctuation.section.embedded.ioke'; }; };
patterns = (
{ include = '#nest_curly_and_self'; },
{ include = '$self'; },
);
},
);
},
{ name = 'entity.name.function';
match = '\b(fn|fnx|method|macro)\b';
},
{ name = 'entity.prototype-names.ioke';
match = '\b(Base|Call|Condition|DateTime|DefaultBehavior|DefaultMacro|DefaultMethod|DefaultSyntax|Dict|FileSystem|Ground|Handler|IO|JavaMethod|LexicalBlock|LexicalMacro|List|Message|Method|Mixins|Number|Number Decimal|Number Integer|Number Rational|Number Real|Origin|Pair|Range|Regexp|Rescue|Restart|Runtime|Set|Symbol|System|Text)\b';
},
{ name = 'keyword.cell-names.ioke';
match = '\b(print|println|cell|cell\?|documentation|if|unless|while|until|loop|for|for:set|for:dict|bind|rescue|handle|restart|asText|inspect|notice|do|call|list|dict|set|with|kind)\b';
},
{ name = 'punctuation.ioke';
match = "(\`\`|\`|''|'|\.|\,|@|@@|\(|\))";
},
{ name = 'entity.standout-names.ioke';
match = '\bit\b';
},
{ name = 'keyword.operator.names.ioke';
match = '\b(return|break|continue|mimic|self|use|fn|fnx|method|macro|lecro|lecrox|syntax|dmacro|dlecro|dlecrox|dysntax|unless|true|false|nil)\b';
},
);
repository = {
kinds = {
patterns = (
{ name = 'constant.kind.ioke';
match = '\b[A-Z][[:alnum:]!?_:-]*\b';
},
);
};
nest_curly_and_self = {
patterns = (
{ begin = '\{';
end = '\}';
captures = { 0 = { name = 'punctuation.section.scope.ioke'; }; };
patterns = ( { include = '#nest_curly_and_self'; } );
},
{ include = '$self'; },
);
};
operator_names = {
patterns = (
{ name = 'keyword.operator.names.ioke';
match = '\b(return|break|mimic|self|use|if|unless|true|false|nil)\b';
},
);
};
operator_symbols = {
patterns = (
{ name = 'entity.operator.symbols.ioke';
match = '
(?:
\.\.\. | # "..."
\.\. | # ".."
=> | # "=>"
=>> | # "=>>"
#
\+\+ | # "++"
# "--"
#
# "**"
# "*"
# "/"
# "%"
#
# "+"
# "-"
#
# "<<"
# ">>"
#
# ">"
# "<"
# "<="
# ">="
# "<=>"
#
# "==="
# "=="
# "!="
#
# "=~"
# "!~"
#
# "&"
#
# "^"
#
# "|"
#
#; "or"
#; "nor"
#; "xor"
#; "and"
#; "nand"
# "&&"
# "?&"
#
# "||"
# "?|"
#
# "<-"
# "<->"
# "->"
#
# "~"
# "$"
# "+>"
# "!>"
# "<>"
# "&>"
# "%>"
# "#>"
# "@>"
# "/>"
# "*>"
# "?>"
# "|>"
# "^>"
# "~>"
# "**>"
# "&&>"
# "||>"
# "$>"
# "->>"
# "+>>"
# "!>>"
# "<>>"
# "&>>"
# "%>>"
# "#>>"
# "@>>"
# "/>>"
# "*>>"
# "?>>"
# "|>>"
# "^>>"
# "~>>"
# "**>>"
# "&&>>"
# "||>>"
# "$>>"
#
# "="
# "+="
# "-="
# "*="
# "/="
# "%="
# "&="
# "^="
# "|="
# "<<="
# ">>="
)';
},
);
};
prototype_names = {
patterns = (
{ name = 'entity.prototype-names.ioke';
match = '\b(Base|DefaultBehavior|Ground|Origin|System|Runtime|Text|Number|Method|DefaultMethod|JavaMethod|Mixins|Restart|List|Dict)\b';
},
);
};
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment