Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New Language: Java Properties #1443

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions AUTHORS.en.txt
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,7 @@ Contributors:
- Hale Chan <[email protected]>
- Matt Evans <[email protected]>
- Kasper Andersen <[email protected]>
- Michael Gerbig <[email protected]>
- Philipp A. <[email protected]>
- Guannan Wei <[email protected]>
- Sam Wu <[email protected]>
Expand Down
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ New languages:

- *Hy* by [Sergey Sobko][]
- *Leaf* by [Hale Chan][]
- *Properties* by [Michael Gerbig][]
- *N1QL* by [Andres Täht][] and [Rene Saarsoo][]

Improvements:
Expand Down
2 changes: 2 additions & 0 deletions docs/css-classes-reference.rst
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,8 @@ Language names and aliases
+-------------------------+---------------------------------------------------+
| Prolog | prolog |
+-------------------------+---------------------------------------------------+
| Properties | properties |
+-------------------------+---------------------------------------------------+
| Protocol Buffers | protobuf |
+-------------------------+---------------------------------------------------+
| Puppet | puppet, pp |
Expand Down
41 changes: 41 additions & 0 deletions src/languages/properties.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/*
Language: Java Property Files
Author: Michael Gerbig <[email protected]>
Contributors:
Description: language definition for Java Property files
Category: common, config
*/

function(hljs) {
return {
contains: [
hljs.COMMENT(
'^\\s*[\\!#]',
'$'
),
{
className: 'variable',
begin: /^[^:=]+/m,
illegal: ".*\\S\\s\\S.*"
},
{
className: 'string',
begin: /[=:]\s*/,
end: /[^\\]$/,
excludeBegin: true,
relevance: 0,
contains: [
{
className: 'symbol',
begin: /\\(t|n|r|u[0-9A-Fa-f]{4})/
},
{
className: 'meta',
begin: /\\$/
},
"self"
]
}
]
};
}
18 changes: 18 additions & 0 deletions test/detect/properties/default.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
pi=3.141
time=01.01.1900
integer=1337
float=12.34

! I am a comment
# Me too!

propertyA = I am a property
property_C:ABC
propertyD : Just another string

multiline=\
This is a multiline property. The following line is no property!\
multiline=this is no property

! Last Comment
lastProperty = bye :)