Skip to content

Commit 839ee44

Browse files
committed
chore: format
1 parent d0c2726 commit 839ee44

File tree

273 files changed

+17201
-19508
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

273 files changed

+17201
-19508
lines changed

src/nsl/CodeInfo.java

Lines changed: 81 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -7,102 +7,98 @@
77
import java.util.HashMap;
88

99
/**
10-
*
1110
* @author Stuart
1211
*/
13-
public abstract class CodeInfo
14-
{
15-
protected static CodeInfo current = null;
12+
public abstract class CodeInfo {
13+
protected static CodeInfo current = null;
1614

17-
protected final HashMap<Integer, Register> usedVars;
15+
protected final HashMap<Integer, Register> usedVars;
1816

19-
private Label labelBreak;
20-
private Label labelContinue;
17+
private Label labelBreak;
18+
private Label labelContinue;
2119

22-
protected CodeInfo()
23-
{
24-
this.usedVars = new HashMap<Integer, Register>();
25-
this.labelBreak = null;
26-
this.labelContinue = null;
27-
}
20+
protected CodeInfo() {
21+
this.usedVars = new HashMap<Integer, Register>();
22+
this.labelBreak = null;
23+
this.labelContinue = null;
24+
}
2825

29-
/**
30-
* Gets the variables used in the function.
31-
* @return the variables used in the function
32-
*/
33-
public HashMap<Integer, Register> getUsedVars()
34-
{
35-
return this.usedVars;
36-
}
26+
/**
27+
* Gets the variables used in the function.
28+
*
29+
* @return the variables used in the function
30+
*/
31+
public HashMap<Integer, Register> getUsedVars() {
32+
return this.usedVars;
33+
}
3734

38-
/**
39-
* Gets the current go-to label for a "break" instruction.
40-
* @return the current go-to label for a "break" instruction
41-
*/
42-
public Label getBreakLabel()
43-
{
44-
return this.labelBreak;
45-
}
35+
/**
36+
* Gets the current go-to label for a "break" instruction.
37+
*
38+
* @return the current go-to label for a "break" instruction
39+
*/
40+
public Label getBreakLabel() {
41+
return this.labelBreak;
42+
}
4643

47-
/**
48-
* Sets the current go-to label for a "break" instruction.
49-
* @param labelBreak the current go-to label for a "break" instruction
50-
* @return the original value
51-
*/
52-
public Label setBreakLabel(Label labelBreak)
53-
{
54-
Label old = this.labelBreak;
55-
this.labelBreak = labelBreak;
56-
return old;
57-
}
44+
/**
45+
* Sets the current go-to label for a "break" instruction.
46+
*
47+
* @param labelBreak the current go-to label for a "break" instruction
48+
* @return the original value
49+
*/
50+
public Label setBreakLabel(Label labelBreak) {
51+
Label old = this.labelBreak;
52+
this.labelBreak = labelBreak;
53+
return old;
54+
}
5855

59-
/**
60-
* Gets the current go-to label for a "continue" instruction.
61-
* @return the current go-to label for a "continue" instruction
62-
*/
63-
public Label getContinueLabel()
64-
{
65-
return this.labelContinue;
66-
}
56+
/**
57+
* Gets the current go-to label for a "continue" instruction.
58+
*
59+
* @return the current go-to label for a "continue" instruction
60+
*/
61+
public Label getContinueLabel() {
62+
return this.labelContinue;
63+
}
6764

68-
/**
69-
* Sets the current go-to label for a "continue" instruction.
70-
* @param labelBreak the current go-to label for a "continue" instruction
71-
* @return the original value
72-
*/
73-
public Label setContinueLabel(Label labelContinue)
74-
{
75-
Label old = this.labelContinue;
76-
this.labelContinue = labelContinue;
77-
return old;
78-
}
65+
/**
66+
* Sets the current go-to label for a "continue" instruction.
67+
*
68+
* @param labelBreak the current go-to label for a "continue" instruction
69+
* @return the original value
70+
*/
71+
public Label setContinueLabel(Label labelContinue) {
72+
Label old = this.labelContinue;
73+
this.labelContinue = labelContinue;
74+
return old;
75+
}
7976

80-
/**
81-
* Adds a variable to the used variables list.
82-
* @param var the variable to add
83-
*/
84-
public void addUsedVar(Register var)
85-
{
86-
Integer key = Integer.valueOf(var.getIntegerValue());
87-
if (this.usedVars.get(key) == null)
88-
this.usedVars.put(key, var);
89-
}
77+
/**
78+
* Adds a variable to the used variables list.
79+
*
80+
* @param var the variable to add
81+
*/
82+
public void addUsedVar(Register var) {
83+
Integer key = Integer.valueOf(var.getIntegerValue());
84+
if (this.usedVars.get(key) == null) this.usedVars.put(key, var);
85+
}
9086

91-
/**
92-
* Gets the current code info.
93-
* @return the current code info
94-
*/
95-
public static CodeInfo getCurrent()
96-
{
97-
return current;
98-
}
87+
/**
88+
* Gets the current code info.
89+
*
90+
* @return the current code info
91+
*/
92+
public static CodeInfo getCurrent() {
93+
return current;
94+
}
9995

100-
/**
101-
* Sets the current code info.
102-
* @param codeInfo the current code info
103-
*/
104-
public static void setCurrent(CodeInfo codeInfo)
105-
{
106-
current = codeInfo;
107-
}
96+
/**
97+
* Sets the current code info.
98+
*
99+
* @param codeInfo the current code info
100+
*/
101+
public static void setCurrent(CodeInfo codeInfo) {
102+
current = codeInfo;
103+
}
108104
}

src/nsl/ComparisonType.java

Lines changed: 17 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -6,27 +6,24 @@
66

77
/**
88
* How two operands should be compared.
9+
*
910
* @author Stuart
1011
*/
11-
public enum ComparisonType
12-
{
13-
Integer,
14-
IntegerUnsigned,
15-
String,
16-
StringCaseSensitive;
12+
public enum ComparisonType {
13+
Integer,
14+
IntegerUnsigned,
15+
String,
16+
StringCaseSensitive;
1717

18-
/**
19-
* Matches a {@code ComparisonType} value from the current script tokenizer.
20-
* @return a {@code ComparisonType} value
21-
*/
22-
public static ComparisonType match()
23-
{
24-
if (ScriptParser.tokenizer.match("u"))
25-
return ComparisonType.IntegerUnsigned;
26-
if (ScriptParser.tokenizer.match("s"))
27-
return ComparisonType.String;
28-
if (ScriptParser.tokenizer.match("S"))
29-
return ComparisonType.StringCaseSensitive;
30-
return ComparisonType.Integer;
31-
}
18+
/**
19+
* Matches a {@code ComparisonType} value from the current script tokenizer.
20+
*
21+
* @return a {@code ComparisonType} value
22+
*/
23+
public static ComparisonType match() {
24+
if (ScriptParser.tokenizer.match("u")) return ComparisonType.IntegerUnsigned;
25+
if (ScriptParser.tokenizer.match("s")) return ComparisonType.String;
26+
if (ScriptParser.tokenizer.match("S")) return ComparisonType.StringCaseSensitive;
27+
return ComparisonType.Integer;
28+
}
3229
}

src/nsl/Constant.java

Lines changed: 35 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -6,45 +6,44 @@
66

77
/**
88
* An NSIS constant.
9+
*
910
* @author Stuart
1011
*/
11-
public class Constant
12-
{
13-
private final String name;
14-
private final String realName;
15-
private final int index;
12+
public class Constant {
13+
private final String name;
14+
private final String realName;
15+
private final int index;
1616

17-
/**
18-
* Class constructor.
19-
* @param name the constant name
20-
* @param realName the real constant name if it differs
21-
* @param index
22-
*/
23-
public Constant(String name, String realName, int index)
24-
{
25-
this.name = name;
26-
this.realName = null;
27-
this.index = index;
28-
}
17+
/**
18+
* Class constructor.
19+
*
20+
* @param name the constant name
21+
* @param realName the real constant name if it differs
22+
* @param index
23+
*/
24+
public Constant(String name, String realName, int index) {
25+
this.name = name;
26+
this.realName = null;
27+
this.index = index;
28+
}
2929

30-
/**
31-
* Gets the register index.
32-
* @return the register index
33-
*/
34-
public int getIndex()
35-
{
36-
return this.index;
37-
}
30+
/**
31+
* Gets the register index.
32+
*
33+
* @return the register index
34+
*/
35+
public int getIndex() {
36+
return this.index;
37+
}
3838

39-
/**
40-
* Gets a string representation of the current object.
41-
* @return a string representation of the current object
42-
*/
43-
@Override
44-
public String toString()
45-
{
46-
if (this.realName != null)
47-
return this.realName;
48-
return this.name;
49-
}
39+
/**
40+
* Gets a string representation of the current object.
41+
*
42+
* @return a string representation of the current object
43+
*/
44+
@Override
45+
public String toString() {
46+
if (this.realName != null) return this.realName;
47+
return this.name;
48+
}
5049
}

0 commit comments

Comments
 (0)