Skip to content

Next Gen STEP AP242 Native-ish BREP Geometric Modeling Kernel

4.2 KB
Raw Blame
{
  "$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json",
  "name": "Firmament",
  "scopeName": "source.firmament",
  "patterns": [
    { "include": "#comments" },
    { "include": "#strings" },
    { "include": "#genericFeatures" },
    { "include": "#declarations" },
    { "include": "#fields" },
    { "include": "#dimensions" },
    { "include": "#numbers" },
    { "include": "#constants" },
    { "include": "#types" },
    { "include": "#members" },
    { "include": "#operators" }
  ],
  "repository": {
    "comments": { "patterns": [{ "name": "comment.line.double-slash.firmament", "match": "//.*$" }] },
    "strings": {
      "patterns": [
        {
          "name": "string.quoted.double.firmament",
          "begin": "\"",
          "end": "\"",
          "patterns": [{ "name": "constant.character.escape.firmament", "match": "\\\\." }]
        }
      ]
    },
    "genericFeatures": {
      "patterns": [
        {
          "name": "meta.feature.generic.firmament",
          "match": "\\b(Hole|Slot|AddOffset|RemoveOffset)(<)(Shaft|Counterbore|Countersink|Capsule|RoundedRectangle|Prism|Cylinder|Sphere)(>)",
          "captures": {
            "1": { "name": "keyword.declaration.feature.firmament" },
            "2": { "name": "punctuation.definition.generic.begin.firmament" },
            "3": { "name": "entity.name.type.variant.firmament" },
            "4": { "name": "punctuation.definition.generic.end.firmament" }
          }
        }
      ]
    },
    "declarations": {
      "patterns": [
        {
          "name": "keyword.declaration.compound.firmament",
          "match": "\\b(?:Concept\\s+(?:Struct|Path)|Construction\\s+Plane|Assert\\s+Volume)\\b"
        },
        {
          "name": "keyword.declaration.firmament",
          "match": "\\b(?:Model|Units|Use|Include|Enum|Box|Cylinder|Cone|Sphere|Torus|RoundedBox|Frustum|Concept|Struct|Construction|Plane|Path|Profile|ProfileDelta|Sweep|Compose|Boss|Pocket|AddOffset|RemoveOffset|Modify|Selection|Record|Static|Table|Template|Pattern|Match|Require|Pmi|Datum|HoleDiameter|Assert|InlineStep|Recognize|Replace|EdgeFinish|Hole|Slot|Region|Segment|Loop|Base|Extrude|SheetMetal|Flange|Analysis|Assembly|Subassembly|Interface|Mate|Expose|Role|Lower|Allow|Anchor|Fixed|Force|Material|Results|Lattice)\\b"
        },
        { "name": "keyword.control.firmament", "match": "\\b(?:with|With|From|Using|On|Over|As|Current|Key)\\b" }
      ]
    },
    "fields": {
      "patterns": [
        {
          "match": "\\b([A-Za-z_][A-Za-z0-9_]*)(\\s*)(:)",
          "captures": {
            "1": { "name": "variable.other.property.firmament" },
            "3": { "name": "punctuation.separator.key-value.firmament" }
          }
        }
      ]
    },
    "dimensions": {
      "patterns": [
        {
          "name": "constant.numeric.dimension.firmament",
          "match": "(?<![A-Za-z0-9_])[-+]?(?:\\d+(?:\\.\\d*)?|\\.\\d+)(?:mm(?:\\^3)?|deg)\\b"
        }
      ]
    },
    "numbers": {
      "patterns": [
        { "name": "constant.numeric.firmament", "match": "(?<![A-Za-z0-9_])[-+]?(?:\\d+(?:\\.\\d*)?|\\.\\d+)\\b" }
      ]
    },
    "constants": {
      "patterns": [
        {
          "name": "constant.language.firmament",
          "match": "\\b(?:ThroughAll|Top|Bottom|Blind|true|false|High|Cylindrical|Chamfer|Fillet|Stock|XY|YZ|XZ)\\b"
        },
        { "name": "constant.language.axis.firmament", "match": "(?<![A-Za-z0-9_])[+-][XYZ]\\b" }
      ]
    },
    "types": {
      "patterns": [
        {
          "name": "support.type.firmament",
          "match": "\\b(?:Length|Point2|Point3|Vector2|Vector3|Rect2|PlusMinus|ExactRolling|SphereSeamCompatibility)\\b"
        }
      ]
    },
    "members": {
      "patterns": [
        {
          "match": "(\\.)([A-Za-z_][A-Za-z0-9_]*)",
          "captures": {
            "1": { "name": "punctuation.accessor.firmament" },
            "2": { "name": "variable.other.member.firmament" }
          }
        },
        {
          "match": "\\b([A-Za-z_][A-Za-z0-9_]*)(?=\\s*\\()",
          "captures": { "1": { "name": "entity.name.function.firmament" } }
        }
      ]
    },
    "operators": { "patterns": [{ "name": "keyword.operator.firmament", "match": "\\|>|==|!=|<=|>=|=>|[=+\\-*/<>]" }] }
  }
}