Skip to content

Commit

Permalink
--no-source-mapping switch to disable line directives
Browse files Browse the repository at this point in the history
  • Loading branch information
lhstrh committed Nov 12, 2023
1 parent cc5f9c0 commit 60b3a10
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 0 deletions.
8 changes: 8 additions & 0 deletions cli/lfc/src/main/java/org/lflang/cli/Lfc.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import org.lflang.target.property.CompilerProperty;
import org.lflang.target.property.LoggingProperty;
import org.lflang.target.property.NoCompileProperty;
import org.lflang.target.property.NoSourceMappingProperty;
import org.lflang.target.property.PrintStatisticsProperty;
import org.lflang.target.property.RuntimeVersionProperty;
import org.lflang.target.property.SchedulerProperty;
Expand Down Expand Up @@ -146,6 +147,12 @@ public class Lfc extends CliBase {
description = "Specify whether to enable run-time tracing (if supported).")
private Boolean tracing;

@Option(
names = {"--no-source-mapping"},
arity = "0",
description = "Do not map lines in generated code to LF sources.")
private Boolean noSourceMapping;

/** Mutually exclusive options related to threading. */
static class ThreadingMutuallyExclusive {
@Option(
Expand Down Expand Up @@ -374,6 +381,7 @@ public GeneratorArguments getArgs() {
new Argument<>(LoggingProperty.INSTANCE, getLogging()),
new Argument<>(PrintStatisticsProperty.INSTANCE, printStatistics),
new Argument<>(NoCompileProperty.INSTANCE, noCompile),
new Argument<>(NoSourceMappingProperty.INSTANCE, noSourceMapping),
new Argument<>(VerifyProperty.INSTANCE, verify),
new Argument<>(RuntimeVersionProperty.INSTANCE, runtimeVersion),
new Argument<>(SchedulerProperty.INSTANCE, getScheduler()),
Expand Down
3 changes: 3 additions & 0 deletions core/src/main/java/org/lflang/target/Target.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
import org.lflang.target.property.FilesProperty;
import org.lflang.target.property.KeepaliveProperty;
import org.lflang.target.property.NoRuntimeValidationProperty;
import org.lflang.target.property.NoSourceMappingProperty;
import org.lflang.target.property.PlatformProperty;
import org.lflang.target.property.PrintStatisticsProperty;
import org.lflang.target.property.ProtobufsProperty;
Expand Down Expand Up @@ -598,6 +599,7 @@ public void initialize(TargetConfig config) {
DockerProperty.INSTANCE,
FilesProperty.INSTANCE,
KeepaliveProperty.INSTANCE,
NoSourceMappingProperty.INSTANCE,
PlatformProperty.INSTANCE,
ProtobufsProperty.INSTANCE,
SchedulerProperty.INSTANCE,
Expand Down Expand Up @@ -631,6 +633,7 @@ public void initialize(TargetConfig config) {
DockerProperty.INSTANCE,
FilesProperty.INSTANCE,
KeepaliveProperty.INSTANCE,
NoSourceMappingProperty.INSTANCE,
ProtobufsProperty.INSTANCE,
SchedulerProperty.INSTANCE,
SingleThreadedProperty.INSTANCE,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package org.lflang.target.property;

/** Directive to allow including OpenSSL libraries and process HMAC authentication. */
public final class NoSourceMappingProperty extends BooleanProperty {

/** Singleton target property instance. */
public static final NoSourceMappingProperty INSTANCE = new NoSourceMappingProperty();

private NoSourceMappingProperty() {
super();
}

@Override
public String name() {
return "no-source-mapping";
}
}

0 comments on commit 60b3a10

Please sign in to comment.