Browse files

add divider_line to sequence.pic. add left_side & right_side constant…

…s for drawing divider_line. updates to grammar, including adding a bunch of pic syntax
  • Loading branch information...
1 parent 50bfb43 commit a3c765076861372eb8f43675621c97c3b868b769 @lastobelus committed May 29, 2009
Showing with 192 additions and 9 deletions.
  1. +171 −9 Syntaxes/Sequence Macros For Pic.tmLanguage
  2. +11 −0 Templates/Sequence Macros.tmTemplate/sequence.pic
  3. +10 −0 info.plist
View
180 Syntaxes/Sequence Macros For Pic.tmLanguage
@@ -53,6 +53,10 @@
<key>include</key>
<string>#strings</string>
</dict>
+ <dict>
+ <key>include</key>
+ <string>#arguments</string>
+ </dict>
</array>
</dict>
<dict>
@@ -63,7 +67,7 @@
<key>1</key>
<dict>
<key>name</key>
- <string>keyword.object.constraints.sequence.pic</string>
+ <string>support.function.object.constraints.sequence.pic</string>
</dict>
<key>2</key>
<dict>
@@ -121,7 +125,7 @@
</dict>
</dict>
<key>match</key>
- <string>\b(active|inactive|complete)(\()(\w+)(\));</string>
+ <string>\b(active|inactive|complete|delete)(\()(\w+)(\));</string>
<key>name</key>
<string>meta.object.activation.sequence.pic</string>
</dict>
@@ -133,7 +137,7 @@
<key>1</key>
<dict>
<key>name</key>
- <string>keyword.comment.sequence.pic</string>
+ <string>support.function.comment.sequence.pic</string>
</dict>
<key>2</key>
<dict>
@@ -189,7 +193,7 @@
<key>1</key>
<dict>
<key>name</key>
- <string>keyword.message.sequence.pic</string>
+ <string>support.function.message.sequence.pic</string>
</dict>
<key>2</key>
<dict>
@@ -253,7 +257,7 @@
<key>1</key>
<dict>
<key>name</key>
- <string>keyword.control.sequence.pic</string>
+ <string>support.function.control.sequence.pic</string>
</dict>
<key>2</key>
<dict>
@@ -262,21 +266,67 @@
</dict>
</dict>
<key>match</key>
- <string>^\s*(step|async|sync)(\(\));</string>
+ <string>^\s*(step|async|sync|divider_line)(\(\));</string>
<key>name</key>
<string>meta.control.sequence.pic</string>
</dict>
<dict>
+ <key>begin</key>
+ <string>\b(begin_frame|end_frame)(\()(\w+),(\w+)</string>
+ <key>beginCaptures</key>
+ <dict>
+ <key>1</key>
+ <dict>
+ <key>name</key>
+ <string>support.function.message.sequence.pic</string>
+ </dict>
+ <key>2</key>
+ <dict>
+ <key>name</key>
+ <string>punctuation.definition.parameters.sequence.pic</string>
+ </dict>
+ <key>3</key>
+ <dict>
+ <key>name</key>
+ <string>variable.object.sequence.pic</string>
+ </dict>
+ <key>4</key>
+ <dict>
+ <key>name</key>
+ <string>variable.frame.name.sequence.pic</string>
+ </dict>
+ </dict>
+ <key>end</key>
+ <string>(\));</string>
+ <key>endCaptures</key>
+ <dict>
+ <key>1</key>
+ <dict>
+ <key>name</key>
+ <string>punctuation.definition.parameters.sequence.pic</string>
+ </dict>
+ </dict>
+ <key>name</key>
+ <string>meta.frame.sequence.pic</string>
+ <key>patterns</key>
+ <array>
+ <dict>
+ <key>include</key>
+ <string>#strings</string>
+ </dict>
+ </array>
+ </dict>
+ <dict>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
- <string>keyword.other.sequence.macro</string>
+ <string>support.function.other.sequence.macro</string>
</dict>
</dict>
<key>match</key>
- <string>^\s*(delete|object_constraint|begin_frame|end_frame|connect_to_comment)(.*?)(\));</string>
+ <string>^\s*(object_constraint|begin_frame|end_frame|connect_to_comment)(.*?)(\));</string>
<key>name</key>
<string>meta.object.other.sequence.pic</string>
</dict>
@@ -286,21 +336,129 @@
<key>1</key>
<dict>
<key>name</key>
+ <string>keyword.control.pic</string>
+ </dict>
+ </dict>
+ <key>match</key>
+ <string>\b(for|do|if|then|else)\b</string>
+ <key>name</key>
+ <string>meta.language.keywords.control.pic</string>
+ </dict>
+ <dict>
+ <key>captures</key>
+ <dict>
+ <key>1</key>
+ <dict>
+ <key>name</key>
+ <string>keyword.verbs.pic</string>
+ </dict>
+ </dict>
+ <key>match</key>
+ <string>\b(copy|move|line|arrow|circle|box)\b</string>
+ <key>name</key>
+ <string>meta.language.keywords.verbs.pic</string>
+ </dict>
+ <dict>
+ <key>captures</key>
+ <dict>
+ <key>1</key>
+ <dict>
+ <key>name</key>
+ <string>keyword.position.pic</string>
+ </dict>
+ </dict>
+ <key>match</key>
+ <string>\b(up|down|left|right|from|to|at|with)\b</string>
+ <key>name</key>
+ <string>meta.language.keywords.position.pic</string>
+ </dict>
+ <dict>
+ <key>captures</key>
+ <dict>
+ <key>1</key>
+ <dict>
+ <key>name</key>
<string>support.constant.keywords.pic</string>
</dict>
</dict>
<key>match</key>
- <string>\b(copy|up|ht|wid|move)\b</string>
+ <string>\b(start|end|ht|wid|movewid|moveht|boxwid|boxht|awid|invisible|invis|dashed|fill|ljust|rjust)\b</string>
<key>name</key>
<string>meta.language.keywords.pic</string>
</dict>
<dict>
+ <key>captures</key>
+ <dict>
+ <key>1</key>
+ <dict>
+ <key>name</key>
+ <string>support.constant.keywords.coordinates.pic</string>
+ </dict>
+ </dict>
+ <key>match</key>
+ <string>\b(s|e|w|n|se|ne|sw|nw|x|y)\b</string>
+ <key>name</key>
+ <string>meta.language.keywords.coordinates.pic</string>
+ </dict>
+ <dict>
+ <key>captures</key>
+ <dict>
+ <key>1</key>
+ <dict>
+ <key>name</key>
+ <string>keyword.definition.pic</string>
+ </dict>
+ <key>2</key>
+ <dict>
+ <key>name</key>
+ <string>entity.definition.object.pic</string>
+ </dict>
+ </dict>
+ <key>match</key>
+ <string>\b(define|object)\b (\w+)</string>
+ <key>name</key>
+ <string>meta.language.definition.pic</string>
+ </dict>
+ <dict>
+ <key>captures</key>
+ <dict>
+ <key>1</key>
+ <dict>
+ <key>name</key>
+ <string>support.special.constants.pic</string>
+ </dict>
+ </dict>
+ <key>match</key>
+ <string>\b(Here|last)\b</string>
+ <key>name</key>
+ <string>meta.language.special.constants.pic</string>
+ </dict>
+ <dict>
<key>include</key>
<string>#strings</string>
</dict>
+ <dict>
+ <key>include</key>
+ <string>#arguments</string>
+ </dict>
</array>
<key>repository</key>
<dict>
+ <key>arguments</key>
+ <dict>
+ <key>captures</key>
+ <dict>
+ <key>1</key>
+ <dict>
+ <key>name</key>
+ <string>variable.argument.positional.pic</string>
+ </dict>
+ </dict>
+ <key>match</key>
+ <string>(?&lt;!\\)(\$\d+)</string>
+ <key>name</key>
+ <string>meta.language.argument.positional.pic</string>
+ </dict>
<key>strings</key>
<dict>
<key>begin</key>
@@ -317,6 +475,10 @@
<key>name</key>
<string>meta.preprocessor.font.command.pic</string>
</dict>
+ <dict>
+ <key>include</key>
+ <string>#arguments</string>
+ </dict>
</array>
</dict>
</dict>
View
11 Templates/Sequence Macros.tmTemplate/sequence.pic
@@ -38,6 +38,8 @@ comment_default_wid=1;
# Comment dash size
comment_dash=0.02
+left_side = Here.x
+right_side = Here.x
# Create a new object(name,label)
define object {
$1: box fill 0.5 $2; move;
@@ -53,6 +55,7 @@ define object {
# > 1: nested : draw nested swimlane
active_$1 = 0;
lifestart_$1 = $1.s.y;
+ right_side = $1.x + movewid/2
}
# Create a new external actor(name,label)
@@ -69,6 +72,7 @@ define actor {
move right;
active_$1 = 0;
lifestart_$1 = $1.s.y - .05;
+ right_side = $1.x + movewid/2
}
# Create a new placeholder object(name)
@@ -79,6 +83,7 @@ define placeholder_object {
move right;
active_$1 = 0;
lifestart_$1 = $1.s.y;
+ right_side = $1.x + movewid/2
}
define pobject {
@@ -406,3 +411,9 @@ define connect_to_comment {
# restore Here.y
move to ($1.x, old_y)
}
+
+define divider_line {
+ step();
+ line from (left_side, Here.y) to (right_side, Here.y) dashed
+ step();
+}
View
10 info.plist
@@ -16,6 +16,7 @@
<dict>
<key>items</key>
<array>
+ <string>3BF55CA7-9F20-4B81-915E-04DA04AD8F91</string>
<string>1F3E2FDD-51E3-4124-82DB-D9C186C14293</string>
<string>DC6A38C8-E162-418C-9191-5639534437EC</string>
<string>CC6083FA-BED7-40E3-8AAC-A86405255D80</string>
@@ -38,6 +39,7 @@
<array>
<string>1F3E2FDD-51E3-4124-82DB-D9C186C14293</string>
<string>DC6A38C8-E162-418C-9191-5639534437EC</string>
+ <string>3BF55CA7-9F20-4B81-915E-04DA04AD8F91</string>
<string>BAE81642-C055-4C1B-B84E-4C9418E2C6B6</string>
<string>129D65F4-14E0-4DB5-807E-A98806A0ED4A</string>
<string>7E198D7B-1C42-43F9-ABA0-97A7BA3EBE99</string>
@@ -48,6 +50,14 @@
<string>B0331DAD-83A7-441D-855F-1B45BDBCF307</string>
<string>94958EDE-759D-48B7-BC21-A2C8BBDC6E00</string>
<string>B3E8955D-CB86-4115-AAA3-E8B462660DB9</string>
+ <string>C3D934E5-EC94-4B12-AFBD-D5E2B87CD65B</string>
+ <string>75CFC13A-3E1F-45D2-8D9A-D1A856DE2218</string>
+ <string>3A1AAE1A-5996-440F-96C1-B60011D6AE99</string>
+ <string>24F423DE-59E6-4746-AC0E-7730BAAABC0A</string>
+ <string>D8028016-C179-47E5-9245-141420E299E1</string>
+ <string>B75BD8C0-22AC-42D4-B168-54C17E304F1C</string>
+ <string>267F1D96-8C4D-42CC-8215-A4A5825F543A</string>
+ <string>CC6083FA-BED7-40E3-8AAC-A86405255D80</string>
</array>
<key>uuid</key>
<string>E6B9F761-FCE0-4F52-8A98-5DE6C084026E</string>

0 comments on commit a3c7650

Please sign in to comment.