Commit cce27ad9 authored by Matthew Dawson's avatar Matthew Dawson
Browse files

Fix the matlab parser breaking horribly on case sensitive systems.

Due to how the matlab grammar was setup, things would break horribly on systems
with case sensitive file names.  This occurred as some elements had names
differing only by case, which both Antlr and Java were fine with, but relied
on the system have case insensitive file names.  Mac/Windows would thus break
in most cases, along with Dropbox.

Fix by removing these names.  I don't use them, and the one useful case is
handled differently, which shouldn't cause issues in the future.
parent 557ce54d
Loading
Loading
Loading
Loading
+18 −15
Original line number Diff line number Diff line
@@ -182,21 +182,24 @@ parameter_list
// newline vs. a semicolon, so we have to remember the appropriate token in the AST.

statement
	: lhs EQ rhs nlosoc #ASSIGNMENT
	| expression nlosoc #EXPRESSION
	| if_statement #IF_STATEMENT
	| for_statement #FOR_STATEMENT
	| while_statement #WHILE_STATEMENT
	| switch_statement #SWITCH_STATEMENT
	| try_statement #TRY_STATEMENT
	| return_statement #RETURN_STATEMENT
	| break_statement #BREAK_STATEMENT
	| continue_statement #CONTINUE_STATEMENT
	| clear_statement # CLEAR_STATEMENT
	| global_statement #GLOBAL_STATEMENT
	| persistent_statement #PERSISTENT_STATEMENT
	| SEMI # NULL_STMT // a null statement
	;
	: assignment nlosoc
	| expression nlosoc
	| if_statement
	| for_statement
	| while_statement
	| switch_statement
	| try_statement
	| return_statement
	| break_statement
	| continue_statement
	| clear_statement
	| global_statement
	| persistent_statement
	| SEMI // a null statement
	;

// Add an assignment statement.  This avoids some ugliness regarding case sensitive file systems.
assignment: lhs EQ rhs;

nlosoc	: ( hidden_nl | SEMI | COMMA );