fix a problem with the plugin's parser

cvs
Slava Pestov 2005-02-23 04:14:56 +00:00
parent 6b9133bf30
commit 2526a1b9b5
1 changed files with 10 additions and 1 deletions

View File

@ -41,12 +41,21 @@ public class BeginConstructor extends FactorParsingDefinition
public void eval(FactorReader reader)
throws Exception
{
// remember the position before the word name
FactorScanner scanner = reader.getScanner();
int line = scanner.getLineNumber();
int col = scanner.getColumnNumber();
FactorWord type = reader.nextWord(false);
if(type == null)
return;
reader.intern("<" + type + ">",true);
reader.addArtifact(new ConstructorArtifact(type));
ConstructorArtifact artifact = new ConstructorArtifact(type);
artifact.setFile(scanner.getFileName());
artifact.setLine(line);
artifact.setColumn(col);
reader.addArtifact(artifact);
reader.pushExclusiveState(word,type);
}
}