Skip to content

Commit

Permalink
Merge pull request universal-ctags#4052 from techee/iniconf_toml
Browse files Browse the repository at this point in the history
iniconf: Allow dot and dash for ini keys
  • Loading branch information
masatake authored Aug 16, 2024
2 parents 36fce6a + f609eab commit f158eb8
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ handler_hand01 input.conf /^[handler_hand01]$/;" section language:Iniconf
handlers input.conf /^[handlers]$/;" section language:Iniconf
handlers input.conf /^handlers=hand01$/;" key language:Iniconf section:logger_parser
handlers input.conf /^handlers=hand01$/;" key language:Iniconf section:logger_root
key-with-dashes input.conf /^key-with-dashes=value2$/;" key language:Iniconf section:section.with.dots
key.with.dots input.conf /^key.with.dots=value1$/;" key language:Iniconf section:section.with.dots
keys input.conf /^keys=form01$/;" key language:Iniconf section:formatters
keys input.conf /^keys=hand01$/;" key language:Iniconf section:handlers
keys input.conf /^keys=root,parser$/;" key language:Iniconf section:loggers
Expand All @@ -24,3 +26,4 @@ parser input.conf /^[logger_parser]$/;" loggerSection language:PythonLoggingConf
propagate input.conf /^propagate=1$/;" key language:Iniconf section:logger_parser
qualname input.conf /^qualname=compiler.parser$/;" key language:Iniconf section:logger_parser
root input.conf /^[logger_root]$/;" loggerSection language:PythonLoggingConfig
section.with.dots input.conf /^[section.with.dots]$/;" section language:Iniconf
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,7 @@ args=(sys.stdout,)
format=F1 %(asctime)s %(levelname)s %(message)s
datefmt=
class=logging.Formatter

[section.with.dots]
key.with.dots=value1
key-with-dashes=value2
2 changes: 1 addition & 1 deletion parsers/iniconf.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
static bool isIdentifier (int c)
{
/* allow whitespace within keys and sections */
return (bool)(isalnum (c) || isspace (c) || c == '_');
return (bool)(isalnum (c) || isspace (c) || c == '_' || c == '-' || c == '.');
}

static bool isValue (int c)
Expand Down

0 comments on commit f158eb8

Please sign in to comment.