Bob/bob-language-extension/syntaxes/bob.tmLanguage.json
Bobby Lucero eacb86ec77 feat: comprehensive language enhancements and code quality improvements
Major additions and improvements across the Bob language ecosystem:

Core Language Features:

- Add comprehensive dictionary support with full CRUD operations

- Implement built-in functions: keys(), values(), has() for dictionaries

- Add string multiplication operator (string * number)

- Enhance error reporting with detailed context and call stacks

- Add ternary operator support (condition ? true_expr : false_expr)

- Implement do-while loops with break/continue support

- Add array increment/decrement operators (++, --)

- Add cross-type comparison operators with proper type coercion

- Implement toInt() function for float-to-integer conversion

- Add float array index auto-truncation (like JavaScript/Lua)

Code Quality & Linter Fixes:

- Remove all "using namespace std;" statements (best practice)

- Add proper std:: prefixes throughout codebase

- Fix const correctness in helper functions

- Resolve class/struct declaration mismatches

- Fix sign comparison warnings in array indexing

- Remove unused lambda captures in built-in functions

- Fix brace initialization warnings in parser

Documentation & Tooling:

- Significantly expand BOB_LANGUAGE_REFERENCE.md with new features

- Update VS Code extension with enhanced syntax highlighting

- Add comprehensive code snippets for new language features

- Update version information and package metadata

Test Suite:

- Add extensive dictionary functionality tests

- Add tests for new operators and built-in functions

- Add comprehensive copy behavior tests (by value vs by reference)

- Add performance and edge case testing

Architecture Improvements:

- Enhance Value system with proper move semantics

- Improve memory management with shared_ptr for complex types

- Add trampoline-based tail call optimization

- Implement proper error context propagation

This represents a major milestone in Bob language development with production-ready dictionary support, comprehensive testing, and significantly improved code quality.
2025-08-07 00:12:04 -04:00

273 lines
6.2 KiB
JSON

{
"name": "Bob",
"scopeName": "source.bob",
"patterns": [
{
"include": "#comments"
},
{
"include": "#strings"
},
{
"include": "#numbers"
},
{
"include": "#arrays"
},
{
"include": "#dictionaries"
},
{
"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\"\\\\e]"
}
]
},
{
"name": "string.quoted.single.bob",
"begin": "'",
"end": "'",
"patterns": [
{
"name": "constant.character.escape.bob",
"match": "\\\\[nt'\\\\e]"
}
]
}
]
},
"numbers": {
"patterns": [
{
"name": "constant.numeric.integer.bob",
"match": "\\b\\d+\\b"
},
{
"name": "constant.numeric.float.bob",
"match": "\\b\\d+\\.\\d+\\b"
},
{
"name": "constant.numeric.binary.bob",
"match": "\\b0b[01]+\\b"
},
{
"name": "constant.numeric.hex.bob",
"match": "\\b0x[0-9a-fA-F]+\\b"
}
]
},
"arrays": {
"patterns": [
{
"name": "meta.array.bob",
"begin": "\\[",
"end": "\\]",
"patterns": [
{
"include": "#expressions"
}
]
},
{
"name": "variable.other.array-index.bob",
"match": "([a-zA-Z_][a-zA-Z0-9_]*)\\[([^\\]]+)\\]",
"captures": {
"1": { "name": "variable.other.bob" },
"2": { "name": "constant.numeric.integer.bob" }
}
}
]
},
"dictionaries": {
"patterns": [
{
"name": "meta.dictionary.bob",
"begin": "\\{",
"end": "\\}",
"patterns": [
{
"name": "string.quoted.double.bob",
"begin": "\"",
"end": "\"",
"patterns": [
{
"name": "constant.character.escape.bob",
"match": "\\\\[nt\"\\\\e]"
}
]
},
{
"name": "keyword.operator.bob",
"match": ":"
},
{
"include": "#expressions"
}
]
},
{
"name": "variable.other.dictionary-index.bob",
"match": "([a-zA-Z_][a-zA-Z0-9_]*)\\{([^\\}]+)\\}",
"captures": {
"1": { "name": "variable.other.bob" },
"2": { "name": "string.quoted.double.bob" }
}
}
]
},
"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|toInt|time|sleep|printRaw|len|push|pop|random|eval|keys|values|has)\\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": "\\?|:"
}
]
},
"expressions": {
"patterns": [
{
"include": "#comments"
},
{
"include": "#strings"
},
{
"include": "#numbers"
},
{
"include": "#keywords"
},
{
"include": "#functions"
},
{
"include": "#variables"
},
{
"include": "#operators"
}
]
}
}
}