- Add while, for, and do-while loops with break/continue - Implement assignment statements (prevents if(x=10) bugs) - Keep assignment expressions only for for-loop clauses - Fix critical memory management bug (dangling pointers in cleanup) - Add automatic memory cleanup with conservative reference counting - Consolidate documentation into single reference file - Add comprehensive test coverage for all loop types and edge cases - VSCode extension for bob highlighting and snippets
175 lines
4.0 KiB
JSON
175 lines
4.0 KiB
JSON
{
|
|
"name": "Bob",
|
|
"scopeName": "source.bob",
|
|
"patterns": [
|
|
{
|
|
"include": "#comments"
|
|
},
|
|
{
|
|
"include": "#strings"
|
|
},
|
|
{
|
|
"include": "#numbers"
|
|
},
|
|
{
|
|
"include": "#keywords"
|
|
},
|
|
{
|
|
"include": "#functions"
|
|
},
|
|
{
|
|
"include": "#variables"
|
|
},
|
|
{
|
|
"include": "#operators"
|
|
}
|
|
],
|
|
"repository": {
|
|
"comments": {
|
|
"patterns": [
|
|
{
|
|
"name": "comment.line.double-slash.bob",
|
|
"match": "//.*$"
|
|
},
|
|
{
|
|
"name": "comment.block.bob",
|
|
"begin": "/\\*",
|
|
"end": "\\*/"
|
|
}
|
|
]
|
|
},
|
|
"strings": {
|
|
"patterns": [
|
|
{
|
|
"name": "string.quoted.double.bob",
|
|
"begin": "\"",
|
|
"end": "\"",
|
|
"patterns": [
|
|
{
|
|
"name": "constant.character.escape.bob",
|
|
"match": "\\\\[nt\"\\\\]"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"name": "string.quoted.single.bob",
|
|
"begin": "'",
|
|
"end": "'",
|
|
"patterns": [
|
|
{
|
|
"name": "constant.character.escape.bob",
|
|
"match": "\\\\[nt'\\\\]"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"numbers": {
|
|
"patterns": [
|
|
{
|
|
"name": "constant.numeric.integer.bob",
|
|
"match": "\\b\\d+\\b"
|
|
},
|
|
{
|
|
"name": "constant.numeric.float.bob",
|
|
"match": "\\b\\d+\\.\\d+\\b"
|
|
}
|
|
]
|
|
},
|
|
"keywords": {
|
|
"patterns": [
|
|
{
|
|
"name": "keyword.control.bob",
|
|
"match": "\\b(if|else|while|do|for|break|continue|return|var|func)\\b"
|
|
},
|
|
{
|
|
"name": "keyword.operator.bob",
|
|
"match": "\\b(and|or|not)\\b"
|
|
},
|
|
{
|
|
"name": "constant.language.bob",
|
|
"match": "\\b(true|false|none)\\b"
|
|
}
|
|
]
|
|
},
|
|
"functions": {
|
|
"patterns": [
|
|
{
|
|
"name": "entity.name.function.bob",
|
|
"match": "\\b(func)\\s+([a-zA-Z_][a-zA-Z0-9_]*)",
|
|
"captures": {
|
|
"1": { "name": "keyword.control.bob" },
|
|
"2": { "name": "entity.name.function.bob" }
|
|
}
|
|
},
|
|
{
|
|
"name": "support.function.builtin.bob",
|
|
"match": "\\b(print|assert|input|type|toString|toNumber|time)\\b"
|
|
}
|
|
]
|
|
},
|
|
"variables": {
|
|
"patterns": [
|
|
{
|
|
"name": "variable.other.bob",
|
|
"match": "\\bvar\\s+([a-zA-Z_][a-zA-Z0-9_]*)",
|
|
"captures": {
|
|
"1": { "name": "keyword.control.bob" },
|
|
"2": { "name": "variable.other.bob" }
|
|
}
|
|
},
|
|
{
|
|
"name": "variable.other.bob",
|
|
"match": "\\b([a-zA-Z_][a-zA-Z0-9_]*)(?=\\s*=)",
|
|
"captures": {
|
|
"1": { "name": "variable.other.bob" }
|
|
}
|
|
}
|
|
]
|
|
},
|
|
"operators": {
|
|
"patterns": [
|
|
{
|
|
"name": "keyword.operator.increment.bob",
|
|
"match": "\\+\\+|--"
|
|
},
|
|
{
|
|
"name": "keyword.operator.compound.bob",
|
|
"match": "\\+=|-=|\\*=|/=|%=|&=|\\|=|\\^=|<<=|>>="
|
|
},
|
|
{
|
|
"name": "keyword.operator.comparison.bob",
|
|
"match": "==|!=|<=|>="
|
|
},
|
|
{
|
|
"name": "keyword.operator.logical.bob",
|
|
"match": "&&|\\|\\||!"
|
|
},
|
|
{
|
|
"name": "keyword.operator.bitwise.bob",
|
|
"match": "<<|>>|&|\\||\\^|~"
|
|
},
|
|
{
|
|
"name": "keyword.operator.arithmetic.bob",
|
|
"match": "\\+|-|\\*|/|%"
|
|
},
|
|
{
|
|
"name": "keyword.operator.comparison.bob",
|
|
"match": "<|>"
|
|
},
|
|
{
|
|
"name": "keyword.operator.assignment.bob",
|
|
"match": "="
|
|
},
|
|
{
|
|
"name": "keyword.operator.punctuation.bob",
|
|
"match": "\\(|\\)|\\{|\\}|\\[|\\]|,|;|\\."
|
|
},
|
|
{
|
|
"name": "keyword.operator.conditional.bob",
|
|
"match": "\\?|:"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
} |