@Test public void testParser_10() throws Exception { ExportedVariablesParser parser = new ExportedVariablesParser(); parser.parse( "ip, path1 = \"this path1, contains, commas('#') and special characters!*.\", path = \"test with ; a semicolon\" ", this.folder.newFile(), 1 ); Assert.assertEquals( 0, parser.errors.size()); Assert.assertEquals( 3, parser.rawNameToVariables.size()); Assert.assertEquals( "test with ; a semicolon", parser.rawNameToVariables.get( "path" )); Assert.assertEquals( "this path1, contains, commas('#') and special characters!*.", parser.rawNameToVariables.get( "path1" )); Assert.assertTrue( parser.rawNameToVariables.containsKey( "ip" )); Assert.assertNull( parser.rawNameToVariables.get( "ip" )); }
public void parse( String line, File sourceFile, int lineNumber ) { this.rawNameToVariables.clear(); this.errors.clear(); this.cursor = 0; while( this.cursor < line.length()) { char c = line.charAt( this.cursor ); if( Character.isWhitespace( c ) || c == ',' ) this.cursor ++; recognizeVariable( line, sourceFile, lineNumber ); } }
ExportedVariablesParser { public void parse( String line, File sourceFile, int lineNumber ) { this.rawNameToVariables.clear(); this.errors.clear(); this.cursor = 0; while( this.cursor < line.length()) { char c = line.charAt( this.cursor ); if( Character.isWhitespace( c ) || c == ',' ) this.cursor ++; recognizeVariable( line, sourceFile, lineNumber ); } } }
ExportedVariablesParser { public void parse( String line, File sourceFile, int lineNumber ) { this.rawNameToVariables.clear(); this.errors.clear(); this.cursor = 0; while( this.cursor < line.length()) { char c = line.charAt( this.cursor ); if( Character.isWhitespace( c ) || c == ',' ) this.cursor ++; recognizeVariable( line, sourceFile, lineNumber ); } }  }
ExportedVariablesParser { public void parse( String line, File sourceFile, int lineNumber ) { this.rawNameToVariables.clear(); this.errors.clear(); this.cursor = 0; while( this.cursor < line.length()) { char c = line.charAt( this.cursor ); if( Character.isWhitespace( c ) || c == ',' ) this.cursor ++; recognizeVariable( line, sourceFile, lineNumber ); } }  void parse( String line, File sourceFile, int lineNumber ); }
ExportedVariablesParser { public void parse( String line, File sourceFile, int lineNumber ) { this.rawNameToVariables.clear(); this.errors.clear(); this.cursor = 0; while( this.cursor < line.length()) { char c = line.charAt( this.cursor ); if( Character.isWhitespace( c ) || c == ',' ) this.cursor ++; recognizeVariable( line, sourceFile, lineNumber ); } }  void parse( String line, File sourceFile, int lineNumber ); final Map<String,String> rawNameToVariables; final List<ParsingError> errors; }