Skip to content

Commit cb7a996

Browse files
committed
Syntax support for block (triple-quoted) strings
Closes #14
1 parent 1232307 commit cb7a996

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

syntax/graphql.vim

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ syn keyword graphqlBoolean true false
1717
syn keyword graphqlNull null
1818
syn match graphqlNumber "-\=\<\%(0\|[1-9]\d*\)\%(\.\d\+\)\=\%([eE][-+]\=\d\+\)\=\>"
1919
syn region graphqlString start=+"+ skip=+\\\\\|\\"+ end=+"\|$+
20+
syn region graphqlString start=+"""+ end=+"""+
2021

2122
syn keyword graphqlKeyword on nextgroup=graphqlType skipwhite
2223

test/syntax.vader

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,13 @@ Execute (Boolean assertions):
3939
Given graphql (Strings):
4040
""
4141
"Hello World"
42+
"""Triple-quoted
43+
string"""
4244

4345
Execute (String assertions):
4446
AssertEqual 'graphqlString', SyntaxOf('""')
4547
AssertEqual 'graphqlString', SyntaxOf('"Hello World"')
48+
AssertEqual 'graphqlString', SyntaxOf('"""Triple-quoted\nstring"""')
4649

4750
# https://facebook.github.io/graphql/#sec-Type-Conditions
4851
Given graphql (Type Conditions):

0 commit comments

Comments
 (0)