Browse Source
Merge in ~HOKY.HE/design-hoky from release/11.0 to final/11.0 * commit 'f6247b4f040f91488de70c20ccae7f7362321018': REPORT-60163 公式编辑器优化2.0 1.优化错误提示 2.修改埋点逻辑 REPORT-63192 【组件可更新提醒】组件复用-设计器端生成组件弹窗的类型改为必填new-design
Hoky.He
3 years ago
5 changed files with 117 additions and 51 deletions
@ -0,0 +1,96 @@
|
||||
package com.fr.design.formula.exception.function; |
||||
|
||||
import com.fr.design.i18n.Toolkit; |
||||
|
||||
/** |
||||
* @author Hoky |
||||
* @date 2021/11/30 |
||||
*/ |
||||
public class TranslateTokenUtils { |
||||
public static String translateToken(String token) { |
||||
switch (token) { |
||||
case ("RPAREN"): |
||||
return ")"; |
||||
case ("LPAREN"): |
||||
return "("; |
||||
case ("COMMA"): |
||||
return ","; |
||||
case ("COLON"): |
||||
return ":"; |
||||
case ("EOF"): |
||||
return Toolkit.i18nText("Fine-Design_Basic_Formula_Check_Mismatched_EOF"); |
||||
case ("DOT"): |
||||
return "."; |
||||
case ("FLOT_NUM"): |
||||
return Toolkit.i18nText("Fine-Design_Basic_Formula_Float_Number"); |
||||
case ("LOR"): |
||||
return "||"; |
||||
case ("LAND"): |
||||
return "&&"; |
||||
case ("EQUAL"): |
||||
return "="; |
||||
case ("EQUAL2"): |
||||
return "="; |
||||
case ("NOT_EQUAL"): |
||||
return "!="; |
||||
case ("NOT_EQUAL2"): |
||||
return "!="; |
||||
case ("GE"): |
||||
return ">="; |
||||
case ("LE"): |
||||
return "<="; |
||||
case ("LT"): |
||||
return "<"; |
||||
case ("PLUS"): |
||||
return "+"; |
||||
case ("MINUS"): |
||||
return "-"; |
||||
case ("STAR"): |
||||
return "*"; |
||||
case ("DIV"): |
||||
return "/"; |
||||
case ("MOD"): |
||||
return "%"; |
||||
case ("POWER"): |
||||
return "^"; |
||||
case ("LNOT"): |
||||
return "!"; |
||||
case ("WAVE"): |
||||
return "~"; |
||||
case ("LBRACK"): |
||||
return "["; |
||||
case ("SEMI"): |
||||
return ";"; |
||||
case ("RBRACK"): |
||||
return "]"; |
||||
case ("LCURLY"): |
||||
return "{"; |
||||
case ("RCURLY"): |
||||
return "}"; |
||||
case ("DCOLON"): |
||||
return ";"; |
||||
case ("INT_NUM"): |
||||
return Toolkit.i18nText("Fine-Design_Basic_Formula_Integer"); |
||||
case ("CR_ADRESS"): |
||||
return "\n"; |
||||
case ("SHARP"): |
||||
return "#"; |
||||
case ("AT"): |
||||
return "@"; |
||||
case ("QUESTION"): |
||||
return "?"; |
||||
case ("BOR"): |
||||
return "||"; |
||||
case ("BAND"): |
||||
return "&&"; |
||||
case ("Char"): |
||||
return Toolkit.i18nText("Fine-Design_Basic_Formula_Character"); |
||||
case ("DIGIT"): |
||||
return Toolkit.i18nText("Fine-Design_Basic_Formula_Digital"); |
||||
case ("XDIGIT"): |
||||
return Toolkit.i18nText("Fine-Design_Basic_Formula_Hexadecimal_Digital"); |
||||
default: |
||||
return token; |
||||
} |
||||
} |
||||
} |
Loading…
Reference in new issue