diff --git a/lib/lrama/diagram.rb b/lib/lrama/diagram.rb
index 28679f55..304597a0 100644
--- a/lib/lrama/diagram.rb
+++ b/lib/lrama/diagram.rb
@@ -77,7 +77,7 @@ def template_file
end
def add_diagram(name, diagram, result)
- result << "\n
#{RailroadDiagrams.escape_html(name)}
"
+ result << "\n"
diagram.write_svg(result.method(:<<))
result << "\n"
end
diff --git a/sample/diagram.html b/sample/diagram.html
index 9e86cf6d..0eac7449 100644
--- a/sample/diagram.html
+++ b/sample/diagram.html
@@ -1,11 +1,14 @@
-
+
Lrama syntax diagrams
-
-
+
-$accept
-
-$@1
-
-option_terms
-
-compstmt_top_stmts
-
-program
-
-top_stmts
-
-top_stmt
-
-block_open
-
-begin_block
-
-compstmt_stmts
-
-$@2
-
-$@3
-
-bodystmt
-
-$@4
-
-stmts
-
-stmt_or_begin
-
-$@5
-
-allow_exits
-
-k_END
-
-$@6
-
-stmt
-
-asgn_lhs_mrhs
-
-asgn_lhs_command_rhs
-
-command_asgn
-
-op_asgn_command_rhs
-
-def_endless_method_endless_command
-
-endless_command
-
-option_'\n'
-
-command_rhs
-
-expr
-
-$@7
-
-$@8
-
-def_name
-
-defn_head
-
-$@9
-
-defs_head
-
-value_expr_expr
-
-expr_value
-
-$@10
-
-$@11
-
-expr_value_do
-
-command_call
-
-value_expr_command_call
-
-command_call_value
-
-block_command
-
-cmd_brace_block
-
-fcall
-
-command
-
-mlhs
-
-mlhs_inner
-
-mlhs_basic
-
-mlhs_item
-
-mlhs_head
-
-mlhs_post
-
-mlhs_node
-
-lhs
-
-cname
-
-cpath
-
-fname
-
-fitem
-
-undef_list
-
-$@12
-
-op
-
-reswords
-
-asgn_lhs_arg_rhs
-
-arg
-
-op_asgn_arg_rhs
-
-def_endless_method_endless_arg
-
-endless_arg
-
-relop
-
-rel_expr
-
-lex_ctxt
-
-begin_defined
-
-after_rescue
-
-value_expr_arg
-
-arg_value
-
-aref_args
-
-arg_rhs
-
-paren_args
-
-opt_paren_args
-
-opt_call_args
-
-value_expr_command
-
-call_args
-
-$@13
-
-command_args
-
-block_arg
-
-opt_block_arg
-
-args
-
-arg_splat
-
-mrhs_arg
-
-mrhs
-
-primary
-
-$@14
-
-$@15
-
-@16
-
-@17
-
-$@18
-
-$@19
-
-$@20
-
-$@21
-
-$@22
-
-$@23
-
-$@24
-
-value_expr_primary
-
-primary_value
-
-k_begin
-
-k_if
-
-k_unless
-
-k_while
-
-k_until
-
-k_case
-
-k_for
-
-k_class
-
-k_module
-
-k_def
-
-k_do
-
-k_do_block
-
-k_rescue
-
-k_ensure
-
-k_when
-
-k_else
-
-k_elsif
-
-k_end
-
-k_return
-
-k_yield
-
-then
-
-do
-
-if_tail
-
-opt_else
-
-for_var
-
-f_marg
-
-f_marg_list
-
-f_margs
-
-f_rest_marg
-
-f_any_kwrest
-
-$@25
-
-f_eq
-
-f_kw_primary_value
-
-f_kwarg_primary_value
-
-block_args_tail
-
-excessed_comma
-
-f_opt_primary_value
-
-f_optarg_primary_value
-
-opt_args_tail_block_args_tail
-
-block_param
-
-opt_block_param
-
-block_param_def
-
-opt_bv_decl
-
-bv_decls
-
-bvar
-
-max_numparam
-
-numparam
-
-it_id
-
-@26
-
-$@27
-
-lambda
-
-f_larglist
-
-lambda_body
-
-$@28
-
-do_block
-
-block_call
-
-method_call
-
-brace_block
-
-@29
-
-brace_body
-
-@30
-
-do_body
-
-case_args
-
-case_body
-
-cases
-
-p_pvtbl
-
-p_pktbl
-
-p_in_kwarg
-
-$@31
-
-p_case_body
-
-p_cases
-
-p_top_expr
-
-p_top_expr_body
-
-p_expr
-
-p_as
-
-p_alt
-
-p_lparen
-
-p_lbracket
-
-p_expr_basic
-
-$@32
-
-p_args
-
-p_args_head
-
-p_args_tail
-
-p_find
-
-p_rest
-
-p_args_post
-
-p_arg
-
-p_kwargs
-
-p_kwarg
-
-p_kw
-
-p_kw_label
-
-p_kwrest
-
-p_kwnorest
-
-p_any_kwrest
-
-p_value
-
-p_primitive
-
-value_expr_p_primitive
-
-p_primitive_value
-
-p_variable
-
-p_var_ref
-
-p_expr_ref
-
-p_const
-
-opt_rescue
-
-exc_list
-
-exc_var
-
-opt_ensure
-
-literal
-
-strings
-
-string
-
-string1
-
-xstring
-
-regexp
-
-nonempty_list_' '
-
-words_tWORDS_BEG_word_list
-
-words
-
-word_list
-
-word
-
-words_tSYMBOLS_BEG_symbol_list
-
-symbols
-
-symbol_list
-
-words_tQWORDS_BEG_qword_list
-
-qwords
-
-words_tQSYMBOLS_BEG_qsym_list
-
-qsymbols
-
-qword_list
-
-qsym_list
-
-string_contents
-
-xstring_contents
-
-regexp_contents
-
-string_content
-
-@33
-
-@34
-
-@35
-
-@36
-
-string_dend
-
-string_dvar
-
-symbol
-
-ssym
-
-sym
-
-dsym
-
-numeric
-
-simple_numeric
-
-nonlocal_var
-
-user_variable
-
-keyword_variable
-
-var_ref
-
-var_lhs
-
-backref
-
-$@37
-
-superclass
-
-f_opt_paren_args
-
-f_paren_args
-
-f_arglist
-
-@38
-
-f_kw_arg_value
-
-f_kwarg_arg_value
-
-args_tail
-
-f_opt_arg_value
-
-f_optarg_arg_value
-
-opt_args_tail_args_tail
-
-f_args
-
-args_forward
-
-f_bad_arg
-
-f_norm_arg
-
-f_arg_asgn
-
-f_arg_item
-
-f_arg
-
-f_label
-
-kwrest_mark
-
-f_no_kwarg
-
-f_kwrest
-
-restarg_mark
-
-f_rest_arg
-
-blkarg_mark
-
-f_block_arg
-
-opt_f_block_arg
-
-value_expr_var_ref
-
-singleton
-
-$@39
-
-assoc_list
-
-assocs
-
-assoc
-
-operation
-
-operation2
-
-operation3
-
-dot_or_colon
-
-call_op
-
-call_op2
-
-rparen
-
-rbracket
-
-rbrace
-
-trailer
-
-term
-
-terms
-
-none
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
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+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/spec/lrama/diagram_spec.rb b/spec/lrama/diagram_spec.rb
index a5c5fece..10f532df 100644
--- a/spec/lrama/diagram_spec.rb
+++ b/spec/lrama/diagram_spec.rb
@@ -21,8 +21,8 @@
describe ".render" do
it "renders a diagram" do
expect { Lrama::Diagram.render(out: out, grammar: grammar) }.not_to raise_error
- expect(out.string).to include("$accept
")
- expect(out.string).to include("unused
")
+ expect(out.string).to include('')
+ expect(out.string).to include('')
expect(out.string).to include("