From 284735f6bf1bba543b5c320c4d23a03810fda2a3 Mon Sep 17 00:00:00 2001 From: kn1kn1 Date: Sat, 17 Jan 2015 21:48:21 +0900 Subject: [PATCH] Merge cfdg3 grammars and snippets --- README.md | 5 +- grammars/context free.cson | 541 ++++++++++++++++++ snippets/language-context-free.cson | 833 ++++++++++++++++++++++++++++ spec/fixtures/welcome.cfdg | 119 ++++ 4 files changed, 1496 insertions(+), 2 deletions(-) create mode 100644 spec/fixtures/welcome.cfdg diff --git a/README.md b/README.md index 6393404..d325f97 100644 --- a/README.md +++ b/README.md @@ -3,12 +3,13 @@ Adds syntax highlighting and snippets to Context Free files in Atom. Originally [converted](http://atom.io/docs/latest/converting-a-text-mate-bundle) -from the [Context Free TextMate bundle](https://github.com/textmate/context-free.tmbundle). +from the [Context Free TextMate bundle](https://github.com/textmate/context-free.tmbundle) +and the [Context Free 3 Bundle for TextMate 1.x](https://github.com/Royaljerry/cfdg-3-bundle-for-textmate-1-x). Contributions are greatly appreciated. Please fork this repository and open a pull request to add snippets, make grammar tweaks, etc. -## Rendering (OSX and Linux) +## Rendering (OS X and Linux) If you have cfdg (Context Free Command-Line Version), you can render Context Free files. diff --git a/grammars/context free.cson b/grammars/context free.cson index 0b90a56..f449a60 100644 --- a/grammars/context free.cson +++ b/grammars/context free.cson @@ -3,7 +3,10 @@ 'context free' ] 'name': 'Context Free' + 'patterns': [ + # converted from Context Free TextMate bundle + # https://github.com/textmate/context-free.tmbundle { 'include': '#comment' } @@ -19,8 +22,92 @@ { 'include': '#rule-directive' } + + # converted from Context Free 3 Bundle for TextMate 1.x + # https://github.com/Royaljerry/cfdg-3-bundle-for-textmate-1-x + { + include: "#declaration-shape" + } + { + include: "#declaration-path" + } + { + include: "#declaration-expr" + } + { + include: "#import" + } + { + include: "#startshape" + } + { + include: "#comments" + } + { + include: "#fields" + } + { + include: "#chapter-main" + } + { + include: "#chapter-sub" + } + { + include: "#numbers" + } + { + include: "#operators" + } + { + include: "#controls" + } + { + include: "#types" + } + { + include: "#directives" + } + { + include: "#productions" + } + { + include: "#terminals" + } + { + include: "#pathoperations" + } + { + include: "#cf" + } + { + include: "#expressions" + } + { + include: "#adjustments" + } + { + include: "#loop" + } + { + include: "#replacement" + } + { + include: "#variable" + } + { + include: "#section-argument" + } + { + include: "#section-adjustment" + } + { + include: "#section-compound" + } ] + 'repository': + # converted from Context Free TextMate bundle + # https://github.com/textmate/context-free.tmbundle 'background-directive': 'begin': '\\b(background)' 'beginCaptures': @@ -280,4 +367,458 @@ '2': 'name': 'entity.name.function.rule.cfdg' 'match': '\\b(startshape)\\s++([a-zA-Z_][a-zA-Z_\\.\\d]*+)' + + # converted from Context Free 3 Bundle for TextMate 1.x + # https://github.com/Royaljerry/cfdg-3-bundle-for-textmate-1-x + "adj-color": + match: "\\||\\b(h(ue)?|sat(uration)?|b(rightness)?|a(lpha)?)\\b" + name: "entity.other.attribute-name.adjustment.color.cfdg" + "adj-geometry": + match: "\\b(x|y|z|s(ize)?|r(ot(ate)?)?|f(lip)?|skew|trans(form)?)\\b" + name: "entity.other.attribute-name.adjustment.geometry.cfdg" + "adj-time": + match: "\\||\\b((time)scale?)\\b" + name: "entity.other.attribute-name.adjustment.time.cfdg" + adjustments: + name: "entity.other.attribute-name.adjustment.cfdg" + patterns: [ + { + include: "#adj-geometry" + } + { + include: "#adj-color" + } + { + include: "#adj-time" + } + ] + cf: + name: "entity.name.section.cf.cfdg" + patterns: [ + { + include: "#cf-configuration" + } + { + include: "#cf-symmetry" + } + { + include: "#cf-flag" + } + ] + "cf-configuration": + captures: + "1": + name: "variable.parameter.cf.prefix.cfdg" + "2": + name: "variable.parameter.cf.name.configuration.cfdg" + match: "\\b(CF::)(AllowOverlap|Alpha|Background|BorderDynamic|BorderFixed|Color|ColorDepth|Frame|FrameTime|MaxNatural|MinimumSize|Size|Symmetry|Tile|Time)\\b" + name: "entity.name.section.cf.configuration.cfdg" + "cf-flag": + captures: + "1": + name: "variable.parameter.cf.prefix.cfdg" + "2": + name: "variable.parameter.cf.name.flag.cfdg" + match: "\\b(CF::)(Align|ArcCW|ArcLarge|BevelJoin|ButtCap|Continuous|EvenOdd|IsoWidth|MiterJoin|RoundCap|RoundJoin|SquareCap)\\b" + name: "entity.name.section.cf.flag.cfdg" + "cf-symmetry": + captures: + "1": + name: "variable.parameter.cf.prefix.cfdg" + "2": + name: "variable.parameter.cf.name.symmetry.cfdg" + match: "\\b(CF::)(Cyclic|Dihedral|cm|cmm|p3|p3m1|p31m|p6|p6m|pg|pmm|pgg|pmg|pm|p1m1|p2|p2mm|p2mg|p4|p4m|p4g|p11g|p11m)\\b" + name: "entity.name.section.cf.symmetry.cfdg" + "chapter-main": + captures: + "2": + name: "comment.other.chapter.main.name.cfdg" + match: "([ \\t]*\\*[ \\t]*#[ \\t]*)([^#\\n]*)( [ \\t]*#)" + name: "comment.other.chapter.main.cfdg" + "chapter-sub": + captures: + "2": + name: "comment.other.chapter.sub.name.cfdg" + match: "([ \\t]*\\*[ \\t]*---[ \\t]*)([^\\n]*)( [ \\t]*---)" + name: "comment.other.chapter.sub.cfdg" + comments: + patterns: [ + { + begin: "(^[ \\t]+)?(?=#)" + beginCaptures: + "1": + name: "punctuation.whitespace.comment.leading.cfdg" + end: "(?!\\G)" + patterns: [ + { + begin: "#" + beginCaptures: + "0": + name: "punctuation.definition.comment.cfdg" + end: "$" + name: "comment.line.number-sign.cfdg" + patterns: [ + { + include: "#fields" + } + ] + } + ] + } + { + begin: "(^[ \\t]+)?(?=//)" + beginCaptures: + "1": + name: "punctuation.whitespace.comment.leading.cfdg" + end: "(?!\\G)" + patterns: [ + { + begin: "//" + beginCaptures: + "0": + name: "punctuation.definition.comment.cfdg" + end: "$" + name: "comment.line.double-slash.cfdg" + patterns: [ + { + include: "#fields" + } + ] + } + ] + } + { + begin: "(/\\*)" + beginCaptures: + "1": + name: "punctuation.definition.comment.begin.cfdg" + end: "(\\*/)" + endCaptures: + "1": + name: "punctuation.definition.comment.end.cfdg" + name: "comment.block.cfdg" + patterns: [ + { + include: "#fields" + } + { + include: "#chapter-main" + } + { + include: "#chapter-sub" + } + ] + } + ] + controls: + match: "\\b(loop|if|switch|case|else|finally|transform)\\b" + name: "keyword.control.cfdg" + "declaration-expr": + captures: + "1": + name: "entity.name.section.declaration-expr.name.cfdg" + "2": + name: "entity.name.section.declaration-expr.params.cfdg" + patterns: [ + { + include: "#types" + } + { + include: "#comments" + } + { + include: "#fields" + } + ] + match: "\\b([a-zA-Z_][a-zA-Z_\\-\\.\\d]*+)\\b\\s*\\(([^\\(\\)]*+)\\)\\s*=" + name: "entity.name.section.declaration-expr.cfdg" + "declaration-path": + captures: + "1": + name: "entity.name.section.declaration-prod.type.cfdg" + "2": + name: "entity.name.section.declaration-prod.name.cfdg" + match: "\\b(path)\\b\\s++([a-zA-Z_][a-zA-Z_\\-\\.\\d]*)" + name: "entity.name.section.declaration-prod.path.cfdg" + "declaration-shape": + captures: + "1": + name: "entity.name.section.declaration-prod.type.cfdg" + "2": + name: "entity.name.section.declaration-prod.name.cfdg" + match: "\\b(shape)\\b\\s++([a-zA-Z_][a-zA-Z_\\-\\.\\d]*)" + name: "entity.name.section.declaration-prod.shape.cfdg" + directives: + match: "\\b(import|startshape)\\b" + name: "keyword.other.directive.cfdg" + "exp-animation": + match: "\\b(frame|ftime)\\b" + name: "entity.name.function.expression.animation.cfdg" + "exp-binary": + match: "\\b(bitand|bitleft|bitnot|bitor|bitright|bitxor)\\b" + name: "entity.name.function.expression.binary.cfdg" + "exp-constants": + match: "\\b(infinity)\\b" + name: "entity.name.function.expression.constants.cfdg" + "exp-exponential": + match: "\\b(exp|log|log10|sqrt)\\b" + name: "entity.name.function.expression.exponential.cfdg" + "exp-hyperbolic": + match: "\\b(acosh|asinh|atanh|cosh|sinh|tanh)\\b" + name: "entity.name.function.expression.hyperbolic.cfdg" + "exp-integer": + match: "\\b(div|divides|factorial|floor|isNatural|mod)\\b" + name: "entity.name.function.expression.integer.cfdg" + "exp-random": + match: "\\b(rand|randint|rand_static)\\b" + name: "entity.name.function.expression.random.cfdg" + "exp-trigonometry": + match: "\\b(acos|asin|atan|atan2|cos|sin|tan)\\b" + name: "entity.name.function.expression.trigonometry.cfdg" + "exp-value": + match: "\\b(abs|if|let|max|min|select|sg)\\b" + name: "entity.name.function.expression.value.cfdg" + expressions: + name: "entity.name.function.expression.cfdg" + patterns: [ + { + include: "#exp-trigonometry" + } + { + include: "#exp-hyperbolic" + } + { + include: "#exp-exponential" + } + { + include: "#exp-integer" + } + { + include: "#exp-constants" + } + { + include: "#exp-binary" + } + { + include: "#exp-random" + } + { + include: "#exp-animation" + } + { + include: "#exp-value" + } + ] + fields: + captures: + "1": + name: "punctuation.definition.field.begin.cfdg" + "2": + name: "punctuation.definition.field.content.cfdg" + "3": + name: "punctuation.definition.field.end.cfdg" + match: "(«)([^«»\\n]*)(»)" + name: "markup.other.field.cfdg" + import: + captures: + "1": + name: "keyword.control.directive.import.cfdg" + "2": + name: "string.unquoted.file-name.cfdg" + match: "\\b(import)\\s++(\".*\"|\\S++)" + name: "entity.name.section.import.cfdg" + numbers: + captures: + "1": + name: "keyword.operator.sign.cfdg" + "4": + name: "punctuation.separator.integer-float.cfdg" + match: "\\b(\\+|\\-)?((\\d++)?(\\.))?\\d++\\b" + name: "constant.numeric.cfdg" + operators: + match: "(\\^|\\-|\\*|/|\\+|\\-\\-|\\.\\.|…|\\+\\-|±|<|>|<=|≤|>=|≥|\\=\\=|\\=|<>|≠|\\&\\&|\\|\\||\\^\\^)" + name: "keyword.operator.cfdg" + pathoperations: + match: "\\b(ARCREL|ARCTO|CLOSEPOLY|CURVEREL|CURVETO|FILL|LINEREL|LINETO|MOVEREL|MOVETO|STROKE)\\b" + name: "keyword.other.pathoperation.cfdg" + productions: + match: "\\b(shape|rule|path)\\b" + name: "keyword.other.production.cfdg" + replacement: + captures: + "1": + name: "entity.name.function.replacement.cfdg" + match: "\\b([a-zA-Z_][a-zA-Z_\\-\\.\\d]*+)\\s*(\\(|\\[)" + name: "entity.name.section.replacement.cfdg" + "section-adjustment": + name: "entity.name.section.adjustment.unordered.cfdg" + patterns: [ + { + begin: "(\\[)" + beginCaptures: + "1": + name: "entity.name.section.adjustment.unordered.begin.cfdg" + end: "(?=\\])" + endCaptures: + "1": + name: "entity.name.section.adjustment.unordered.end.cfdg" + patterns: [ + { + include: "#comments" + } + { + include: "#fields" + } + { + include: "#numbers" + } + { + include: "#operators" + } + { + include: "#expressions" + } + { + include: "#adjustments" + } + ] + } + ] + "section-argument": + name: "entity.name.section.argument.cfdg" + patterns: [ + { + begin: "(\\()" + beginCaptures: + "1": + name: "entity.name.section.block.argument.begin.cfdg" + end: "(?=\\))" + endCaptures: + "1": + name: "entity.name.section.block.argument.end.cfdg" + patterns: [ + { + include: "#comments" + } + { + include: "#fields" + } + { + include: "#numbers" + } + { + include: "#operators" + } + { + include: "#types" + } + { + include: "#expressions" + } + { + include: "#cf" + } + ] + } + ] + "section-compound": + begin: "(\\{)" + beginCaptures: + "1": + name: "entity.name.section.compound.begin.cfdg" + end: "(?=\\})" + endCaptures: + "1": + name: "entity.name.section.compound.end.cfdg" + name: "entity.name.section.compound.cfdg" + patterns: [ + { + include: "#comments" + } + { + include: "#fields" + } + { + include: "#numbers" + } + { + include: "#operators" + } + { + include: "#controls" + } + { + include: "#types" + } + { + include: "#directives" + } + { + include: "#productions" + } + { + include: "#terminals" + } + { + include: "#pathoperations" + } + { + include: "#cf" + } + { + include: "#expressions" + } + { + include: "#adjustments" + } + { + include: "#import" + } + { + include: "#startshape" + } + { + include: "#loop" + } + { + include: "#replacement" + } + { + include: "#variable" + } + { + include: "#section-argument" + } + { + include: "#section-adjustment" + } + ] + startshape: + captures: + "1": + name: "keyword.control.directive.startshape.cfdg" + "2": + name: "entity.name.function.startshape.cfdg" + "4": + name: "punctuation.definition.parameters.begin.cfdg" + "5": + name: "variable.parameter.production.cfdg" + "6": + name: "punctuation.definition.parameters.end.cfdg" + match: "\\b(startshape)\\s++([a-zA-Z_][a-zA-Z_\\.\\d]*+)((\\()(.*?)(\\)))*" + name: "entity.name.section.startshape.cfdg" + terminals: + match: "\\b(SQUARE|CIRCLE|TRIANGLE)\\b" + name: "keyword.other.terminal.cfdg" + types: + match: "\\b(number|natural|vector[2-9]|trans)\\b" + name: "storage.type.cfdg" + variable: + captures: + "1": + name: "variable.other.name.cfdg" + match: "\\b([a-zA-Z_][a-zA-Z_\\-\\.\\d]*+)\\s*=" + name: "variable.other.cfdg" + + 'scopeName': 'source.context-free' diff --git a/snippets/language-context-free.cson b/snippets/language-context-free.cson index 8da2f6b..698d981 100644 --- a/snippets/language-context-free.cson +++ b/snippets/language-context-free.cson @@ -1,4 +1,6 @@ '.source.context-free': + # converted from Context Free TextMate bundle + # https://github.com/textmate/context-free.tmbundle 'Background Directive': 'prefix': 'b' 'body': 'background {$1}' @@ -20,3 +22,834 @@ 'Triangle Primitive': 'prefix': 'T' 'body': 'TRIANGLE {$1}' + + # converted from Context Free 3 Bundle for TextMate 1.x + # https://github.com/Royaljerry/cfdg-3-bundle-for-textmate-1-x + "Absolute Signum": + prefix: "exv" + body: "sg(${1:«NUMBER»})" + "Absolute Value": + prefix: "exv" + body: "abs(${1:«NUMBER»})" + Adjustment: + prefix: "t" + body: "trans ${1:«PARAMETER NAME»}" + "Alba Typeface": + prefix: "import" + body: "import \"../../../../Library/net/royaljerry/${1:«VER»}/typography/typefaces/alba.cfdg\"$0" + Align: + prefix: "pfa" + body: "CF::Align" + AllowOverlap: + prefix: "con" + body: "CF::AllowOverlap = ${1:«NUMBER»}" + Alpha: + prefix: "con" + body: "CF::Alpha = ${1:«NUMBER»}" + And: + prefix: "exb" + body: "bitand(${1:«NUMBER 1»}, ${2:«NUMBER 2»})" + "App Header": + prefix: "c" + body: ''' + /** + * ${1:«APPLICATION NAME»} + * + * -------------------------------------------------- + * + * ${2:«DESCRIPTION»} + * + * Dependency: ${3:«LIBRARY NAME»} + * + * Context Free v3 Programming + * © ${4:«YEAR»} ${TM_AUTHOR_NAME} + * ${TM_AUTHOR_EMAIL} + * ${TM_AUTHOR_URL} + * + * ToDo + * ---- + * + * «TODO ITEM» + */ + $0 + ''' + "Arc Rel [Circle]": + prefix: "arc" + body: "ARCREL(${1:«X»}, ${2:«Y»}, ${3:«RADIUS»}${4:, ${5:«FLAGS ('pfa')»}})" + "Arc Rel [Ellipse]": + prefix: "arc" + body: "ARCREL(${1:«X»}, ${2:«Y»}, ${3:«X RADIUS»}, ${4:«Y RADIUS»}, ${5:«ELLIPSE ANGLE»}${6:, ${7:«FLAGS ('pfa')»}})" + "Arc To [Circle]": + prefix: "arc" + body: "ARCTO(${1:«X»}, ${2:«Y»}, ${3:«RADIUS»}${4:, ${5:«FLAGS ('pfa')»}})" + "Arc To [Ellipse]": + prefix: "arc" + body: "ARCTO(${1:«X»}, ${2:«Y»}, ${3:«X RADIUS»}, ${4:«Y RADIUS»}, ${5:«ELLIPSE ANGLE»}${6:, ${7:«FLAGS ('pfa')»}})" + "Arc-Cosine": + prefix: "ext" + body: "acos(${1:«NUMBER»})" + "Arc-Sine": + prefix: "ext" + body: "asin(${1:«NUMBER»})" + "Arc-Tangent of Y/X": + prefix: "ext" + body: "atan2(${1:«NUMBER 1 (Y)»}, ${2:«NUMBER 2 (X)»})" + "Arc-Tangent": + prefix: "ext" + body: "atan(${1:«NUMBER»})" + ArcCW: + prefix: "pfa" + body: "CF::ArcCW" + ArcLarge: + prefix: "pfa" + body: "CF::ArcLarge" + "Argument Header": + prefix: "c" + body: " * ARGUMENT TYPE DESCRIPTION" + Background: + prefix: "con" + body: "CF::Background = ${1:«ADJUSTMENT ('col' or 'h', 'sat', 'b', 'a')»}" + "Based On": + prefix: "c" + body: ''' + * Based on the script by ${1:«NAME»} + * taken from ${2:«URL»} + ''' + BevelJoin: + prefix: "pfs" + body: "CF::BevelJoin" + "Black [For Adjustment]": + prefix: "col" + body: "h 0 sat 0 b 0 a 100" + "Black [For Vector]": + prefix: "col" + body: "0, 0, 0, 100" + BorderDynamic: + prefix: "con" + body: "CF::BorderDynamic = ${1:«NUMBER»}" + BorderFixed: + prefix: "con" + body: "CF::BorderFixed = ${1:«NUMBER»}" + Brightness: + prefix: "b" + body: "b ${1:«BRIGHTNESS»}" + ButtCap: + prefix: "pfs" + body: "CF::ButtCap" + "Case [Compound]": + prefix: "case" + body: ''' + case ${1:«CASE»}: + { + $0 + } + ''' + "Case [Simple]": + prefix: "case" + body: "case ${1:«CASE»}: $0" + Circle: + prefix: "ci" + body: "CIRCLE[${1:«ADJUSTMENT»}]" + "Close Poly": + prefix: "close" + body: "CLOSEPOLY(${1:«CF::Align»})" + Color: + prefix: "import" + body: "import \"../../../../Library/net/royaljerry/${1:«VER»}/standard/color.cfdg\"$0" + ColorDepth: + prefix: "con" + body: "CF::ColorDepth = ${1:«NUMBER»}" + Continuous: + prefix: "pfa" + body: "CF::Continuous" + Cosine: + prefix: "ext" + body: "cos(${1:«NUMBER»})" + "Curve Rel (Cubic with Own CP)": + prefix: "curve" + body: "CURVEREL(${1:«X»}, ${2:«Y»}, ${3:«X1»}, ${4:«Y1»}, ${5:«X2»}, ${6:«Y2»})" + "Curve Rel (Cubic with Previous CP)": + prefix: "curve" + body: "CURVEREL(${1:«X»}, ${2:«Y»}, ${3:«X2»}, ${4:«Y2»}${5:, ${6:«CF::Continuous»}})" + "Curve Rel (Quadratic with Own CP)": + prefix: "curve" + body: "CURVEREL(${1:«X»}, ${2:«Y»}, ${3:«X1»}, ${4:«Y1»})" + "Curve Rel (Quadratic with Previous CP)": + prefix: "curve" + body: "CURVEREL(${1:«X»}, ${2:«Y»}${3:, ${4:«CF::Continuous»}})" + "Curve To (Cubic with Own CP)": + prefix: "curve" + body: "CURVETO(${1:«X»}, ${2:«Y»}, ${3:«X1»}, ${4:«Y1»}, ${5:«X2»}, ${6:«Y2»})" + "Curve To (Cubic with Previous CP)": + prefix: "curve" + body: "CURVETO(${1:«X»}, ${2:«Y»}, ${3:«X2»}, ${4:«Y2»}${5:, ${6:«CF::Continuous»}})" + "Curve To (Quadratic with Own CP)": + prefix: "curve" + body: "CURVETO(${1:«X»}, ${2:«Y»}, ${3:«X1»}, ${4:«Y1»})" + "Curve To (Quadratic with Previous CP)": + prefix: "curve" + body: "CURVETO(${1:«X»}, ${2:«Y»}${3:, ${4:«CF::Continuous»}})" + Cyclic: + prefix: "sym" + body: "CF::Cyclic, ${1:«ORDER»}${2:, ${3:«CENTER X»}, ${4:«CENTER Y»}}" + "Decimal Logarithm": + prefix: "exe" + body: "log10(${1:«NUMBER»})" + Dependency: + prefix: "c" + body: " * Dependency: ${1:«DEPENDENCY»}" + Description: + prefix: "c" + body: " * Description: ${1:«DESCRIPTION»}" + "Detailed Description": + prefix: "c" + body: " * ${1:«DETAILED DESCRIPTION»}." + "Diamond: Axial [cm]": + prefix: "symwd" + body: "CF::cm, ${1:«MIRROR AXIS»}${2:, ${3:«AXIS POSITION»}}" + "Diamond: Central [cmm]": + prefix: "symwd" + body: "CF::cmm${1:, ${2:«CENTER X»}, ${3:«CENTER Y»}}" + Dihedral: + prefix: "sym" + body: "CF::Dihedral, ${1:«ORDER»}${2:, ${3:«MIRROR ANGLE»}${4:, ${5:«CENTER X»}, ${6:«CENTER Y»}}}" + "Divides?": + prefix: "exi" + body: "divides(${1:«NUMBER 1»}, ${2:«NUMBER 2»})" + "Division with Remainder": + prefix: "exi" + body: "div(${1:«NUMBER 1»}, ${2:«NUMBER 2»})" + "Dynamic Random Integer": + prefix: "exr" + body: "randint(${1:${2:«NUMBER 1»}${3:, ${4:«NUMBER 2»}}})" + "Dynamic Random Number": + prefix: "exr" + body: "rand(${1:${2:«NUMBER 1»}${3:, ${4:«NUMBER 2»}}})" + "Else [Compound]": + prefix: "else" + body: ''' + else : + { + $0 + } + ''' + "Else [Simple]": + prefix: "else" + body: "else : $0" + "Empty Adjustment": + prefix: "pp" + body: "[]" + "Empty Comment": + prefix: "c" + body: ''' + /** + * $0 + */ + ''' + EvenOdd: + prefix: "pff" + body: "CF::EvenOdd" + Exponent: + prefix: "exe" + body: "exp(${1:«NUMBER»})" + Factorial: + prefix: "exi" + body: "factorial(${1:«NUMBER»})" + Fill: + prefix: "fill" + body: "FILL(${1:«FLAGS ('pff')»})${2: [${3:«ADJUSTMENT ('col' or 'h', 'sat', 'b', 'a')»}]}" + Flip: + prefix: "f" + body: "f ${1:«FLIPPING AXIS»}" + Floor: + prefix: "exi" + body: "floor(${1:«NUMBER»})" + "Frame Number": + prefix: "exa" + body: "frame()" + Frame: + prefix: "con" + body: "CF::Frame = ${1:«NUMBER»}" + FrameTime: + prefix: "con" + body: "CF::FrameTime = ${1:«NUMBER»}" + "Free Argument": + prefix: "c" + body: " * ${1:«ARG»} ${2:«TYPE»} ${3:«DESCRIPTION»}" + "Full Header": + prefix: "c" + body: ''' + /** + * Description: ${1:«DESCRIPTION»} + * + ${2: * ${3:«DETAILED DESCRIPTION»}. + * + }${4: * Usage: ${5:«USAGE»} + * + }${6: * Dependency: ${7:«DEPENDENCY»} + * + }${8: * Based on the script by ${9:«NAME»} + * taken from ${10:«URL»} + * + }${11: * ARGUMENT TYPE DESCRIPTION + * + ${12: * ${13:«ARG»} ${14:«TYPE»} ${15:«DESCRIPTION»} + * + }}${16: * ToDo: ${17:«TODO»} + * ${18:«TODO»} + }*/ + $0 + ''' + Geometry: + prefix: "import" + body: "import \"../../../../Library/net/royaljerry/${1:«VER»}/standard/geometry.cfdg\"$0" + "Global ToDo Header": + prefix: "c" + body: ''' + * + * ToDo + * ---- + * + ''' + "Global ToDo Item": + prefix: "c" + body: " * ${1:«TODO ITEM»}" + Glyphs: + prefix: "import" + body: "import \"../../../../Library/net/royaljerry/${1:«VER»}/typography/glyphs.cfdg\"$0" + "Hexagonal: Central 1 [p3]": + prefix: "symwh" + body: "CF::p3${1:, ${2:«CENTER X»}, ${3:«CENTER Y»}}" + "Hexagonal: Central 2 [p3m1]": + prefix: "symwh" + body: "CF::p3m1${1:, ${2:«CENTER X»}, ${3:«CENTER Y»}}" + "Hexagonal: Central 3 [p31m]": + prefix: "symwh" + body: "CF::p31m${1:, ${2:«CENTER X»}, ${3:«CENTER Y»}}" + "Hexagonal: Central 4 [p6]": + prefix: "symwh" + body: "CF::p6${1:, ${2:«CENTER X»}, ${3:«CENTER Y»}}" + "Hexagonal: Central 5 [p6m]": + prefix: "symwh" + body: "CF::p6m${1:, ${2:«CENTER X»}, ${3:«CENTER Y»}}" + Hue: + prefix: "h" + body: "h ${1:«HUE»}" + "Hyperbolic Arc-Cosine": + prefix: "exh" + body: "acosh(${1:«NUMBER»})" + "Hyperbolic Arc-Sine": + prefix: "exh" + body: "asinh(${1:«NUMBER»})" + "Hyperbolic Arc-Tangent": + prefix: "exh" + body: "atanh(${1:«NUMBER»})" + "Hyperbolic Cosine": + prefix: "exh" + body: "cosh(${1:«NUMBER»})" + "Hyperbolic Sine": + prefix: "exh" + body: "sinh(${1:«NUMBER»})" + "Hyperbolic Tangent": + prefix: "exh" + body: "tanh(${1:«NUMBER»})" + "If [Compound]": + prefix: "if" + body: ''' + if (${1:«CONDITION»}) + { + ${2:«BODY»} + }${3: + else + { + ${4:«BODY»} + \}} + ''' + "If [Simple]": + prefix: "if" + body: "if (${1:«CONDITION»}) ${2:«BODY»}${3: else ${4:«BODY»}}" + If: + prefix: "exv" + body: "if(${1:«EXPRESSION»}, ${2:«IF TRUE»}, ${3:«IF FALSE»})" + Import: + prefix: "import" + body: "import \"${1:${2:«FILE»}.cfdg}\"" + Infinity: + prefix: "exc" + body: "infinity()" + "Is Natural?": + prefix: "exi" + body: "isNatural(${1:«NUMBER»})" + IsoWidth: + prefix: "pfs" + body: "CF::IsoWidth" + "Jump [p11m]": + prefix: "symf" + body: "CF::p11m${1:, ${2:«AXIS POSITION»}}" + Left: + prefix: "exb" + body: "bitleft(${1:«NUMBER 1»}, ${2:«NUMBER 2»})" + Let: + prefix: "exv" + body: "let(${1:«SEMICOLON SEPARATED 'VAR = EXPR' EXPRESSIONS»}; ${2:«EXPRESSION»})" + "Library Header": + prefix: "c" + body: ''' + /** + * ${1:«LIBRARY NAME»} library for Context Free v3.x + * v${2:«VER»} + * + * -------------------------------------------------- + * + * ${3:«DESCRIPTION»} + * + * Dependency: ${4:«LIBRARY NAME»} + * + * Context Free v3 Programming + * © ${5:«YEAR»} ${TM_AUTHOR_NAME} + * ${TM_AUTHOR_EMAIL} + * ${TM_AUTHOR_URL} + * + * ToDo + * ---- + * + * «TODO ITEM» + */ + $0 + + ''' + "Line Rel": + prefix: "line" + body: "LINEREL(${1:«X»}, ${2:«Y»})" + "Line To": + prefix: "line" + body: "LINETO(${1:«X»}, ${2:«Y»})" + "Loop [Compound, Anonymous]": + prefix: "loop" + body: ''' + loop ${1:«MAXIMUM»} [${2:«ADJUSTMENTS»}] + { + ${3:«BODY»} + }${4: + finally + { + ${5:«BODY»} + \}} + ''' + "Loop [Compound, Named]": + prefix: "loop" + body: ''' + loop ${1:«INDEX»} = ${2:«MAXIMUM»} [${3:«ADJUSTMENTS»}] + { + ${4:«BODY»} + }${5: + finally + { + ${6:«BODY»} + \}} + ''' + "Loop [Simple, Anonymous]": + prefix: "loop" + body: ''' + loop ${1:«MAXIMUM»} [${2:«ADJUSTMENTS»}] + ${3:«BODY»}${4: + finally + ${5:«BODY»}} + ''' + "Loop [Simple, Named]": + prefix: "loop" + body: ''' + loop ${1:«INDEX»} = ${2:«MAXIMUM»} [${3:«ADJUSTMENTS»}] + ${4:«BODY»}${5: + finally + ${6:«BODY»}} + ''' + "Main Chapter Header": + prefix: "c" + body: ''' + /** + * ################## + * # ${1:«CHAPTER NAME»} # + * ################## + */ + $0 + ''' + Math: + prefix: "import" + body: "import \"../../../../Library/net/royaljerry/${1:«VER»}/standard/math.cfdg\"$0" + MaxNatural: + prefix: "con" + body: "CF::MaxNatural = ${1:«NUMBER»}" + Maximum: + prefix: "exv" + body: "max(${1:«COMMA SEPARATED ARGUMENTS»})" + Minimum: + prefix: "exv" + body: "min(${1:«COMMA SEPARATED ARGUMENTS»})" + MinimumSize: + prefix: "con" + body: "CF::MinimumSize = ${1:«NUMBER»}" + MiterJoin: + prefix: "pfs" + body: "CF::MiterJoin" + Modulo: + prefix: "exi" + body: "mod(${1:«NUMBER 1»}, ${2:«NUMBER 2»})" + "Move Rel": + prefix: "move" + body: "MOVEREL(${1:«X»}, ${2:«Y»})" + "Move To": + prefix: "move" + body: "MOVETO(${1:«X»}, ${2:«Y»})" + "Natural Logarithm": + prefix: "exe" + body: "log(${1:«NUMBER»})" + Natural: + prefix: "t" + body: "natural ${1:«PARAMETER NAME»}" + "New Comment Line": + prefix: "c" + body: " * $0" + Not: + prefix: "exb" + body: "bitnot(${1:«NUMBER»})" + Number: + prefix: "t" + body: "number ${1:«PARAMETER NAME»}" + Or: + prefix: "exb" + body: "bitor(${1:«NUMBER 1»}, ${2:«NUMBER 2»})" + "Path [With No Headers]": + prefix: "pp" + body: ''' + path ${1:«PATH NAME»}${2:(${3:«ARGS»})} + { + ${0:«BODY»} + } + ''' + "Path [With Simple Header]": + prefix: "path" + body: ''' + /** + * Description: ${1:«DESCRIPTION»} + * + ${2: * ARGUMENT TYPE DESCRIPTION + * + ${3: * ${4:«ARG»} ${5:«TYPE»} ${6:«DESCRIPTION»} + * + } * + }*/ + path ${7:«PATH NAME»}${8:(${9:«ARGS»})} + { + ${0:«BODY»} + } + ${10:// Shortcuts for $7} + + ''' + "Rectangular: Glide Reflection [pg]": + prefix: "symwr" + body: "CF::pg, ${1:«GLIDE AXIS»}${2:, ${3:«AXIS POSITION»}}" + "Rectangular: Reflection Combo 1 [pmm]": + prefix: "symwr" + body: "CF::pmm${1:, ${2:«CENTER X»}, ${3:«CENTER Y»}}" + "Rectangular: Reflection Combo 2 [pgg]": + prefix: "symwr" + body: "CF::pgg${1:, ${2:«CENTER X»}, ${3:«CENTER Y»}}" + "Rectangular: Reflection Combo 3 [pmg]": + prefix: "symwr" + body: "CF::pmg, ${1:«MIRROR AXIS»}${2:, ${3:«CENTER X»}, ${4:«CENTER Y»}}" + "Rectangular: Simple Reflection [pm]": + prefix: "symwr" + body: "CF::pm, ${1:«MIRROR AXIS»}${2:, ${3:«AXIS POSITION»}}" + Replacement: + prefix: "re" + body: "${1:«RULE NAME»}${2:(${3:«ARGS»})}[${4:«ADJUSTMENT»}]" + "Restricted Argument": + prefix: "c" + body: ''' + * ${1:«ARG»} ${2:«TYPE»} ${3:«DESCRIPTION»} + * ALLOWED VALUES: + * ${4:«VAL»} ${5:«DESCRIPTION»} + ''' + Right: + prefix: "exb" + body: "bitright(${1:«NUMBER 1»}, ${2:«NUMBER 2»})" + Rotation: + prefix: "r" + body: "r ${1:«ROTATION»}" + RoundCap: + prefix: "pfs" + body: "CF::RoundCap" + RoundJoin: + prefix: "pfs" + body: "CF::RoundJoin" + "Rule [Compound]": + prefix: "rr" + body: ''' + ${1:// ${2:«DESCRIPTION»} + }rule${3: ${4:«WEIGHT»}} + { + ${0:«BODY»} + } + ''' + "Rule [Simple]": + prefix: "rr" + body: ''' + ${1:// ${2:«DESCRIPTION»} + }rule${3: ${4:«WEIGHT»}} {${0:«BODY»}} + ''' + Saturation: + prefix: "sat" + body: "sat ${1:«SATURATION»}" + Scale: + prefix: "s" + body: "s ${1:«SIZE EQUAL OR X»}${2: ${3:«SIZE Y»}${4: ${5:«SIZE Z»}}}" + Select: + prefix: "exv" + body: "select(${1:«EXPRESSION»}, ${2:«COMMA SEPARATED EXPRESSIONS»})" + "Shape [Compound with No Headers]": + prefix: "sh" + body: ''' + shape ${1:«SHAPE NAME»}${2:(${3:«ARGS»})} + { + ${0:«BODY»} + } + ''' + "Shape [Compound with Simple Header]": + prefix: "shape" + body: ''' + /** + * Description: ${1:«DESCRIPTION»} + * + ${2: * ARGUMENT TYPE DESCRIPTION + * + ${3: * ${4:«ARG»} ${5:«TYPE»} ${6:«DESCRIPTION»} + * + } * + }*/ + shape ${7:«SHAPE NAME»}${8:(${9:«ARGS»})} + { + ${0:«BODY»} + } + ${10:// Shortcuts for $7} + + ''' + "Shape [Compound]": + prefix: "shape" + body: ''' + /** + * Description: ${1:«DESCRIPTION»} + * + ${2: * ${3:«DETAILED DESCRIPTION»}. + * + }${4: * Usage: ${5:«USAGE»} + * + }${6: * Dependency: ${7:«DEPENDENCY»} + * + }${8: * Based on the script by ${9:«NAME»} + * taken from ${10:«URL»} + * + }${11: * ARGUMENT TYPE DESCRIPTION + * + ${12: * ${13:«ARG»} ${14:«TYPE»} ${15:«DESCRIPTION»} + * + }}${16: * ToDo: ${17:«TODO»} + * ${18:«TODO»} + }*/ + shape ${19:«SHAPE NAME»}${20:(${21:«ARGS»})} + { + ${0:«BODY»} + } + ${22:// Shortcuts for $19} + + ''' + "Shape [Simple]": + prefix: "shape" + body: ''' + /** + * Description: ${1:«DESCRIPTION»} + * + ${2: * ${3:«DETAILED DESCRIPTION»}. + * + }${4: * Usage: ${5:«USAGE»} + * + }${6: * Dependency: ${7:«DEPENDENCY»} + * + }${8: * Based on the script by ${9:«NAME»} + * taken from ${10:«URL»}. + * + }${11: * ARGUMENT TYPE DESCRIPTION + * + ${12: * ${13:«ARG»} ${14:«TYPE»} ${15:«DESCRIPTION»} + * + }}${16: * ToDo: ${17:«TODO»} + * ${18:«TODO»} + }*/ + shape ${19:«SHAPE NAME»}${20:(${21:«ARGS»})} + ${0:«REPLACEMENT»} + ${22:// Shortcuts for $19} + + ''' + Shortcuts: + prefix: "c" + body: ''' + // Shortcuts for ${1:«PRODUCTION NAME»} + $0 + ''' + "Sidle [p1m1]": + prefix: "symf" + body: "CF::p1m1${1:, ${2:«AXIS POSITION»}}" + "Signed Infinity": + prefix: "exc" + body: "infinity(${1:«NUMBER»})" + "Simple Header": + prefix: "c" + body: ''' + /** + * Description: ${1:«DESCRIPTION»} + * + ${2: * ARGUMENT TYPE DESCRIPTION + * + ${3: * ${4:«ARG»} ${5:«TYPE»} ${6:«DESCRIPTION»}} + }*/ + $0 + ''' + Sine: + prefix: "ext" + body: "sin(${1:«NUMBER»})" + Size: + prefix: "con" + body: "CF::Size = ${1: