Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,6 @@ core.*
tags
cscope.out
.gdb_history
site/
__pycache__/

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Ceramic
![ceramic](doc/assets/logo.svg)

Ceramic is a programming language based on Clay designed for Generic Programming.

Expand Down
File renamed without changes.
File renamed without changes.
44 changes: 44 additions & 0 deletions doc/assets/ceramic-light.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{
"name": "ceramic-light",
"type": "light",
"colors": {
"editor.foreground": "#2d2520"
},
"tokenColors": [
{
"scope": [
"comment",
"comment.block.ceramic",
"comment.line.double-slash.ceramic",
"punctuation.definition.comment.ceramic"
],
"settings": { "foreground": "#a09080", "fontStyle": "italic" }
},
{
"scope": [
"string",
"string.quoted.double.ceramic",
"string.quoted.single.ceramic",
"string.quoted.triple.ceramic",
"punctuation.definition.string.begin.ceramic",
"punctuation.definition.string.end.ceramic",
"constant.character.escape.ceramic"
],
"settings": { "foreground": "#2a6e2a" }
},
{
"scope": [
"keyword",
"keyword.control.ceramic",
"keyword.control.import.ceramic",
"keyword.other.ceramic",
"keyword.other.debug.ceramic",
"keyword.operator.word.ceramic",
"storage.type.ceramic",
"storage.modifier.ceramic",
"storage.modifier.attribute.ceramic"
],
"settings": { "foreground": "#1a5fb4", "fontStyle": "bold" }
}
]
}
311 changes: 311 additions & 0 deletions doc/assets/ceramic.tmLanguage.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,311 @@
{
"$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json",
"name": "Ceramic",
"scopeName": "source.ceramic",
"patterns": [
{ "include": "#comments" },
{ "include": "#strings" },
{ "include": "#character-literal" },
{ "include": "#static-identifier" },
{ "include": "#attribute-list" },
{ "include": "#numbers" },
{ "include": "#import-declaration" },
{ "include": "#function-definition-name" },
{ "include": "#type-definition-name" },
{ "include": "#overload-name" },
{ "include": "#external-name" },
{ "include": "#variable-binding" },
{ "include": "#keywords" },
{ "include": "#operator-keywords" },
{ "include": "#storage-keywords" },
{ "include": "#builtin-types" },
{ "include": "#boolean-literals" },
{ "include": "#debug-keywords" },
{ "include": "#special-identifiers" },
{ "include": "#goto-label" },
{ "include": "#type-annotation" },
{ "include": "#lambda-operators" },
{ "include": "#multi-value" },
{ "include": "#operators" }
],
"repository": {

"comments": {
"patterns": [
{
"name": "comment.block.ceramic",
"begin": "/\\*",
"end": "\\*/",
"beginCaptures": { "0": { "name": "punctuation.definition.comment.ceramic" } },
"endCaptures": { "0": { "name": "punctuation.definition.comment.ceramic" } }
},
{
"name": "comment.line.double-slash.ceramic",
"begin": "//",
"end": "$",
"beginCaptures": { "0": { "name": "punctuation.definition.comment.ceramic" } }
}
]
},

"strings": {
"patterns": [
{
"comment": "Triple-quoted string must come before single-quoted",
"name": "string.quoted.triple.ceramic",
"begin": "\"\"\"",
"end": "\"\"\"(?!\")",
"beginCaptures": { "0": { "name": "punctuation.definition.string.begin.ceramic" } },
"endCaptures": { "0": { "name": "punctuation.definition.string.end.ceramic" } },
"patterns": [{ "include": "#string-escape" }]
},
{
"name": "string.quoted.double.ceramic",
"begin": "\"",
"end": "\"",
"beginCaptures": { "0": { "name": "punctuation.definition.string.begin.ceramic" } },
"endCaptures": { "0": { "name": "punctuation.definition.string.end.ceramic" } },
"patterns": [{ "include": "#string-escape" }]
}
]
},

"string-escape": {
"name": "constant.character.escape.ceramic",
"match": "\\\\([nrtf\\\\\"'0$]|x[0-9A-Fa-f]{2})"
},

"character-literal": {
"name": "string.quoted.single.ceramic",
"match": "'([^'\\\\]|\\\\([nrtf\\\\\"'0$]|x[0-9A-Fa-f]{2}))'",
"captures": {
"2": { "name": "constant.character.escape.ceramic" }
}
},

"static-identifier": {
"patterns": [
{
"comment": "Triple-quoted static identifier: #\"\"\"...\"\"\"",
"name": "constant.other.ceramic",
"begin": "#\"\"\"",
"end": "\"\"\"(?!\")",
"beginCaptures": { "0": { "name": "punctuation.definition.constant.ceramic" } },
"endCaptures": { "0": { "name": "punctuation.definition.constant.ceramic" } },
"patterns": [{ "include": "#string-escape" }]
},
{
"comment": "Quoted static identifier: #\"...\"",
"name": "constant.other.ceramic",
"begin": "#\"",
"end": "\"",
"beginCaptures": { "0": { "name": "punctuation.definition.constant.ceramic" } },
"endCaptures": { "0": { "name": "punctuation.definition.constant.ceramic" } },
"patterns": [{ "include": "#string-escape" }]
},
{
"comment": "Plain static identifier: #ident",
"name": "constant.other.ceramic",
"match": "#[A-Za-z_?][A-Za-z0-9_?]*"
}
]
},

"attribute-list": {
"comment": "[[transparent]] and other [[...]] attribute lists on function/overload definitions",
"name": "meta.attribute.ceramic",
"begin": "\\[\\[",
"end": "\\]\\]",
"beginCaptures": { "0": { "name": "punctuation.definition.attribute.ceramic" } },
"endCaptures": { "0": { "name": "punctuation.definition.attribute.ceramic" } },
"patterns": [
{
"name": "storage.modifier.attribute.ceramic",
"match": "\\b(transparent)\\b"
},
{
"name": "entity.other.attribute-name.ceramic",
"match": "[A-Za-z_?][A-Za-z0-9_?]*"
}
]
},

"numbers": {
"patterns": [
{
"comment": "Hex float: 0x1.FFp-10",
"name": "constant.numeric.float.hex.ceramic",
"match": "[+-]?\\b0[xX][0-9A-Fa-f][0-9A-Fa-f_]*(\\.[0-9A-Fa-f_]*)?[pP][+-]?[0-9][0-9_]*(ss|uss|s|us|i|u|l|ul|ll|ull|ff?|fl|fll|f128|j|fj|ffj|lj|flj|fllj)?\\b"
},
{
"comment": "Hex integer: 0x1A3F",
"name": "constant.numeric.integer.hex.ceramic",
"match": "[+-]?\\b0[xX][0-9A-Fa-f][0-9A-Fa-f_]*(ss|uss|s|us|i128|u128|i|u|l|ul|ll|ull)?\\b"
},
{
"comment": "Decimal float: 1.0, 3e+10, 1.5e-3f",
"name": "constant.numeric.float.decimal.ceramic",
"match": "[+-]?\\b[0-9][0-9_]*((\\.([0-9][0-9_]*)?)([eE][+-]?[0-9][0-9_]*)?|[eE][+-]?[0-9][0-9_]*)(ff?|f128|l|j|fj|ffj|lj|f128j)?\\b"
},
{
"comment": "Decimal integer: 123, 1_000u",
"name": "constant.numeric.integer.decimal.ceramic",
"match": "[+-]?\\b[0-9][0-9_]*(ss|uss|s|us|i128|u128|i|u|l|ul|ll|ull|ff?|f128)?\\b"
}
]
},

"import-declaration": {
"comment": "[public|private] import some.module.path",
"match": "\\b((?:public|private)\\s+)?(import)\\b",
"captures": {
"1": { "name": "keyword.control.ceramic" },
"2": { "name": "keyword.control.import.ceramic" }
}
},

"keywords": {
"patterns": [
{
"name": "keyword.control.ceramic",
"match": "\\b(if|else|switch|case|for|while|goto|return|break|continue|try|catch|throw|onerror|finally|eval)\\b"
},
{
"name": "keyword.other.ceramic",
"match": "\\b(define|overload|record|variant|instance|enum|external|inline|public|private|in)\\b"
}
]
},

"operator-keywords": {
"name": "keyword.operator.word.ceramic",
"match": "\\b(and|or|not|as|rvalue|forward|ref|static)\\b"
},

"storage-keywords": {
"name": "storage.type.ceramic",
"match": "\\b(var|alias)\\b"
},

"builtin-types": {
"name": "support.type.ceramic",
"match": "\\b(Bool|Int8|Int16|Int32|Int64|Int128|UInt8|UInt16|UInt32|UInt64|UInt128|Float32|Float64|Float80|Float128|Int|UInt|Long|ULong|Short|UShort|Byte|UByte|Char|Float|Double|PtrInt|UPtrInt|SizeT|StringConstant|RawPointer|OpaquePointer|Pointer|CodePointer|RefCodePointer|CCodePointer|StdCallCodePointer|FastCallCodePointer|VarArgsCCodePointer|Array|Tuple|Union|Vec|Static|Void)\\b"
},

"boolean-literals": {
"name": "constant.language.boolean.ceramic",
"match": "\\b(true|false)\\b"
},

"debug-keywords": {
"name": "keyword.other.debug.ceramic",
"match": "\\b(observe|observeTo|observeCall|observeCallTo)\\b"
},

"special-identifiers": {
"name": "support.constant.ceramic",
"match": "\\b(__ARG__|__COLUMN__|__FILE__|__LINE__|__llvm__)\\b"
},

"goto-label": {
"comment": "labelName: at end of line",
"match": "^\\s*([A-Za-z_?][A-Za-z0-9_?]*)\\s*(?=:\\s*$)",
"captures": {
"1": { "name": "entity.name.label.ceramic" }
}
},

"lambda-operators": {
"name": "keyword.operator.lambda.ceramic",
"match": "=>|->"
},

"multi-value": {
"name": "keyword.operator.spread.ceramic",
"match": "\\.\\.\\.?"
},

"type-definition-name": {
"comment": "Name after record / variant / instance / define",
"match": "\\b(record|variant|instance|define)\\s+([A-Za-z_?][A-Za-z0-9_?]*)",
"captures": {
"1": { "name": "keyword.other.ceramic" },
"2": { "name": "entity.name.type.ceramic" }
}
},

"overload-name": {
"comment": "Function name after overload keyword",
"match": "\\b(overload)\\s+([A-Za-z_?][A-Za-z0-9_?]*)",
"captures": {
"1": { "name": "keyword.other.ceramic" },
"2": { "name": "entity.name.function.ceramic" }
}
},

"external-name": {
"comment": "Function/variable name after external (skipping optional calling-convention parens)",
"match": "\\b(external)\\b(?:\\s*\\([^)]*\\))?\\s+([A-Za-z_?][A-Za-z0-9_?]*)",
"captures": {
"1": { "name": "keyword.other.ceramic" },
"2": { "name": "entity.name.function.ceramic" }
}
},

"variable-binding": {
"comment": "Name introduced by var / ref / alias binding",
"match": "\\b(var|ref|alias)\\s+([A-Za-z_?][A-Za-z0-9_?]*)",
"captures": {
"1": { "name": "storage.type.ceramic" },
"2": { "name": "variable.other.ceramic" }
}
},

"function-definition-name": {
"comment": "Top-level function definition name at start of line with optional visibility keyword",
"match": "^(?:(private|public)\\s+)?([A-Za-z_?][A-Za-z0-9_?]*)\\s*(?=\\()",
"captures": {
"1": { "name": "keyword.other.ceramic" },
"2": { "name": "entity.name.function.ceramic" }
}
},

"type-annotation": {
"comment": ": after a parameter or binding name",
"match": "(?<=[A-Za-z0-9_?])\\s*(:)\\s*",
"captures": {
"1": { "name": "punctuation.separator.type-annotation.ceramic" }
}
},

"operators": {
"patterns": [
{
"name": "keyword.operator.assignment.compound.ceramic",
"match": "[+\\-*/%&|^~]:"
},
{
"name": "keyword.operator.comparison.ceramic",
"match": "==|!=|<=|>=|<|>"
},
{
"name": "keyword.operator.assignment.ceramic",
"match": "(?<![=!<>])=(?![=>])"
},
{
"name": "keyword.operator.arithmetic.ceramic",
"match": "[+\\-*/%]"
},
{
"name": "keyword.operator.bitwise.ceramic",
"match": "[&|^~]"
},
{
"name": "keyword.operator.dereference.ceramic",
"comment": "Postfix dereference ^ (not inside attribute lists)",
"match": "\\^"
}
]
}
}
}
6 changes: 6 additions & 0 deletions doc/assets/favicon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions doc/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ Ceramic is a programming language based on Clay designed for Generic Programming

## Documentation

- [Language Reference](language-reference.md): syntax, types, statements, expressions
- [Primitives Reference](primitives-reference.md): the `__primitives__` module
- [Language Reference](language-reference/index.md): syntax, types, statements, expressions
- [Primitives Reference](primitives-reference/index.md): the `__primitives__` module

## License

Expand Down
Loading
Loading