Skip to content

Commit

Permalink
syntax highlighting for bsearch (olada#59)
Browse files Browse the repository at this point in the history
  • Loading branch information
leonhardtni committed Jan 11, 2021
1 parent 2de8cf7 commit 8559b69
Show file tree
Hide file tree
Showing 7 changed files with 992 additions and 903 deletions.
1,886 changes: 983 additions & 903 deletions src/main/gen/de/cofinpro/intellij/acfeplugin/FormulaEngineLexer.java

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@

BUILT_IN_FUNC_ATTRIBUTE = 'attribute'
BUILT_IN_FUNC_BSEARCH = 'built in func bsearch'
BUILT_IN_FUNC_CORRECT_PRIZE_FIELD = 'built in func correct_price_field'
BUILT_IN_FUNC_DATE = 'date'
BUILT_IN_FUNC_DATETIME = 'datetime'
BUILT_IN_FUNC_DAYDIFF = 'daydiff'
Expand Down Expand Up @@ -231,6 +232,7 @@ private MethodReference ::= FunctionName // just for sake of better naming

BuiltInFunctionName ::= BUILT_IN_FUNC_ATTRIBUTE
| BUILT_IN_FUNC_BSEARCH
| BUILT_IN_FUNC_CORRECT_PRICE_FIELD
| BUILT_IN_FUNC_DATE | BUILT_IN_FUNC_DATETIME | BUILT_IN_FUNC_DICT | BUILT_IN_FUNC_STR | BUILT_IN_FUNC_FLOAT | BUILT_IN_FUNC_INTEGER | BUILT_IN_FUNC_LIST | BUILT_IN_FUNC_STRING
| BUILT_IN_FUNC_DAYDIFF | BUILT_IN_FUNC_DAYPLUS
| BUILT_IN_FUNC_ELT
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ DIGIT = [0-9]
// Built-in Functions (use parenthesis for matching but don't include the parenthesis in the token)
"attribute" { return FormulaEngineElementTypes.BUILT_IN_FUNC_ATTRIBUTE; }
"bsearch" { return FormulaEngineElementTypes.BUILT_IN_FUNC_BSEARCH; }
"correct_price_field" { return FormulaEngineElementTypes.BUILT_IN_FUNC_CORRECT_PRICE_FIELD; }
"date" { return FormulaEngineElementTypes.BUILT_IN_FUNC_DATE; }
"datetime" { return FormulaEngineElementTypes.BUILT_IN_FUNC_DATETIME; }
"daydiff" { return FormulaEngineElementTypes.BUILT_IN_FUNC_DAYDIFF; }
Expand Down Expand Up @@ -186,6 +187,7 @@ DIGIT = [0-9]
// Built-in Functions (use parenthesis for matching but don't include the parenthesis in the token)
"attribute(" { yypushback(1); return FormulaEngineElementTypes.BUILT_IN_FUNC_ATTRIBUTE; }
"bsearch(" { yypushback(1); return FormulaEngineElementTypes.BUILT_IN_FUNC_BSEARCH; }
"correct_price_field(" { yypushback(1); return FormulaEngineElementTypes.BUILT_IN_FUNC_CORRECT_PRICE_FIELD; }
"date(" { yypushback(1); return FormulaEngineElementTypes.BUILT_IN_FUNC_DATE; }
"datetime(" { yypushback(1); return FormulaEngineElementTypes.BUILT_IN_FUNC_DATETIME; }
"daydiff(" { yypushback(1); return FormulaEngineElementTypes.BUILT_IN_FUNC_DAYDIFF; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ public class FormulaEngineHighlighterColors {
// Built in Functions
public static final TextAttributesKey INBUILT_FUNCTION_ATTRIBUTE_ATTR_KEY = createTextAttributesKey("FE_INBUILT_FUNCTION_ATTRIBUTE", DefaultLanguageHighlighterColors.STATIC_FIELD);
public static final TextAttributesKey INBUILT_FUNCTION_BSEARCH_ATTR_KEY = createTextAttributesKey("FE_INBUILT_FUNCTION_BSEARCH", DefaultLanguageHighlighterColors.STATIC_FIELD);
public static final TextAttributesKey INBUILT_FUNCTION_CORRECT_PRICE_FIELD = createTextAttributesKey("FE_INBUILT_FUNCTION_CORRECT_PRICE_FIELD", DefaultLanguageHighlighterColors.STATIC_FIELD);
public static final TextAttributesKey INBUILT_FUNCTION_DATE_ATTR_KEY = createTextAttributesKey("FE_INBUILT_FUNCTION_DATE", DefaultLanguageHighlighterColors.STATIC_FIELD);
public static final TextAttributesKey INBUILT_FUNCTION_DATETIME_ATTR_KEY = createTextAttributesKey("FE_INBUILT_FUNCTION_DATETIME", DefaultLanguageHighlighterColors.STATIC_FIELD);
public static final TextAttributesKey INBUILT_FUNCTION_DAYDIFF_ATTR_KEY = createTextAttributesKey("FE_INBUILT_FUNCTION_DAYDIFF", DefaultLanguageHighlighterColors.STATIC_FIELD);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ public class FormulaEngineSyntaxHighlighter extends SyntaxHighlighterBase {
// Built in functions
safeMap(ATTRIBUTES, FormulaEngineElementTypes.BUILT_IN_FUNC_ATTRIBUTE, INBUILT_FUNCTION_ATTRIBUTE_ATTR_KEY);
safeMap(ATTRIBUTES, FormulaEngineElementTypes.BUILT_IN_FUNC_BSEARCH, INBUILT_FUNCTION_BSEARCH_ATTR_KEY);
safeMap(ATTRIBUTES, FormulaEngineElementTypes.BUILT_IN_FUNC_CORRECT_PRICE_FIELD, INBUILT_FUNCTION_CORRECT_PRICE_FIELD);
safeMap(ATTRIBUTES, FormulaEngineElementTypes.BUILT_IN_FUNC_DATE, INBUILT_FUNCTION_DATE_ATTR_KEY);
safeMap(ATTRIBUTES, FormulaEngineElementTypes.BUILT_IN_FUNC_DATETIME, INBUILT_FUNCTION_DATETIME_ATTR_KEY);
safeMap(ATTRIBUTES, FormulaEngineElementTypes.BUILT_IN_FUNC_DAYDIFF, INBUILT_FUNCTION_DAYDIFF_ATTR_KEY);
Expand Down

0 comments on commit 8559b69

Please sign in to comment.