Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

Add missing format parsing #234

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 17 additions & 7 deletions grammars/c.cson
Original file line number Diff line number Diff line change
Expand Up @@ -704,14 +704,24 @@
'string_placeholder':
'patterns': [
{
'match': '''(?x) %
(\\d+\\$)? # field (argument #)
[#0\\- +']* # flags
'match': '''(?x)
(%|%\\d+\\$) # conversion specification start: either % or %m$ where m is an integer
[#0\\- +'I\\*m]* # flags: I is gnulibc extention
[,;:_]? # separator character (AltiVec)
((-?\\d+)|\\*(-?\\d+\\$)?)? # minimum field width
(\\.((-?\\d+)|\\*(-?\\d+\\$)?)?)? # precision
(hh|h|ll|l|j|t|z|q|L|vh|vl|v|hv|hl)? # length modifier
[diouxXDOUeEfFgGaACcSspn%] # conversion type
(-?\\d+|\\*\\d+\\$)? # width
(\\.(\\d+|\\*(\\d+\\$)?))? # precision
(
((hh|h|l|ll|j|z|Z|t)?[diuUoOxXn]{1})|
((l|L)?[fFeEgGaA]{1})|
p| # pointer address
(l?[cs]{1})| # character and string with w_char support
(\\[((\\^\\]|\\])?[^\\]]+)\\])| # scanset
m| # Glibc extension
((ll)?[fFeEgGaA]{1})| # nonstandard GNU's extention
((q|L)?[diuoxXn]{1})| # BSD and nonstandard GNU's extention
[CS]{1} # nonstandard SUSv2/3/4's extention
)
| %% # literal %
'''
'name': 'constant.other.placeholder.c'
}
Expand Down