Skip to content

Commit

Permalink
String functions moved to Petit Poucet
Browse files Browse the repository at this point in the history
  • Loading branch information
sylvainhalle committed Dec 26, 2021
1 parent 4676594 commit 804fb2e
Show file tree
Hide file tree
Showing 10 changed files with 24 additions and 284 deletions.
8 changes: 2 additions & 6 deletions Source/Core/src/ca/uqac/lif/textidote/as/AnnotatedString.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,12 @@
import ca.uqac.lif.petitpoucet.function.ExplanationQueryable;
import ca.uqac.lif.petitpoucet.function.NthInput;
import ca.uqac.lif.petitpoucet.function.NthOutput;
import ca.uqac.lif.petitpoucet.function.strings.InsertAt;
import ca.uqac.lif.petitpoucet.function.strings.Range;
import ca.uqac.lif.petitpoucet.function.strings.RangeMapping;
import ca.uqac.lif.petitpoucet.function.strings.RangeMapping.RangePair;
import ca.uqac.lif.petitpoucet.function.strings.Remove;
import ca.uqac.lif.petitpoucet.function.strings.RemoveLine;
import ca.uqac.lif.petitpoucet.function.strings.Replace;
import ca.uqac.lif.petitpoucet.function.strings.StringMappingFunction;
import ca.uqac.lif.petitpoucet.function.strings.Substring;
Expand Down Expand Up @@ -212,12 +214,6 @@ public AnnotatedString()
this("");
}

public AnnotatedString(Line l)
{
this(l.toString());
m_operations.add(new Shift(l.getOffset()));
}

/**
* Gets the length of the string.
* @return The length of the string
Expand Down
73 changes: 0 additions & 73 deletions Source/Core/src/ca/uqac/lif/textidote/as/InsertAt.java

This file was deleted.

5 changes: 2 additions & 3 deletions Source/Core/src/ca/uqac/lif/textidote/as/Match.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,8 @@
import java.util.List;

/**
* Represents a match by a regular expression find
* @author sylvain
*
* Represents a match by a regular expression find.
* @author Sylvain Hallé
*/
public class Match
{
Expand Down
19 changes: 18 additions & 1 deletion Source/Core/src/ca/uqac/lif/textidote/as/RangeFetcher.java
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
/*
TeXtidote, a linter for LaTeX documents
Copyright (C) 2018-2021 Sylvain Hallé
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package ca.uqac.lif.textidote.as;

import java.util.ArrayList;
Expand All @@ -18,7 +35,7 @@ class RangeFetcher extends Crawler
/**
* The ranges found in leaf nodes.
*/
/*@ non_null @*/ protected List<Range> m_ranges;
/*@ non_null @*/ protected final List<Range> m_ranges;

/**
* Creates a new range fetcher.
Expand Down
107 changes: 0 additions & 107 deletions Source/Core/src/ca/uqac/lif/textidote/as/RemoveLine.java

This file was deleted.

22 changes: 0 additions & 22 deletions Source/Core/src/ca/uqac/lif/textidote/as/Shift.java

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@

import ca.uqac.lif.textidote.as.AnnotatedString;
import ca.uqac.lif.textidote.as.Match;
import ca.uqac.lif.textidote.as.Position;
import ca.uqac.lif.textidote.as.AnnotatedString.Line;
import ca.uqac.lif.textidote.cleaning.TextCleaner;
import ca.uqac.lif.textidote.cleaning.TextCleanerException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ protected static String highlightLatex(String s)
s = s.replaceAll("\\\\(textbf|emph|textit|section|subsection|subsubsection|paragraph|includegraphics|caption|label|maketitle|documentclass|item|documentclass|usepackage|title)", "<span class=\"keyword1\">\\\\$1</span>");
s = s.replaceAll("\\\\(begin|end)(\\{.*?\\})", "<span class=\"keyword2\">\\\\$1$2</span>");
s = s.replaceAll("(?m)^(%.*?)$", "<span class=\"comment\">$1</span>");
//s = s.replaceAll("(?m)([^\\\\])(%.*?)$", "$1<span class=\"comment\">$2</span>");
s = s.replaceAll("(?m)([^\\\\])(%.*?)$", "$1<span class=\"comment\">$2</span>");
return s;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<hr/>
Output produced by TeXtidote v0.8.2, &copy; 2018-2020 Sylvain Hall&eacute; - All rights reserved.<br/>
Output produced by TeXtidote v0.8.4, &copy; 2018-2022 Sylvain Hall&eacute; - All rights reserved.<br/>
See the <a href="https://sylvainhalle.github.io/textidote">TeXtidote website</a> for more information.
</body>
</html>
69 changes: 0 additions & 69 deletions Source/CoreTest/src/ca/uqac/lif/textidote/as/InsertAtTest.java

This file was deleted.

0 comments on commit 804fb2e

Please sign in to comment.