mirror of
https://github.com/processing/processing4.git
synced 2026-01-26 01:41:06 +01:00
Apply same parser & lexer fixes from before
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -108,6 +108,7 @@ java/build/
|
||||
/java/libraries/svg/bin
|
||||
/java/preprocessor/build
|
||||
/java/lsp/build
|
||||
/java/gradle/build
|
||||
/.kotlin/sessions
|
||||
/core/examples/build
|
||||
|
||||
|
||||
@@ -134,6 +134,8 @@ CHAR_LITERAL: '\'' (~['\\\r\n] | EscapeSequence) '\'';
|
||||
|
||||
STRING_LITERAL: '"' (~["\\\r\n] | EscapeSequence)* '"';
|
||||
|
||||
MULTI_STRING_LIT: '"""' (~[\\] | EscapeSequence)*? '"""';
|
||||
|
||||
TEXT_BLOCK: '"""' [ \t]* [\r\n] (. | EscapeSequence)*? '"""';
|
||||
|
||||
NULL_LITERAL: 'null';
|
||||
|
||||
@@ -314,11 +314,24 @@ qualifiedName
|
||||
: identifier ('.' identifier)*
|
||||
;
|
||||
|
||||
baseStringLiteral
|
||||
: STRING_LITERAL
|
||||
;
|
||||
|
||||
multilineStringLiteral
|
||||
: MULTI_STRING_LIT
|
||||
;
|
||||
|
||||
stringLiteral
|
||||
: baseStringLiteral
|
||||
| multilineStringLiteral
|
||||
;
|
||||
|
||||
literal
|
||||
: integerLiteral
|
||||
| floatLiteral
|
||||
| CHAR_LITERAL
|
||||
| STRING_LITERAL
|
||||
| stringLiteral
|
||||
| BOOL_LITERAL
|
||||
| NULL_LITERAL
|
||||
| TEXT_BLOCK // Java17
|
||||
|
||||
@@ -27,7 +27,7 @@ processingSketch
|
||||
: staticProcessingSketch
|
||||
| javaProcessingSketch
|
||||
| activeProcessingSketch
|
||||
| warnMixedModes
|
||||
// | warnMixedModes
|
||||
;
|
||||
|
||||
// java mode, is a compilation unit
|
||||
@@ -111,7 +111,7 @@ literal
|
||||
: integerLiteral
|
||||
| floatLiteral
|
||||
| CHAR_LITERAL
|
||||
| STRING_LITERAL
|
||||
| stringLiteral
|
||||
| BOOL_LITERAL
|
||||
| NULL_LITERAL
|
||||
| hexColorLiteral
|
||||
@@ -144,13 +144,4 @@ LINE_COMMENT
|
||||
|
||||
CHAR_LITERAL
|
||||
: '\'' (~['\\\r\n] | EscapeSequence)* '\'' // A bit nasty but let JDT tackle invalid chars
|
||||
;
|
||||
|
||||
// Parser Rules
|
||||
multilineStringLiteral
|
||||
: MULTILINE_STRING_START .*? MULTILINE_STRING_END
|
||||
;
|
||||
|
||||
// Lexer Rules
|
||||
MULTILINE_STRING_START: '"""' '\r'? '\n';
|
||||
MULTILINE_STRING_END: '"""';
|
||||
;
|
||||
@@ -58,7 +58,7 @@ public class Preferences {
|
||||
}
|
||||
}
|
||||
static public boolean getBoolean(String attribute) {
|
||||
String value = get(attribute); //, null);
|
||||
String value = get(attribute);
|
||||
return Boolean.parseBoolean(value);
|
||||
}
|
||||
static public int getInteger(String attribute /*, int defaultValue*/) {
|
||||
|
||||
@@ -20,9 +20,9 @@ flatCube[][] grid;
|
||||
|
||||
void setup() {
|
||||
try {
|
||||
quicktime.QTSession.open();
|
||||
}
|
||||
catch (quicktime.QTException qte) {
|
||||
// quicktime.QTSession.open();
|
||||
}
|
||||
catch (quicktime.QTException qte) {
|
||||
qte.printStackTrace();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user