File tree Expand file tree Collapse file tree 1 file changed +21
-4
lines changed Expand file tree Collapse file tree 1 file changed +21
-4
lines changed Original file line number Diff line number Diff line change @@ -932,14 +932,31 @@ void verilog_indexer_parsert::rConstraint()
932932 next_token (); // static
933933 }
934934
935- next_token (); // constraint
935+ auto constraint_token = next_token (); // constraint
936+ PRECONDITION (constraint_token == TOK_CONSTRAINT);
936937
937938 next_token (); // identifier
938939
939- if (next_token () != ' {' ) // onstraint_block
940- return ; // error
940+ // constraint_block
941+ auto first = next_token ();
942+ if (first != ' {' )
943+ return ; // error
944+ std::size_t count = 1 ;
941945
942- skip_until (' }' );
946+ while (true )
947+ {
948+ auto token = next_token ();
949+ if (token.is_eof ())
950+ return ;
951+ else if (token == ' {' )
952+ count++;
953+ else if (token == ' }' )
954+ {
955+ if (count == 1 )
956+ return ;
957+ count--;
958+ }
959+ }
943960}
944961
945962void verilog_indexer_parsert::rContinuousAssign ()
You can’t perform that action at this time.
0 commit comments