Skip to content

Commit

Permalink
ABNF (#526)
Browse files Browse the repository at this point in the history
  • Loading branch information
boyter authored Oct 1, 2024
1 parent 4c7970f commit 195f644
Show file tree
Hide file tree
Showing 6 changed files with 82 additions and 53 deletions.
1 change: 1 addition & 0 deletions LANGUAGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
```
ABAP (abap)
ABNF (abnf)
ActionScript (as)
Ada (ada,adb,ads,pad)
Agda (agda)
Expand Down
26 changes: 13 additions & 13 deletions SCC-OUTPUT-REPORT.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<th>447</th>
<th>7659</th>
<th>1529</th>
<th>254324</th>
<th>254544</th>
<th>4067</th>
</tr><tr>
<td>processor/formatters.go</td>
Expand Down Expand Up @@ -240,16 +240,6 @@
<td>0</td>
<td>2209</td>
<td>35</td>
</tr><tr>
<td>processor/bloom.go</td>
<td></td>
<td>37</td>
<td>7</td>
<td>12</td>
<td>18</td>
<td>2</td>
<td>1062</td>
<td>29</td>
</tr><tr>
<td>processor/cocomo_test.go</td>
<td></td>
Expand All @@ -260,6 +250,16 @@
<td>6</td>
<td>686</td>
<td>23</td>
</tr><tr>
<td>processor/bloom.go</td>
<td></td>
<td>37</td>
<td>7</td>
<td>12</td>
<td>18</td>
<td>2</td>
<td>1062</td>
<td>29</td>
</tr><tr>
<td>processor/helpers_test.go</td>
<td></td>
Expand Down Expand Up @@ -288,7 +288,7 @@
<td>0</td>
<td>4</td>
<td>0</td>
<td>21985</td>
<td>22205</td>
<td>5</td>
</tr></tbody>
<tfoot><tr>
Expand All @@ -299,7 +299,7 @@
<th>447</th>
<th>7659</th>
<th>1529</th>
<th>254324</th>
<th>254544</th>
<th>4067</th>
</tr>
<tr>
Expand Down
20 changes: 20 additions & 0 deletions examples/language/abnf.abnf
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
postal-address = name-part street zip-part

name-part = *(personal-part SP) last-name [SP suffix] CRLF
name-part =/ personal-part CRLF

personal-part = first-name / (initial ".")
first-name = *ALPHA
initial = ALPHA
last-name = *ALPHA
suffix = ("Jr." / "Sr." / 1*("I" / "V" / "X"))

street = [apt SP] house-num SP street-name CRLF
apt = 1*4DIGIT
house-num = 1*8(DIGIT / ALPHA)
street-name = 1*VCHAR

zip-part = town-name "," SP state 1*2SP zip-code CRLF
town-name = 1*(ALPHA / SP)
state = 2ALPHA
zip-code = 5DIGIT ["-" 4DIGIT]
85 changes: 46 additions & 39 deletions languages.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,13 @@
"multi_line": [],
"quotes": []
},
"ABNF": {
"complexitychecks": ["=/ ", "/ ", "% ", "( "],
"extensions": ["abnf"],
"line_comment": [";"],
"multi_line": [],
"quotes": []
},
"APL": {
"complexitychecks": [
":For ",
Expand Down Expand Up @@ -3068,45 +3075,6 @@
],
"shebangs": ["node"]
},
"LiveScript": {
"complexitychecks": [
"for ",
"for(",
"if ",
"if(",
"switch ",
"case ",
"while ",
"when ",
"else ",
"|| ",
"&& ",
"!= ",
"!== ",
"xor ",
"and ",
"or ",
"|> ",
"<< ",
"<<< ",
"<<<< ",
">> ",
"== "
],
"extensions": ["ls"],
"line_comment": ["#"],
"multi_line": [["/*", "*/"]],
"quotes": [
{
"end": "\"",
"start": "\""
},
{
"end": "'",
"start": "'"
}
]
},
"JavaServer Pages": {
"complexitychecks": [
"for ",
Expand Down Expand Up @@ -3551,6 +3519,45 @@
"quotes": [],
"shebangs": ["sbcl"]
},
"LiveScript": {
"complexitychecks": [
"for ",
"for(",
"if ",
"if(",
"switch ",
"case ",
"while ",
"when ",
"else ",
"|| ",
"&& ",
"!= ",
"!== ",
"xor ",
"and ",
"or ",
"|> ",
"<< ",
"<<< ",
"<<<< ",
">> ",
"== "
],
"extensions": ["ls"],
"line_comment": ["#"],
"multi_line": [["/*", "*/"]],
"quotes": [
{
"end": "\"",
"start": "\""
},
{
"end": "'",
"start": "'"
}
]
},
"Lua": {
"complexitychecks": [
"for ",
Expand Down
2 changes: 1 addition & 1 deletion processor/constants.go

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions test-all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -916,6 +916,7 @@ fi

# Try out specific languages
specificLanguages=(
'ABNF '
'Alchemist '
'Alloy '
'Arturo '
Expand Down

0 comments on commit 195f644

Please sign in to comment.