Skip to content

Commit b0b12dd

Browse files
committed
Merge branch 'gradle-preprocessor' into gradle-plugin
2 parents 7e6c97a + ad5c27e commit b0b12dd

File tree

6 files changed

+25
-17
lines changed

6 files changed

+25
-17
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,8 @@ java/build/
110110
/java/libraries/svg/bin
111111
/java/preprocessor/build
112112
/java/lsp/build
113+
/java/gradle/build
114+
/.kotlin/sessions
113115
/core/examples/build
114116
/java/gradle/build
115117
/java/gradle/example/.processing

java/preprocessor/src/main/antlr/JavaLexer.g4

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,8 @@ CHAR_LITERAL: '\'' (~['\\\r\n] | EscapeSequence) '\'';
134134

135135
STRING_LITERAL: '"' (~["\\\r\n] | EscapeSequence)* '"';
136136
137+
MULTI_STRING_LIT: '"""' (~[\\] | EscapeSequence)*? '"""';
138+
137139
TEXT_BLOCK: '"""' [ \t]* [\r\n] (. | EscapeSequence)*? '"""';
138140
139141
NULL_LITERAL: 'null';

java/preprocessor/src/main/antlr/JavaParser.g4

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,11 +314,24 @@ qualifiedName
314314
: identifier ('.' identifier)*
315315
;
316316

317+
baseStringLiteral
318+
: STRING_LITERAL
319+
;
320+
321+
multilineStringLiteral
322+
: MULTI_STRING_LIT
323+
;
324+
325+
stringLiteral
326+
: baseStringLiteral
327+
| multilineStringLiteral
328+
;
329+
317330
literal
318331
: integerLiteral
319332
| floatLiteral
320333
| CHAR_LITERAL
321-
| STRING_LITERAL
334+
| stringLiteral
322335
| BOOL_LITERAL
323336
| NULL_LITERAL
324337
| TEXT_BLOCK // Java17

java/preprocessor/src/main/antlr/processing/mode/java/preproc/Processing.g4

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ processingSketch
2727
: staticProcessingSketch
2828
| javaProcessingSketch
2929
| activeProcessingSketch
30-
| warnMixedModes
30+
// | warnMixedModes
3131
;
3232

3333
// java mode, is a compilation unit
@@ -111,7 +111,7 @@ literal
111111
: integerLiteral
112112
| floatLiteral
113113
| CHAR_LITERAL
114-
| STRING_LITERAL
114+
| stringLiteral
115115
| BOOL_LITERAL
116116
| NULL_LITERAL
117117
| hexColorLiteral
@@ -144,13 +144,4 @@ LINE_COMMENT
144144

145145
CHAR_LITERAL
146146
: '\'' (~['\\\r\n] | EscapeSequence)* '\'' // A bit nasty but let JDT tackle invalid chars
147-
;
148-
149-
// Parser Rules
150-
multilineStringLiteral
151-
: MULTILINE_STRING_START .*? MULTILINE_STRING_END
152-
;
153-
154-
// Lexer Rules
155-
MULTILINE_STRING_START: '"""' '\r'? '\n';
156-
MULTILINE_STRING_END: '"""';
147+
;

java/preprocessor/src/main/java/processing/app/Preferences.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ static public String get(String attribute /*, String defaultValue */) {
5858
}
5959
}
6060
static public boolean getBoolean(String attribute) {
61-
String value = get(attribute); //, null);
61+
String value = get(attribute);
6262
return Boolean.parseBoolean(value);
6363
}
6464
static public int getInteger(String attribute /*, int defaultValue*/) {

java/test/resources/bug1532.pde

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ flatCube[][] grid;
2020

2121
void setup() {
2222
try {
23-
quicktime.QTSession.open();
24-
}
25-
catch (quicktime.QTException qte) {
23+
// quicktime.QTSession.open();
24+
}
25+
catch (quicktime.QTException qte) {
2626
qte.printStackTrace();
2727
}
2828

0 commit comments

Comments
 (0)