File tree Expand file tree Collapse file tree 1 file changed +19
-14
lines changed
src/org/intellij/erlang/psi/impl Expand file tree Collapse file tree 1 file changed +19
-14
lines changed Original file line number Diff line number Diff line change @@ -1300,20 +1300,25 @@ public static boolean needQuotation(@NotNull String atomName) {
13001300
13011301 @ NotNull
13021302 private static ThreeState atomNameRequiresQuotes (@ NotNull String atomName ) {
1303- //check if it's a regular atom
1304- Matcher matcher = ATOM_PATTERN .matcher (atomName );
1305- if (matcher .matches ()) {
1306- return ThreeState .NO ;
1307- }
1308- //check if it's a quoted atom name
1309- matcher = QUOTED_ATOM_NAME .matcher (atomName );
1310- if (matcher .matches ()) {
1311- return ThreeState .YES ;
1312- }
1313- //check if it's already quoted
1314- matcher = QUOTED_ATOM_NAME .matcher (StringUtil .unquoteString (atomName , '\'' ));
1315- if (matcher .matches ()) {
1316- return ThreeState .NO ;
1303+ try {
1304+ //check if it's a regular atom
1305+ Matcher matcher = ATOM_PATTERN .matcher (atomName );
1306+ if (matcher .matches ()) {
1307+ return ThreeState .NO ;
1308+ }
1309+ //check if it's a quoted atom name
1310+ matcher = QUOTED_ATOM_NAME .matcher (atomName );
1311+ if (matcher .matches ()) {
1312+ return ThreeState .YES ;
1313+ }
1314+ //check if it's already quoted
1315+ matcher = QUOTED_ATOM_NAME .matcher (StringUtil .unquoteString (atomName , '\'' ));
1316+ if (matcher .matches ()) {
1317+ return ThreeState .NO ;
1318+ }
1319+ }
1320+ catch (StackOverflowError e ) {
1321+ return ThreeState .UNSURE ;
13171322 }
13181323 return ThreeState .UNSURE ;
13191324 }
You can’t perform that action at this time.
0 commit comments