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
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,6 @@ cscope.out
.gdb_history
site/
__pycache__/
doc
doc/diagnostics-style.md
doc/doc_testing.md
doc/peg-parser-research.md
2 changes: 1 addition & 1 deletion doc/language-reference/tokenization.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ a a1 a_1 abc123 a? ?a ?
```
The following are **reserved keywords** and may not be used as identifiers:

`__ARG__` `__COLUMN__` `__FILE__` `__LINE__` `__llvm__` `alias` `and` `as` `break` `case` `catch` `continue` `define` `else` `enum` `eval` `external` `false` `finally` `for` `forward` `goto` `if` `import` `in` `inline` `instance` `not` `onerror` `or` `overload` `private` `public` `record` `ref` `return` `rvalue` `static` `switch` `throw` `true` `try` `var` `variant` `while`
`__ARG__` `__COLUMN__` `__FILE__` `__LINE__` `__llvm__` `alias` `and` `as` `break` `case` `catch` `continue` `define` `else` `enum` `eval` `external` `false` `finally` `for` `forward` `goto` `if` `import` `in` `inline` `instance` `not` `onerror` `or` `overload` `private` `public` `record` `ref` `return` `rvalue` `switch` `throw` `true` `try` `var` `variant` `while` `default` `noinline` `forceinline` `staticassert` `when` `newtype`

### Integer Literals

Expand Down
34 changes: 34 additions & 0 deletions editor-support/SyntaxHighlightingExample.crm
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,11 @@ keywordsTest(x, ref y, rvalue z, forward w, #v) {
labelTest:

try {} catch(x) {} catch(y) {}
try {} catch(x) {} finally {}
try { onerror cleanup(); doStuff(); } catch(x) {}

eval someMacro();
throw someError();

return x;
return ref y;
Expand All @@ -147,6 +152,22 @@ labelTest:
[X, Y, ..Z | PatternGuard?()]
alias aliasTest(x:X, y:Y, ..z:Z);

[T when CallDefined?(T)]
alias whenAliasTest(x:T);

[T, U when Foo?(T) and Bar?(U)]
alias whenAliasTest2(x:T, y:U);

define defineTest;
define defineTest2(x, y) :;
define defineTest3(x:Int, y:Char) : Float;

newtype NewtypeTest = Int;
newtype NewtypeTest2 = Pointer[Char];

staticassert (true);
staticassert (CallDefined?(defineTest, Int));

external externalTest1(x:Int, y:Char) : Float;
external (stdcall) externalTest2(x:Int, y:Char);
external (cdecl, "_externalTest3") externalTest3(x:Int, y:Char, ..);
Expand Down Expand Up @@ -206,13 +227,26 @@ operatorsTest() {
private overload keywordsTest() {}
public overload keywordsTest() {}

inline overload keywordsTest(x:Int) {}
noinline overload keywordsTest(x:Char) {}
forceinline overload keywordsTest(x:Float) {}

inline inlineTest() {}
noinline noinlineTest() {}
forceinline forceinlineTest() {}

external externalKeywordTest1();
external externalKeywordTest2() {}

valueTest() {
true;
false;

__FILE__;
__LINE__;
__COLUMN__;
__ARG__ x;

'a';
' ';
'\f';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@
{
"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"
"match": "[+-]?\\b[0-9][0-9_]*((\\.([0-9][0-9_]*)?)([eE][+-]?[0-9][0-9_]*)?|[eE][+-]?[0-9][0-9_]*)([a-z][a-z0-9]*)?\\b"
},
{
"comment": "Decimal integer: 123, 1_000u",
Expand All @@ -165,26 +165,18 @@
},

"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"
}
]
"name": "keyword.control.ceramic",
"match": "\\b(if|else|switch|case|for|while|goto|return|break|continue|try|catch|throw|onerror|finally|eval|default|staticassert|define|overload|record|variant|instance|enum|external|inline|public|private|in|as|when|newtype|noinline|forceinline)\\b"
},

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

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

"builtin-types": {
Expand Down Expand Up @@ -256,7 +248,7 @@
"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" },
"1": { "name": "storage.modifier.ceramic" },
"2": { "name": "variable.other.ceramic" }
}
},
Expand Down
49 changes: 0 additions & 49 deletions editor-support/vscode/language-configuration.json

This file was deleted.

34 changes: 0 additions & 34 deletions editor-support/vscode/package.json

This file was deleted.

Loading
Loading