From 44a37bfed600762a9845bb705cc86a61068e965c Mon Sep 17 00:00:00 2001 From: ydah <13041216+ydah@users.noreply.github.com> Date: Sat, 7 Oct 2023 02:29:03 +0900 Subject: [PATCH] Move to the end of prologue --- lib/lrama/new_parser.rb | 2 +- parser.y | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/lrama/new_parser.rb b/lib/lrama/new_parser.rb index 5e970e99..4e8676f8 100644 --- a/lib/lrama/new_parser.rb +++ b/lib/lrama/new_parser.rb @@ -45,7 +45,7 @@ def build_token(type:, s_value:, line:, column:, alias_name: nil) def prologue(s_value) if @header_path && !s_value.match?(/^\s*#include\s+"#{@header_path}"/) - "\n#include \"#{@header_path}\"\n" + s_value + s_value + "\n#include \"#{@header_path}\"\n" else s_value end diff --git a/parser.y b/parser.y index bd22f886..3a9f9523 100644 --- a/parser.y +++ b/parser.y @@ -154,7 +154,7 @@ end def prologue(s_value) if @header_path && !s_value.match?(/^\s*#include\s+"#{@header_path}"/) - "\n#include \"#{@header_path}\"\n" + s_value + s_value + "\n#include \"#{@header_path}\"\n" else s_value end