Skip to content

Commit 491a834

Browse files
fadeevabalexr00
andauthored
Add Makefile tests for upgraded grammar: comma, comment, shebang (microsoft#154625)
Add Makefile tests for upgraded grammar: comma, comment, shebang. 1. Add comma separator for function calls and conditions. 2. Escaping a comment with an odd count of backslashes (\#, \\\#). 3. Match debian/rules files based on shebang. Co-authored-by: Alex Ross <[email protected]>
1 parent acd1db2 commit 491a834

File tree

2 files changed

+196
-0
lines changed

2 files changed

+196
-0
lines changed

extensions/vscode-colorize-tests/test/colorize-fixtures/makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,10 @@ var!=echo val
7777
var:=val \
7878
notvar=butval
7979
var:=$(val:.c=.o)
80+
var:=blah#comment
81+
var?=blah\#not_a_comment
82+
var:=blah\\#comment
83+
var!=blah\\\#not_a_comment
8084
8185
var-$(nested-var)=val
8286

extensions/vscode-colorize-tests/test/colorize-results/makefile.json

Lines changed: 192 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3527,6 +3527,198 @@
35273527
"hc_light": "string: #0F4A85"
35283528
}
35293529
},
3530+
{
3531+
"c": "var",
3532+
"t": "source.makefile variable.other.makefile",
3533+
"r": {
3534+
"dark_plus": "variable: #9CDCFE",
3535+
"light_plus": "variable: #001080",
3536+
"dark_vs": "default: #D4D4D4",
3537+
"light_vs": "default: #000000",
3538+
"hc_black": "variable: #9CDCFE",
3539+
"hc_light": "variable: #001080"
3540+
}
3541+
},
3542+
{
3543+
"c": ":=",
3544+
"t": "source.makefile punctuation.separator.key-value.makefile",
3545+
"r": {
3546+
"dark_plus": "default: #D4D4D4",
3547+
"light_plus": "default: #000000",
3548+
"dark_vs": "default: #D4D4D4",
3549+
"light_vs": "default: #000000",
3550+
"hc_black": "default: #FFFFFF",
3551+
"hc_light": "default: #292929"
3552+
}
3553+
},
3554+
{
3555+
"c": "blah",
3556+
"t": "source.makefile",
3557+
"r": {
3558+
"dark_plus": "default: #D4D4D4",
3559+
"light_plus": "default: #000000",
3560+
"dark_vs": "default: #D4D4D4",
3561+
"light_vs": "default: #000000",
3562+
"hc_black": "default: #FFFFFF",
3563+
"hc_light": "default: #292929"
3564+
}
3565+
},
3566+
{
3567+
"c": "#",
3568+
"t": "source.makefile comment.line.number-sign.makefile punctuation.definition.comment.makefile",
3569+
"r": {
3570+
"dark_plus": "comment: #6A9955",
3571+
"light_plus": "comment: #008000",
3572+
"dark_vs": "comment: #6A9955",
3573+
"light_vs": "comment: #008000",
3574+
"hc_black": "comment: #7CA668",
3575+
"hc_light": "comment: #515151"
3576+
}
3577+
},
3578+
{
3579+
"c": "comment",
3580+
"t": "source.makefile comment.line.number-sign.makefile",
3581+
"r": {
3582+
"dark_plus": "comment: #6A9955",
3583+
"light_plus": "comment: #008000",
3584+
"dark_vs": "comment: #6A9955",
3585+
"light_vs": "comment: #008000",
3586+
"hc_black": "comment: #7CA668",
3587+
"hc_light": "comment: #515151"
3588+
}
3589+
},
3590+
{
3591+
"c": "var",
3592+
"t": "source.makefile variable.other.makefile",
3593+
"r": {
3594+
"dark_plus": "variable: #9CDCFE",
3595+
"light_plus": "variable: #001080",
3596+
"dark_vs": "default: #D4D4D4",
3597+
"light_vs": "default: #000000",
3598+
"hc_black": "variable: #9CDCFE",
3599+
"hc_light": "variable: #001080"
3600+
}
3601+
},
3602+
{
3603+
"c": "?=",
3604+
"t": "source.makefile punctuation.separator.key-value.makefile",
3605+
"r": {
3606+
"dark_plus": "default: #D4D4D4",
3607+
"light_plus": "default: #000000",
3608+
"dark_vs": "default: #D4D4D4",
3609+
"light_vs": "default: #000000",
3610+
"hc_black": "default: #FFFFFF",
3611+
"hc_light": "default: #292929"
3612+
}
3613+
},
3614+
{
3615+
"c": "blah\\#not_a_comment",
3616+
"t": "source.makefile",
3617+
"r": {
3618+
"dark_plus": "default: #D4D4D4",
3619+
"light_plus": "default: #000000",
3620+
"dark_vs": "default: #D4D4D4",
3621+
"light_vs": "default: #000000",
3622+
"hc_black": "default: #FFFFFF",
3623+
"hc_light": "default: #292929"
3624+
}
3625+
},
3626+
{
3627+
"c": "var",
3628+
"t": "source.makefile variable.other.makefile",
3629+
"r": {
3630+
"dark_plus": "variable: #9CDCFE",
3631+
"light_plus": "variable: #001080",
3632+
"dark_vs": "default: #D4D4D4",
3633+
"light_vs": "default: #000000",
3634+
"hc_black": "variable: #9CDCFE",
3635+
"hc_light": "variable: #001080"
3636+
}
3637+
},
3638+
{
3639+
"c": ":=",
3640+
"t": "source.makefile punctuation.separator.key-value.makefile",
3641+
"r": {
3642+
"dark_plus": "default: #D4D4D4",
3643+
"light_plus": "default: #000000",
3644+
"dark_vs": "default: #D4D4D4",
3645+
"light_vs": "default: #000000",
3646+
"hc_black": "default: #FFFFFF",
3647+
"hc_light": "default: #292929"
3648+
}
3649+
},
3650+
{
3651+
"c": "blah\\\\",
3652+
"t": "source.makefile",
3653+
"r": {
3654+
"dark_plus": "default: #D4D4D4",
3655+
"light_plus": "default: #000000",
3656+
"dark_vs": "default: #D4D4D4",
3657+
"light_vs": "default: #000000",
3658+
"hc_black": "default: #FFFFFF",
3659+
"hc_light": "default: #292929"
3660+
}
3661+
},
3662+
{
3663+
"c": "#",
3664+
"t": "source.makefile comment.line.number-sign.makefile punctuation.definition.comment.makefile",
3665+
"r": {
3666+
"dark_plus": "comment: #6A9955",
3667+
"light_plus": "comment: #008000",
3668+
"dark_vs": "comment: #6A9955",
3669+
"light_vs": "comment: #008000",
3670+
"hc_black": "comment: #7CA668",
3671+
"hc_light": "comment: #515151"
3672+
}
3673+
},
3674+
{
3675+
"c": "comment",
3676+
"t": "source.makefile comment.line.number-sign.makefile",
3677+
"r": {
3678+
"dark_plus": "comment: #6A9955",
3679+
"light_plus": "comment: #008000",
3680+
"dark_vs": "comment: #6A9955",
3681+
"light_vs": "comment: #008000",
3682+
"hc_black": "comment: #7CA668",
3683+
"hc_light": "comment: #515151"
3684+
}
3685+
},
3686+
{
3687+
"c": "var",
3688+
"t": "source.makefile variable.other.makefile",
3689+
"r": {
3690+
"dark_plus": "variable: #9CDCFE",
3691+
"light_plus": "variable: #001080",
3692+
"dark_vs": "default: #D4D4D4",
3693+
"light_vs": "default: #000000",
3694+
"hc_black": "variable: #9CDCFE",
3695+
"hc_light": "variable: #001080"
3696+
}
3697+
},
3698+
{
3699+
"c": "!=",
3700+
"t": "source.makefile punctuation.separator.key-value.makefile",
3701+
"r": {
3702+
"dark_plus": "default: #D4D4D4",
3703+
"light_plus": "default: #000000",
3704+
"dark_vs": "default: #D4D4D4",
3705+
"light_vs": "default: #000000",
3706+
"hc_black": "default: #FFFFFF",
3707+
"hc_light": "default: #292929"
3708+
}
3709+
},
3710+
{
3711+
"c": "blah\\\\\\#not_a_comment",
3712+
"t": "source.makefile",
3713+
"r": {
3714+
"dark_plus": "default: #D4D4D4",
3715+
"light_plus": "default: #000000",
3716+
"dark_vs": "default: #D4D4D4",
3717+
"light_vs": "default: #000000",
3718+
"hc_black": "default: #FFFFFF",
3719+
"hc_light": "default: #292929"
3720+
}
3721+
},
35303722
{
35313723
"c": "var-",
35323724
"t": "source.makefile variable.other.makefile",

0 commit comments

Comments
 (0)