Skip to content

Instantly share code, notes, and snippets.

@lizmat
Created November 5, 2016 14:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lizmat/20c2c780b69e7af2b03ed86da3a55fea to your computer and use it in GitHub Desktop.
Save lizmat/20c2c780b69e7af2b03ed86da3a55fea to your computer and use it in GitHub Desktop.
start of mapping core setting line numbers to something sensible
diff --git a/src/core/core_prologue.pm b/src/core/core_prologue.pm
index defe6d8..c599f84 100644
--- a/src/core/core_prologue.pm
+++ b/src/core/core_prologue.pm
@@ -27,4 +27,18 @@ my constant Empty = nqp::p6bindattrinvres(nqp::create(Slip),
# The value for \n.
my constant $?NL = "\x0A";
+class SETTINGS {
+ my constant $core-files = nqp::list;
+ my constant $core-lines = nqp::list_i;
+ method FILE-LINE(\file,\line) {
+ nqp::push($core-files,file);
+ nqp::push_i($core-lines,line);
+ }
+
+ method EXPORT() {
+ PROCESS::<$SETTINGS-FILES> := $core-files;
+ PROCESS::<$SETTINGS-LINES> := $core-lines;
+ }
+}
+
# vim: ft=perl6 expandtab sw=4
diff --git a/src/core/traits.pm b/src/core/traits.pm
index d96f771..5d30501 100644
--- a/src/core/traits.pm
+++ b/src/core/traits.pm
@@ -1,3 +1,4 @@
+BEGIN SETTINGS.FILE-LINE("src/core/traits.pm",$?LINE);
# for errors
my class X::Inheritance::Unsupported { ... }
my class X::Inheritance::UnknownParent { ... }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment