Skip to content

Commit

Permalink
united CHORD_SEPARATOR and PATTERN_INDEX_SEP
Browse files Browse the repository at this point in the history
- removed PATTERN_INDEX_SEP completely
- #83
  • Loading branch information
truj committed Dec 27, 2023
1 parent 6ec370e commit 4dd50eb
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 11 deletions.
Binary file modified midica.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion src/org/midica/Midica.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public class Midica {
private static final int VERSION_MINOR = 11;

/** UNIX timestamp of the last commit */
public static final int COMMIT_TIME = 1703688733;
public static final int COMMIT_TIME = 1703690090;

/** Branch name. Automatically changed by precommit.pl */
public static final String BRANCH = "sound-effects";
Expand Down
6 changes: 1 addition & 5 deletions src/org/midica/config/Dict.java
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ public class Dict {
public static final String SYNTAX_BLOCK_CLOSE = "BLOCK_CLOSE";
public static final String SYNTAX_FUNCTION = "FUNCTION";
public static final String SYNTAX_PATTERN = "PATTERN";
public static final String SYNTAX_PATTERN_INDEX_SEP = "PATTERN_INDEX_SEP";
public static final String SYNTAX_PARAM_OPEN = "PARAM_OPEN";
public static final String SYNTAX_PARAM_CLOSE = "PARAM_CLOSE";
public static final String SYNTAX_PARAM_SEPARATOR = "PARAM_SEPARATOR";
Expand Down Expand Up @@ -2864,7 +2863,6 @@ private static void initLanguageEnglish() {
set( SYNTAX_BLOCK_CLOSE, "closes a nestable block" );
set( SYNTAX_FUNCTION, "function definition" );
set( SYNTAX_PATTERN, "pattern definition" );
set( SYNTAX_PATTERN_INDEX_SEP, "index separator inside of a pattern definition" );
set( SYNTAX_PARAM_OPEN, "opens a parameter list (in a function or pattern call)" );
set( SYNTAX_PARAM_CLOSE, "closes a parameter list (in a function or pattern call)" );
set( SYNTAX_PARAM_SEPARATOR, "separates parameters in a function or pattern call" );
Expand Down Expand Up @@ -2935,7 +2933,7 @@ private static void initLanguageEnglish() {
set( SYNTAX_REST, "rest character" );
set( SYNTAX_CHORD, "chord definition" );
set( SYNTAX_CHORD_ASSIGNER, "assign symbol between chord name and notes" );
set( SYNTAX_CHORD_SEPARATOR, "separator for chord notes" );
set( SYNTAX_CHORD_SEPARATOR, "separator for chord notes (or pattern indices)" );
set( SYNTAX_INCLUDE, "including another file" );
set( SYNTAX_SOUNDBANK, "including a soundbank file or URL (SF2 or DLS)" );
set( SYNTAX_SOUNDFONT, "Deprecated. Will be removed in a future Version" );
Expand Down Expand Up @@ -4247,7 +4245,6 @@ public static void initSyntax() {
setSyntax( SYNTAX_BLOCK_CLOSE, "}" );
setSyntax( SYNTAX_FUNCTION, "FUNCTION" );
setSyntax( SYNTAX_PATTERN, "PATTERN" );
setSyntax( SYNTAX_PATTERN_INDEX_SEP, "/" );
setSyntax( SYNTAX_PARAM_OPEN, "(" );
setSyntax( SYNTAX_PARAM_CLOSE, ")" );
setSyntax( SYNTAX_PARAM_SEPARATOR, "," );
Expand Down Expand Up @@ -4421,7 +4418,6 @@ else if (Config.CBX_SYNTAX_UPPER.equals(configuredSyntax)) {
addSyntaxForInfoView( SYNTAX_FUNCTION );
addSyntaxForInfoView( SYNTAX_END );
addSyntaxForInfoView( SYNTAX_PATTERN );
addSyntaxForInfoView( SYNTAX_PATTERN_INDEX_SEP );
addSyntaxForInfoView( SYNTAX_CHORD );
addSyntaxForInfoView( SYNTAX_CHORD_ASSIGNER );
addSyntaxForInfoView( SYNTAX_CHORD_SEPARATOR );
Expand Down
7 changes: 2 additions & 5 deletions src/org/midica/file/read/MidicaPLParser.java
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,6 @@ public class MidicaPLParser extends SequenceParser {
public static String LYRICS_COMMA = null;
public static String FUNCTION = null;
public static String PATTERN = null;
public static String PATTERN_INDEX_SEP = null;
public static String PARAM_OPEN = null;
public static String PARAM_CLOSE = null;
public static String PARAM_SEPARATOR = null;
Expand Down Expand Up @@ -459,7 +458,6 @@ public static void refreshSyntax() {
LYRICS_COMMA = Dict.getSyntax( Dict.SYNTAX_LYRICS_COMMA );
FUNCTION = Dict.getSyntax( Dict.SYNTAX_FUNCTION );
PATTERN = Dict.getSyntax( Dict.SYNTAX_PATTERN );
PATTERN_INDEX_SEP = Dict.getSyntax( Dict.SYNTAX_PATTERN_INDEX_SEP );
PARAM_OPEN = Dict.getSyntax( Dict.SYNTAX_PARAM_OPEN );
PARAM_CLOSE = Dict.getSyntax( Dict.SYNTAX_PARAM_CLOSE );
PARAM_SEPARATOR = Dict.getSyntax( Dict.SYNTAX_PARAM_SEPARATOR );
Expand Down Expand Up @@ -2940,7 +2938,7 @@ private String patternIndicesToChord(String indicesStr, Integer[] noteNumbers) t
ArrayList<String> notes = new ArrayList<>();

// note or chord
String[] indexStrings = indicesStr.split(Pattern.quote(PATTERN_INDEX_SEP), -1);
String[] indexStrings = indicesStr.split(Pattern.quote(CHORD_SEPARATOR), -1);
for (String indexStr : indexStrings) {
try {
int index = Integer.parseInt(indexStr);
Expand Down Expand Up @@ -3123,7 +3121,7 @@ else if (0 == tokens.length) {
* @throws ParseException
*/
private void checkPatternIndices(String indicesStr) throws ParseException {
String[] indexStrings = indicesStr.split(Pattern.quote(PATTERN_INDEX_SEP), -1);
String[] indexStrings = indicesStr.split(Pattern.quote(CHORD_SEPARATOR), -1);
for (String indexStr : indexStrings) {
try {
Integer.parseInt(indexStr);
Expand Down Expand Up @@ -3697,7 +3695,6 @@ else if (3 == tokens.length) {
else if ( Dict.SYNTAX_LYRICS_COMMA.equals(cmdId) ) LYRICS_COMMA = cmdName;
else if ( Dict.SYNTAX_FUNCTION.equals(cmdId) ) FUNCTION = cmdName;
else if ( Dict.SYNTAX_PATTERN.equals(cmdId) ) PATTERN = cmdName;
else if ( Dict.SYNTAX_PATTERN_INDEX_SEP.equals(cmdId) ) PATTERN_INDEX_SEP = cmdName;
else if ( Dict.SYNTAX_PARAM_OPEN.equals(cmdId) ) PARAM_OPEN = cmdName;
else if ( Dict.SYNTAX_PARAM_CLOSE.equals(cmdId) ) PARAM_CLOSE = cmdName;
else if ( Dict.SYNTAX_PARAM_SEPARATOR.equals(cmdId) ) PARAM_SEPARATOR = cmdName;
Expand Down

0 comments on commit 4dd50eb

Please sign in to comment.