Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev #485

Merged
merged 22 commits into from
Sep 15, 2024
Merged

Dev #485

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion _scripts/publish.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/bash
version=0.23.4
version=0.23.5
cd src
exes=`find . -name 'tr*.exe' | grep -v publish`
for i in $exes
Expand Down
6 changes: 3 additions & 3 deletions _scripts/set-version.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/bash
version="0.23.4"
version="0.23.5"
cd src
directories=`find . -maxdepth 1 -type d -name "tr*"`
cwd=`pwd`
Expand Down Expand Up @@ -41,7 +41,7 @@ do
mv asdfasdf *.csproj
rm -f asdfasdf2
touch readme.md
cat readme.md | sed -e 's%^0[.][0-9]*[.][0-9]*.*$'"%$version"' Add scripts for syntactic highlighting as default for trgenvsc.%' > asdfasdf2
cat readme.md | sed -e 's%^0[.][0-9]*[.][0-9]*.*$'"%$version"' Add --ambig option to trparse. Add file names to trtree. Add new output styles for trtree. Update packages for trgenvsc templates.%' > asdfasdf2
mv asdfasdf2 readme.md
cd ..
done
Expand Down Expand Up @@ -78,7 +78,7 @@ do
mv asdfasdf *.csproj
rm -f asdfasdf2
touch readme.md
cat readme.md | sed -e 's%^0[.][0-9]*[.][0-9]*.*$'"%$version"' Add scripts for syntactic highlighting as default for trgenvsc.%' > asdfasdf2
cat readme.md | sed -e 's%^0[.][0-9]*[.][0-9]*.*$'"%$version"' Add --ambig option to trparse. Add file names to trtree. Add new output styles for trtree. Update packages for trgenvsc templates.%' > asdfasdf2
mv asdfasdf2 readme.md
cd ..
done
Expand Down
6 changes: 3 additions & 3 deletions _tests/basic-trees/Gold/trparse.tree
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

( s
( e
( e
Expand All @@ -8,7 +7,7 @@
) ) )
( Attribute Skip Value ' '
)
(
( T__3
( text:'+' tt:0 chnl:DEFAULT_TOKEN_CHANNEL
) )
( e
Expand All @@ -19,7 +18,7 @@
) ) ) )
( Attribute Skip Value ' '
)
(
( T__3
( text:'+' tt:0 chnl:DEFAULT_TOKEN_CHANNEL
) )
( e
Expand All @@ -35,3 +34,4 @@
) ) )



6 changes: 3 additions & 3 deletions _tests/basic-trees/trparse.tree
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

( s
( e
( e
Expand All @@ -8,7 +7,7 @@
) ) )
( Attribute Skip Value ' '
)
(
( T__3
( text:'+' tt:0 chnl:DEFAULT_TOKEN_CHANNEL
) )
( e
Expand All @@ -19,7 +18,7 @@
) ) ) )
( Attribute Skip Value ' '
)
(
( T__3
( text:'+' tt:0 chnl:DEFAULT_TOKEN_CHANNEL
) )
( e
Expand All @@ -35,3 +34,4 @@
) ) )



2 changes: 1 addition & 1 deletion _tests/delete/Gold/delete.tree
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

( grammarSpec
( grammarDecl
( grammarType
Expand Down Expand Up @@ -512,3 +511,4 @@
) ) )



13 changes: 13 additions & 0 deletions _tests/xgrep/Gold/output
Original file line number Diff line number Diff line change
@@ -1 +1,14 @@
( INT
( text:'1' tt:0 chnl:DEFAULT_TOKEN_CHANNEL
) )

( INT
( text:'2' tt:0 chnl:DEFAULT_TOKEN_CHANNEL
) )

( INT
( text:'3' tt:0 chnl:DEFAULT_TOKEN_CHANNEL
) )



13 changes: 13 additions & 0 deletions _tests/xgrep/output
Original file line number Diff line number Diff line change
@@ -1 +1,14 @@
( INT
( text:'1' tt:0 chnl:DEFAULT_TOKEN_CHANNEL
) )

( INT
( text:'2' tt:0 chnl:DEFAULT_TOKEN_CHANNEL
) )

( INT
( text:'3' tt:0 chnl:DEFAULT_TOKEN_CHANNEL
) )



4 changes: 2 additions & 2 deletions _tests/xgrep/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ rm -rf Generated-CSharp
trgen -t CSharp
cd Generated-CSharp
make
echo "1 + 2 + 3" | trparse | trquery grep ' //SCIENTIFIC_NUMBER' | trtree > ../output
echo "1 + 2 + 3" | trparse | trquery grep ' //INT' | trtree > ../output
cd ..
rm -rf Generated-CSharp
#rm -rf Generated-CSharp

# Diff result.
for i in output Gold/output
Expand Down
12 changes: 12 additions & 0 deletions src/ParseTreeEditing/UnvParseTreeDOM/ConvertToDOM.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,18 @@ public UnvParseTreeElement BottomUpConvert(IParseTree tree, UnvParseTreeElement
Interval interval = t.SourceInterval;
new_node.NodeType = NodeConstants.ELEMENT_NODE;
var fixed_name = parser.Vocabulary.GetSymbolicName(t.Symbol.Type);
if (fixed_name == null)
{
try
{
var xxxxx = lexer.RuleNames[t.Symbol.Type];
fixed_name = xxxxx;
}
catch (System.Exception)
{
fixed_name = "Unknown";
}
}
new_node.LocalName = fixed_name;
var nl = new UnvParseTreeNodeList();
new_node.ChildNodes = nl;
Expand Down
Loading
Loading