Skip to content

Commit

Permalink
Added Clipper lang support (#485)
Browse files Browse the repository at this point in the history
Co-authored-by: pz2 <piotr.zmilczak@softnet.com.pl>
Co-authored-by: Ben Boyter <boyter@users.noreply.github.com>
  • Loading branch information
3 people committed Jun 30, 2024
1 parent e995f3d commit 68aaddf
Show file tree
Hide file tree
Showing 6 changed files with 111 additions and 10 deletions.
1 change: 1 addition & 0 deletions LANGUAGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ Cassius (cassius)
Ceylon (ceylon)
Chapel (chpl)
Circom (circom)
Clipper (prg,ch)
Clojure (clj,cljc)
ClojureScript (cljs)
Closure Template (soy)
Expand Down
12 changes: 3 additions & 9 deletions SCC-OUTPUT-REPORT.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
<th>459</th>
<th>7578</th>
<th>1530</th>
<th>253568</th>
<th>4036</th>
</tr><tr>
<td>processor\formatters.go</td>
Expand Down Expand Up @@ -91,7 +90,6 @@
<td>7271</td>
<td>149</td>
</tr><tr>
<td>cmd\badges\main.go</td>
<td></td>
<td>341</td>
<td>58</td>
Expand Down Expand Up @@ -271,7 +269,6 @@
<td>1050</td>
<td>29</td>
</tr><tr>
<td>processor\structs_test.go</td>
<td></td>
<td>32</td>
<td>8</td>
Expand All @@ -281,7 +278,6 @@
<td>517</td>
<td>19</td>
</tr><tr>
<td>processor\helpers.go</td>
<td></td>
<td>32</td>
<td>6</td>
Expand All @@ -291,7 +287,7 @@
<td>544</td>
<td>21</td>
</tr><tr>
<td>processor\processor_unix_test.go</td>

<td></td>
<td>24</td>
<td>6</td>
Expand All @@ -318,7 +314,7 @@
<td>0</td>
<td>4</td>
<td>0</td>
<td>23133</td>

<td>5</td>
</tr></tbody>
<tfoot><tr>
Expand All @@ -328,9 +324,7 @@
<th>1475</th>
<th>459</th>
<th>7578</th>
<th>1530</th>
<th>253568</th>
<th>4036</th>
<th>1530</th>>
</tr>
<tr>
<th colspan="9">Estimated Cost to Develop (organic) $226,531<br>Estimated Schedule Effort (organic) 7.82 months<br>Estimated People Required (organic) 2.57<br></th>
Expand Down
22 changes: 22 additions & 0 deletions examples/language/test.ch
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/*
Constants and macro definitions for the program
https://github.com/boyter/scc/issues/484
*/

// Define a constant for the number to calculate factorial
#define NUM_TO_FACTORIAL 5

// Define messages to display
#define MSG_FACT_GT_100 "Factorial is greater than 100"
#define MSG_FACT_LE_100 "Factorial is less than or equal to 100"

// Define a macro for maximum factorial limit
#define MAX_FACT_LIMIT 100

// Prototype for the Factorial function
FUNCTION Factorial( n )
RETURN NIL

// Prototype for the Main function
FUNCTION Main()
RETURN NIL
34 changes: 34 additions & 0 deletions examples/language/test.prg
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/*
This program demonstrates the calculation
of the factorial of a number using a function.
https://github.com/boyter/scc/issues/484
*/

FUNCTION Factorial( n )
LOCAL result := 1
LOCAL i

// Loop from 1 to n
FOR i := 1 TO n
result := result * i
NEXT

RETURN result

// Main program execution starts here
FUNCTION Main()
LOCAL num := 5
LOCAL fact

// Calculate the factorial of the number
fact := Factorial( num )

// Check if the factorial is greater than 100
IF fact > 100
? "Factorial is greater than 100"
ELSE
? "Factorial is less than or equal to 100"
ENDIF

RETURN
50 changes: 50 additions & 0 deletions languages.json
Original file line number Diff line number Diff line change
Expand Up @@ -1400,6 +1400,56 @@
],
"quotes": []
},
"Clipper": {
"complexitychecks": [
"for ",
"for(",
"if ",
"if(",
"do while ",
"while ",
"else ",
"elseif ",
"else(",
"switch ",
"case ",
"otherwise ",
"begin sequence ",
"end sequence ",
"begin sequence(",
"try ",
"catch ",
"finally ",
"|| ",
"&& ",
"!= ",
"== "
],
"extensions": [
"prg",
"ch"
],
"line_comment": [
"//",
"&&"
],
"multi_line": [
[
"/*",
"*/"
]
],
"quotes": [
{
"end": "\"",
"start": "\""
},
{
"end": "'",
"start": "'"
}
]
},
"Clojure": {
"complexitychecks": [
"(for ",
Expand Down
2 changes: 1 addition & 1 deletion test-all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -906,7 +906,7 @@ else
fi

# Try out specific languages
for i in 'Bosque ' 'Flow9 ' 'Bitbucket Pipeline ' 'Docker ignore ' 'Q# ' 'Futhark ' 'Alloy ' 'Wren ' 'Monkey C ' 'Alchemist ' 'Luna ' 'ignore ' 'XML Schema ' 'Web Services' 'Go ' 'Java ' 'Boo ' 'License ' 'BASH ' 'C Shell ' 'Korn Shell ' 'Makefile ' 'Shell ' 'Zsh ' 'Rakefile ' 'Gemfile ' 'Dockerfile ' 'Yarn ' 'Sieve ' 'F# ' 'Elm ' 'Terraform ' 'Clojure ' 'C# ' 'LLVM IR ' 'HAML ' 'FXML ' 'DM ' 'Nushell ' 'Racket ' 'DOT ' 'YAML ' 'Teal ' 'FSL ' 'INI ' 'Hare ' 'Templ ' 'Cuda ' 'GraphQL ' 'Bicep ' 'Pkl ' 'TypeSpec ' 'LALRPOP ' 'Snakemake ' 'OpenQASM ' 'Typst ' 'ZoKrates ' 'Chapel ' 'Slang ' 'Circom ' 'Proto ' 'wenyan ' 'Cangjie '
for i in 'Bosque ' 'Flow9 ' 'Bitbucket Pipeline ' 'Docker ignore ' 'Q# ' 'Futhark ' 'Alloy ' 'Wren ' 'Monkey C ' 'Alchemist ' 'Luna ' 'ignore ' 'XML Schema ' 'Web Services' 'Go ' 'Java ' 'Boo ' 'License ' 'BASH ' 'C Shell ' 'Korn Shell ' 'Makefile ' 'Shell ' 'Zsh ' 'Rakefile ' 'Gemfile ' 'Dockerfile ' 'Yarn ' 'Sieve ' 'F# ' 'Elm ' 'Terraform ' 'Clojure ' 'C# ' 'LLVM IR ' 'HAML ' 'FXML ' 'DM ' 'Nushell ' 'Racket ' 'DOT ' 'YAML ' 'Teal ' 'FSL ' 'INI ' 'Hare ' 'Templ ' 'Cuda ' 'GraphQL ' 'Bicep ' 'Pkl ' 'TypeSpec ' 'LALRPOP ' 'Snakemake ' 'OpenQASM ' 'Typst ' 'ZoKrates ' 'Chapel ' 'Slang ' 'Circom ' 'Proto ' 'wenyan ' 'Cangjie ' 'Clipper '
do
if ./scc "examples/language/" | grep -q "$i "; then
echo -e "${GREEN}PASSED $i Language Check"
Expand Down

0 comments on commit 68aaddf

Please sign in to comment.