Skip to content

Adding new custom keywords leads to errors #15

@robinvandernoord

Description

@robinvandernoord

Hello,

Today I have been trying to use this plugin to create a new language for a JetBrains product.
I however can't extend the plugin with new keywords.

I keep getting errors such as:

image
image

While the ANTLR preview works just fine:
image

I have tried to add a block keywords (e.g. 'class') that works very similar to a func definition:

script
	:	vardef* define_class* function* statement* EOF
	;

define_class
    : 'class' ID block
    ;

// ...

CLASS : 'class' ;

And I have tried to copy the print() definition to log(), which also leads to errors in the IDE (but not in the preview):

image
image

	|	'print' '(' expr? ')'								# Print
	|	'log' '(' expr? ')'								 # Log

// ...

PRINT : 'print' ;
LOG : 'log' ;

When replacing print with log, it does work:

image


I have tried editing and copying Java files/classes and cases/rules to match my new keywords, but this did not help at all.
What am I missing/supposed to be doing in order to create new keywords?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions