Skip to content
Permalink
Browse files

Add thrift language (#358)

  • Loading branch information...
dtolnay authored and XAMPPRocky committed Aug 29, 2019
1 parent b028933 commit d8888438f89a18b9740d6049fdd42718880dbf78
Showing with 54 additions and 0 deletions.
  1. +16 −0 languages.json
  2. +38 −0 tests/data/thrift.thrift
@@ -1635,6 +1635,22 @@
"txt"
]
},
"Thrift":{
"line_comment":[
"#",
"//"
],
"multi_line":[
["/*", "*/"]
],
"quotes":[
["\\\"", "\\\""],
["'", "'"]
],
"extensions":[
"thrift"
]
},
"Toml":{
"name":"TOML",
"base":"hash",
@@ -0,0 +1,38 @@
// 38 lines 29 code 2 comments 7 blanks

namespace java test
namespace py test

/* /* */
service Twitter extends core.BaseService {
void ping(),

bool postTweet(1: Tweet tweet) throws (1: TwitterUnavailable unavailable),

TweetSearchResult searchTweets(1: string query),
}

enum TweetType {
TWEET, # 1 /*
RETWEET = 2, // 2
DM = 0xa, // 3 */
REPLY
}

struct Tweet {
1: required i32 userId,
2: required string userName = "/*",
3: required string text = '...',
4: optional Location loc,
5: optional TweetType tweetType = TweetType.TWEET,
16: optional string language = "en\"glish", // */
}
const string TEST1 = // "
"starts here,
test/*
test" // a quote: "
const string TEST2 = /* " */
'starts here,
test,*/
test' # another quote: "

0 comments on commit d888843

Please sign in to comment.
You can’t perform that action at this time.