Skip to content
Permalink
Browse files
Objective C: Improved string token (#3235)
  • Loading branch information
RunDevelopment committed Dec 7, 2021
1 parent afd77ed commit 8e0e95f305c43e7a4bf38a1053c0d52ce8f4db91
Showing with 15 additions and 9 deletions.
  1. +4 −1 components/prism-objectivec.js
  2. +1 −1 components/prism-objectivec.min.js
  3. +10 −7 tests/languages/objectivec/char_feature.test
@@ -1,5 +1,8 @@
Prism.languages.objectivec = Prism.languages.extend('c', {
'string': /("|')(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1|@"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,
'string': {
pattern: /@?"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,
greedy: true
},
'keyword': /\b(?:asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|in|inline|int|long|register|return|self|short|signed|sizeof|static|struct|super|switch|typedef|typeof|union|unsigned|void|volatile|while)\b|(?:@interface|@end|@implementation|@protocol|@class|@public|@protected|@private|@property|@try|@catch|@finally|@throw|@synthesize|@dynamic|@selector)\b/,
'operator': /-[->]?|\+\+?|!=?|<<?=?|>>?=?|==?|&&?|\|\|?|[~^%?*\/@]/
});

Some generated files are not rendered by default. Learn more.

@@ -1,12 +1,15 @@
''
'fo\'o'
'foo\
bar'
'a'
'\n'
'\000'
'\x00'
'\u0000'

----------------------------------------------------

[
["char", "''"],
["char", "'fo\\'o'"],
["char", "'foo\\\r\nbar'"]
["char", "'a'"],
["char", "'\\n'"],
["char", "'\\000'"],
["char", "'\\x00'"],
["char", "'\\u0000'"]
]

0 comments on commit 8e0e95f

Please sign in to comment.