Skip to content
Snippets Groups Projects
Commit b2423d5e authored by Johannes Mey's avatar Johannes Mey
Browse files

Merge branch 'bug/lexer-and-grammar-bugs' into 'develop'

Resolve "Grammar Bugs (VariableArityParameter and multiple catch types)"

Closes #21 and #20

See merge request !12
parents b98a4c28 29596d42
No related branches found
No related tags found
1 merge request!12Resolve "Grammar Bugs (VariableArityParameter and multiple catch types)"
Pipeline #12704 passed
...@@ -197,7 +197,7 @@ method_declarator ::= java_identifier formal_parameters (LBRACKET RBRACKET)* ...@@ -197,7 +197,7 @@ method_declarator ::= java_identifier formal_parameters (LBRACKET RBRACKET)*
formal_parameters ::= LPAREN ( formal_parameter ( COMMA formal_parameter )* )? RPAREN formal_parameters ::= LPAREN ( formal_parameter ( COMMA formal_parameter )* )? RPAREN
formal_parameter ::= FINAL? type DOTS? variable_declarator_id formal_parameter ::= FINAL? type ELLIPSIS? variable_declarator_id
constructor_declaration ::= type_parameters? java_identifier formal_parameters (THROWS name_list)? LBRACE explicit_constructor_invocation? block_statement* RBRACE constructor_declaration ::= type_parameters? java_identifier formal_parameters (THROWS name_list)? LBRACE explicit_constructor_invocation? block_statement* RBRACE
...@@ -361,7 +361,7 @@ throw_statement ::= THROW expression SEMICOLON ...@@ -361,7 +361,7 @@ throw_statement ::= THROW expression SEMICOLON
synchronized_statement ::= SYNCHRONIZED LPAREN expression RPAREN block synchronized_statement ::= SYNCHRONIZED LPAREN expression RPAREN block
try_statement ::= TRY ( LPAREN local_variable_declaration ( SEMICOLON local_variable_declaration )* SEMICOLON? RPAREN )? block ( CATCH LPAREN FINAL? type ( BIT_OR FINAL type )* variable_declarator_id RPAREN block )* ( FINALLY block )? try_statement ::= TRY ( LPAREN local_variable_declaration ( SEMICOLON local_variable_declaration )* SEMICOLON? RPAREN )? block ( CATCH LPAREN FINAL? type ( BIT_OR FINAL? type )* variable_declarator_id RPAREN block )* ( FINALLY block )?
// TODO maybe change order! // TODO maybe change order!
annotation ::= ( normal_annotation | single_member_annotation | marker_annotation ) annotation ::= ( normal_annotation | single_member_annotation | marker_annotation )
...@@ -409,4 +409,4 @@ parameter_name ::= IDENTIFIER ...@@ -409,4 +409,4 @@ parameter_name ::= IDENTIFIER
method_name ::= IDENTIFIER method_name ::= IDENTIFIER
// unused keywords must still appear somewhere // unused keywords must still appear somewhere
unused_keywords ::= GOTO | CONST ELLIPSIS | PACKAGE unused_keywords ::= GOTO | CONST | PACKAGE
...@@ -18,7 +18,7 @@ import com.intellij.psi.TokenType; ...@@ -18,7 +18,7 @@ import com.intellij.psi.TokenType;
WhiteSpace = [ ] | \t | \f | \n | \r | \r\n WhiteSpace = [ ] | \t | \f | \n | \r | \r\n
ID = [a-zA-Z$_][a-zA-Z0-9$_]* ID = [:jletter:] [:jletterdigit:]*
MultiLineComment = [/][*][^*]+[*]+([^*/][^*]*[*]+)*[/] MultiLineComment = [/][*][^*]+[*]+([^*/][^*]*[*]+)*[/]
DocComment = [/][*][*][^*]*[*]+([^*/][^*]*[*]+)*[/] DocComment = [/][*][*][^*]*[*]+([^*/][^*]*[*]+)*[/]
SingleLineComment = [/][/] [^\n\r]* (\n | \r | \r\n) SingleLineComment = [/][/] [^\n\r]* (\n | \r | \r\n)
......
...@@ -51,7 +51,7 @@ public class AspectSyntaxHighlighter extends SyntaxHighlighterBase { ...@@ -51,7 +51,7 @@ public class AspectSyntaxHighlighter extends SyntaxHighlighterBase {
AspectTypes.NE, AspectTypes.ORASSIGN, AspectTypes.XOR, AspectTypes.XORASSIGN, AspectTypes.STAR, AspectTypes.NE, AspectTypes.ORASSIGN, AspectTypes.XOR, AspectTypes.XORASSIGN, AspectTypes.STAR,
AspectTypes.STARASSIGN, AspectTypes.REM, AspectTypes.REMASSIGN, AspectTypes.SC_AND, AspectTypes.SC_OR, AspectTypes.STARASSIGN, AspectTypes.REM, AspectTypes.REMASSIGN, AspectTypes.SC_AND, AspectTypes.SC_OR,
AspectTypes.AMPERSAND, AspectTypes.RSIGNEDSHIFTASSIGN, AspectTypes.RUNSIGNEDSHIFTASSIGN, AspectTypes.TILDE, AspectTypes.AMPERSAND, AspectTypes.RSIGNEDSHIFTASSIGN, AspectTypes.RUNSIGNEDSHIFTASSIGN, AspectTypes.TILDE,
AspectTypes.BANG, AspectTypes.ARROW, AspectTypes.DOTS); AspectTypes.BANG, AspectTypes.ARROW, AspectTypes.ELLIPSIS);
public static final TextAttributesKey OPERATOR = createTextAttributesKey("JASTADD_OPERATOR", DefaultLanguageHighlighterColors.OPERATION_SIGN); public static final TextAttributesKey OPERATOR = createTextAttributesKey("JASTADD_OPERATOR", DefaultLanguageHighlighterColors.OPERATION_SIGN);
private static final TextAttributesKey[] OPERATOR_KEYS = new TextAttributesKey[]{OPERATOR}; private static final TextAttributesKey[] OPERATOR_KEYS = new TextAttributesKey[]{OPERATOR};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment