1
- // Copyright (C) 2015 Google Inc.
2
- //
3
- // Licensed under the Apache License, Version 2.0 (the "License");
4
- // you may not use this file except in compliance with the License.
5
- // You may obtain a copy of the License at
6
- //
7
- // http://www.apache.org/licenses/LICENSE-2.0
8
- //
9
- // Unless required by applicable law or agreed to in writing, software
10
- // distributed under the License is distributed on an "AS IS" BASIS,
11
- // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- // See the License for the specific language governing permissions and
13
- // limitations under the License.
1
+ /**
2
+ * Copyright (C) 2015 Google Inc.
3
+ * Licensed under the Apache License, Version 2.0 (the "License");
4
+ * you may not use this file except in compliance with the License.
5
+ * You may obtain a copy of the License at
6
+ *
7
+ * http://www.apache.org/licenses/LICENSE-2.0
8
+ * Unless required by applicable law or agreed to in writing, software
9
+ * distributed under the License is distributed on an "AS IS" BASIS,
10
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
+ * See the License for the specific language governing permissions and
12
+ * limitations under the License.
13
+ */
14
14
15
15
/**
16
16
* @fileoverview
25
25
*
26
26
* I used https://developer.apple.com/library/ios/documentation/Swift/Conceptual/Swift_Programming_Language/AboutTheLanguageReference.html
27
27
* as the basis for this. In particular, I targeted the revision from
28
- * 2015-04-08. Swift is still evolving, and this was the latest version
28
+ * 2015-04-08. Swift is still evolving, and this was the latest version
29
29
* available at the time. I will keep the code unoptimized to ease changes that come with new Swift standards.
30
30
*
31
31
@@ -37,7 +37,7 @@ PR['registerLangHandler'](
37
37
//whitespace
38
38
[ PR [ 'PR_PLAIN' ] , / ^ [ \n \r \t \v \f \0 ] + / , null , ' \n\r\t\v\f\0' ] ,
39
39
//string literals
40
- [ PR [ 'PR_STRING' ] , / ^ " (?: [ ^ " \\ ] | (?: \\ .) | (?: \\ \( (?: [ ^ " \\ ) ] | \\ .) * \) ) ) * " / , null , '"' ] ,
40
+ [ PR [ 'PR_STRING' ] , / ^ " (?: [ ^ " \\ ] | (?: \\ .) | (?: \\ \( (?: [ ^ " \\ ) ] | \\ .) * \) ) ) * " / , null , '"' ]
41
41
] ,
42
42
[
43
43
//floating point literals
@@ -47,7 +47,7 @@ PR['registerLangHandler'](
47
47
//some other literals
48
48
[ PR [ 'PR_LITERAL' ] , / ^ (?: t r u e | f a l s e | n i l ) \b / , null ] ,
49
49
//keywords
50
- [ PR [ 'PR_KEYWORD' ] , / ^ \b (?: _ _ C O L U M N _ _ | _ _ F I L E _ _ | _ _ F U N C T I O N _ _ | _ _ L I N E _ _ | a s s o c i a t i v i t y | a s | b r e a k | c a s e | c l a s s | c o n t i n u e | c o n v e n i e n c e | d e f a u l t | d e i n i t | d i d S e t | d o | d y n a m i c | d y n a m i c T y p e | e n u m | f a l l t h r o u g h | f i n a l | f o r | f u n c | g e t | i m p o r t | i n f i x | i n i t | i n o u t | i n t e r n a l | i n | i s | l a z y | l e f t | l e t | m u t a t i n g | n o n e | n o n m u t a t i n g | o p e r a t o r | o p t i o n a l | o v e r r i d e | p o s t f i x | p r e c e d e n c e | p r e f i x | p r i v a t e | p r o t o c o l | P r o t o c o l | p u b l i c | r e q u i r e d | r e t u r n | r i g h t | s a f e | s e l f | s e t | s t a t i c | s t r u c t | s u b s c r i p t | s u p e r | s w i t c h | T y p e | t y p e a l i a s | u n o w n e d | u n s a f e | v a r | w e a k | w h i l e | w i l l S e t ) \b / , null ] ,
50
+ [ PR [ 'PR_KEYWORD' ] , / ^ \b (?: _ _ C O L U M N _ _ | _ _ F I L E _ _ | _ _ F U N C T I O N _ _ | _ _ L I N E _ _ | a s s o c i a t i v i t y | a s | b r e a k | c a s e | c l a s s | c o n t i n u e | c o n v e n i e n c e | d e f a u l t | d e i n i t | d i d S e t | d o | d y n a m i c | d y n a m i c T y p e | e l s e | e n u m | f a l l t h r o u g h | f i n a l | f o r | f u n c | g e t | i m p o r t | i n f i x | i n i t | i n o u t | i n t e r n a l | i f | i n | i s | l a z y | l e f t | l e t | m u t a t i n g | n o n e | n o n m u t a t i n g | o p e r a t o r | o p t i o n a l | o v e r r i d e | p o s t f i x | p r e c e d e n c e | p r e f i x | p r i v a t e | p r o t o c o l | P r o t o c o l | p u b l i c | r e q u i r e d | r e t u r n | r i g h t | s a f e | s e l f | s e t | s t a t i c | s t r u c t | s u b s c r i p t | s u p e r | s w i t c h | T y p e | t y p e a l i a s | u n o w n e d | u n s a f e | v a r | w e a k | w h i l e | w i l l S e t ) \b / , null ] ,
51
51
//double slash comments
52
52
[ PR [ 'PR_COMMENT' ] , / ^ \/ \/ .* ?[ \n \r ] / , null ] ,
53
53
//slash star comments
0 commit comments