diff --git a/build/CodeLite/Notepad4.project b/build/CodeLite/Notepad4.project
index 3fffc493d6..b592264d3f 100644
--- a/build/CodeLite/Notepad4.project
+++ b/build/CodeLite/Notepad4.project
@@ -40,6 +40,7 @@
+
@@ -229,6 +230,7 @@
+
diff --git a/build/VisualStudio/Notepad4.vcxproj b/build/VisualStudio/Notepad4.vcxproj
index 2fea4b4c83..a620da3503 100644
--- a/build/VisualStudio/Notepad4.vcxproj
+++ b/build/VisualStudio/Notepad4.vcxproj
@@ -478,6 +478,7 @@
+
@@ -609,6 +610,7 @@
+
diff --git a/build/VisualStudio/Notepad4.vcxproj.filters b/build/VisualStudio/Notepad4.vcxproj.filters
index df6e6321a4..7f6c4ccec3 100644
--- a/build/VisualStudio/Notepad4.vcxproj.filters
+++ b/build/VisualStudio/Notepad4.vcxproj.filters
@@ -105,6 +105,9 @@
Scintilla\lexers
+
+ Scintilla\lexers
+
Scintilla\lexers
@@ -498,6 +501,9 @@
Source Files\EditLexers
+
+ Source Files\EditLexers
+
Source Files\EditLexers
diff --git a/scintilla/include/SciLexer.h b/scintilla/include/SciLexer.h
index 8824d7b610..10a503365c 100644
--- a/scintilla/include/SciLexer.h
+++ b/scintilla/include/SciLexer.h
@@ -98,6 +98,7 @@
#define SCLEX_MATHEMATICA 225
#define SCLEX_WINHEX 226
#define SCLEX_CANGJIE 227
+#define SCLEX_GEOGEBRA 228
#define SCLEX_AUTOMATIC 1000
#define SCE_PY_DEFAULT 0
#define SCE_PY_COMMENTLINE 1
@@ -1904,4 +1905,14 @@
#define SCE_CANGJIE_ENUM 29
#define SCE_CANGJIE_FUNCTION_DEFINITION 30
#define SCE_CANGJIE_FUNCTION 31
+#define SCE_GGB_DEFAULT 0
+#define SCE_GGB_COMMENTLINE 1
+#define SCE_GGB_TASKMARKER 2
+#define SCE_GGB_OPERATOR 3
+#define SCE_GGB_NUMBER 4
+#define SCE_GGB_IDENTIFIER 5
+#define SCE_GGB_WORD 6
+#define SCE_GGB_CONSTANT 7
+#define SCE_GGB_INNERFUNCTION 8
+#define SCE_GGB_FUNCTION 9
/* --Autogenerated -- end of section automatically generated from SciLexer.iface */
diff --git a/scintilla/include/SciLexer.iface b/scintilla/include/SciLexer.iface
index 6c2d88ab4d..e8402ffc9e 100644
--- a/scintilla/include/SciLexer.iface
+++ b/scintilla/include/SciLexer.iface
@@ -179,6 +179,7 @@ val SCLEX_CSV=223
val SCLEX_MATHEMATICA=225
val SCLEX_WINHEX=226
val SCLEX_CANGJIE=227
+val SCLEX_GEOGEBRA=228
# When a lexer specifies its language as SCLEX_AUTOMATIC it receives a
# value assigned in sequence from SCLEX_AUTOMATIC+1.
@@ -3221,3 +3222,15 @@ val SCE_CANGJIE_INTERFACE=
val SCE_CANGJIE_ENUM=
val SCE_CANGJIE_FUNCTION_DEFINITION=
val SCE_CANGJIE_FUNCTION=
+# Lexical states for SCLEX_GEOGEGRA
+lex Geogebra=SCLEX_GEOGEGRA SCE_GGB_
+val SCE_GGB_DEFAULT=
+val SCE_GGB_COMMENTLINE=
+val SCE_GGB_TASKMARKER=
+val SCE_GGB_OPERATOR=
+val SCE_GGB_NUMBER=
+val SCE_GGB_IDENTIFIER=
+val SCE_GGB_WORD=
+val SCE_GGB_CONSTANT=
+val SCE_GGB_INNERFUNCTION=
+val SCE_GGB_FUNCTION=
diff --git a/scintilla/lexers/LexGeogebra.cxx b/scintilla/lexers/LexGeogebra.cxx
new file mode 100644
index 0000000000..5349505510
--- /dev/null
+++ b/scintilla/lexers/LexGeogebra.cxx
@@ -0,0 +1,138 @@
+// This file is part of Notepad4.
+// See License.txt for details about distribution and modification.
+//! Lexer for Geogebra Script.
+
+#include
+#include
+
+#include
+#include
+
+#include "ILexer.h"
+#include "Scintilla.h"
+#include "SciLexer.h"
+
+#include "WordList.h"
+#include "LexAccessor.h"
+#include "Accessor.h"
+#include "StyleContext.h"
+#include "CharacterSet.h"
+#include "StringUtils.h"
+#include "LexerModule.h"
+
+using namespace Lexilla;
+
+namespace {
+
+//KeywordIndex++Autogenerated -- start of section automatically generated
+enum {
+ KeywordIndex_Operator = 0,
+ KeywordIndex_Constant = 1,
+ KeywordIndex_Innerfunction = 2,
+ KeywordIndex_Function = 3,
+ MaxKeywordSize = 32,
+};
+//KeywordIndex--Autogenerated -- end of section automatically generated
+
+enum class KeywordType {
+ None = SCE_GGB_DEFAULT,
+ Return = 0x40,
+};
+
+constexpr bool IsSpaceEquiv(int state) noexcept {
+ return state <= SCE_GGB_TASKMARKER;
+}
+
+void ColouriseGgbDoc(Sci_PositionU startPos, Sci_Position lengthDoc, int initStyle, LexerWordList keywordLists, Accessor &styler) {
+ int lineStateLineType = 0;
+
+ KeywordType kwType = KeywordType::None;
+
+ int visibleChars = 0;
+ int chPrevNonWhite = 0;
+
+ StyleContext sc(startPos, lengthDoc, initStyle, styler);
+
+ while (sc.More()) {
+ switch (sc.state) {
+ case SCE_GGB_OPERATOR:
+ sc.SetState(SCE_GGB_DEFAULT);
+ break;
+
+ case SCE_GGB_NUMBER:
+ if (!IsNumberStart(sc.ch, sc.chNext)) {
+ sc.SetState(SCE_GGB_DEFAULT);
+ }
+ break;
+
+ case SCE_GGB_COMMENTLINE:
+ if (sc.atLineStart) {
+ sc.SetState(SCE_GGB_DEFAULT);
+ }
+ break;
+ case SCE_GGB_IDENTIFIER:
+ if (!IsAlphaNumeric(sc.ch)) {
+ char s[MaxKeywordSize];
+ sc.GetCurrent(s, sizeof(s));
+ if (keywordLists[KeywordIndex_Operator].InList(s)) {
+ sc.ChangeState(SCE_GGB_OPERATOR);
+ } else if (keywordLists[KeywordIndex_Constant].InList(s)) {
+ sc.ChangeState(SCE_GGB_CONSTANT);
+ } else if (keywordLists[KeywordIndex_Innerfunction].InList(s)) {
+ sc.ChangeState(SCE_GGB_INNERFUNCTION);
+ } else if (keywordLists[KeywordIndex_Function].InList(s)) {
+ sc.ChangeState(SCE_GGB_FUNCTION);
+ }
+ sc.SetState(SCE_GGB_DEFAULT);
+ }
+ break;
+ }
+
+
+ if (sc.state == SCE_GGB_DEFAULT) {
+ if (sc.ch == '#') {
+ sc.SetState(SCE_GGB_COMMENTLINE);
+ if (visibleChars == 0) {
+ lineStateLineType = SimpleLineStateMaskLineComment;
+ }
+ } else if (IsADigit(sc.ch)) {
+ sc.SetState(SCE_GGB_NUMBER);
+ } else if (IsIdentifierStart(sc.ch)) {
+ sc.SetState(SCE_GGB_IDENTIFIER);
+ } else if (IsAGraphic(sc.ch) && !(sc.ch == '\\' || sc.ch == '`')) {
+ sc.SetState(SCE_GGB_OPERATOR);
+ }
+ }
+
+ if (!isspacechar(sc.ch)) {
+ visibleChars++;
+ if (!IsSpaceEquiv(sc.state)) {
+ chPrevNonWhite = sc.ch;
+ }
+ }
+
+
+ if (sc.atLineEnd) {
+ styler.SetLineState(sc.currentLine, lineStateLineType);
+ lineStateLineType = 0;
+ visibleChars = 0;
+ kwType = KeywordType::None;
+ }
+ sc.Forward();
+ }
+
+ sc.Complete();
+}
+
+struct FoldLineState {
+ int lineComment;
+ int moduleImport;
+ constexpr explicit FoldLineState(int lineState) noexcept:
+ lineComment(lineState & SimpleLineStateMaskLineComment),
+ moduleImport((lineState >> 1) & 1) {
+ }
+};
+
+}
+
+extern const LexerModule lmGeogebra(SCLEX_GEOGEBRA, ColouriseGgbDoc, "Geogebra", FoldSimpleDoc);
diff --git a/scintilla/lexlib/LexerModule.cxx b/scintilla/lexlib/LexerModule.cxx
index e8db2fffed..7a4cdb9640 100644
--- a/scintilla/lexlib/LexerModule.cxx
+++ b/scintilla/lexlib/LexerModule.cxx
@@ -51,6 +51,7 @@ extern const LexerModule lmDiff;
extern const LexerModule lmDLang;
extern const LexerModule lmFortran;
extern const LexerModule lmFSharp;
+extern const LexerModule lmGeogebra;
extern const LexerModule lmGN;
extern const LexerModule lmGo;
extern const LexerModule lmGraphViz;
@@ -135,6 +136,7 @@ const LexerModule * const lexerCatalogue[] = {
&lmDLang,
&lmFortran,
&lmFSharp,
+ &lmGeogebra,
&lmGN,
&lmGo,
&lmGraphViz,
diff --git a/src/EditAutoC.cpp b/src/EditAutoC.cpp
index 05951d0482..5e052b9fe8 100644
--- a/src/EditAutoC.cpp
+++ b/src/EditAutoC.cpp
@@ -704,6 +704,9 @@ enum {
DartKeywordIndex_Metadata = 4,
FSharpKeywordIndex_Preprocessor = 2,
FSharpKeywordIndex_CommentTag = 4,
+ GeogebraKeywordIndex_Operator = 0,
+ GeogebraKeywordIndex_Constant = 1,
+ GeogebraKeywordIndex_Function = 3,
GraphVizKeywordIndex_HtmlLabel = 1,
GroovyKeywordIndex_Annotation = 7,
GroovyKeywordIndex_GroovyDoc = 9,
@@ -2494,6 +2497,7 @@ void EditToggleCommentLine(bool alternative) noexcept {
case NP2LEX_CMAKE:
case NP2LEX_COFFEESCRIPT:
case NP2LEX_CONFIG:
+ case NP2LEX_GEOGEBRA:
case NP2LEX_GN:
case NP2LEX_JAMFILE:
case NP2LEX_JULIA:
@@ -2943,6 +2947,7 @@ void InitAutoCompletionCache(LPCEDITLEXER pLex) noexcept {
case NP2LEX_BATCH:
case NP2LEX_BLOCKDIAG:
case NP2LEX_CSV:
+ case NP2LEX_GEOGEBRA:
case NP2LEX_GRAPHVIZ:
case NP2LEX_LISP:
case NP2LEX_SMALI:
diff --git a/src/EditLexer.h b/src/EditLexer.h
index c4c2c284d4..88ca3df9e3 100644
--- a/src/EditLexer.h
+++ b/src/EditLexer.h
@@ -217,6 +217,8 @@ using LPCEDITLEXER = const EDITLEXER *;
#define NP2LEX_REGISTRY 63093 // SCLEX_REGISTRY Registry File
#define NP2LEX_COFFEESCRIPT 63094 // SCLEX_COFFEESCRIPT CoffeeScript
#define NP2LEX_AUTOHOTKEY 63095 // SCLEX_AUTOHOTKEY AutoHotkey Script
+#define NP2LEX_GEOGEBRA 63096 // NP2LEX_GEOGEBRA Geogebra Script
+
// special lexers
#define NP2LEX_ANSI 63196 // SCLEX_NULL ANSI Art
diff --git a/src/EditLexers/stlGeogebra.cpp b/src/EditLexers/stlGeogebra.cpp
new file mode 100644
index 0000000000..6dae4020e1
--- /dev/null
+++ b/src/EditLexers/stlGeogebra.cpp
@@ -0,0 +1,134 @@
+#include "EditLexer.h"
+#include "EditStyleX.h"
+
+static KEYWORDLIST Keywords_Ggb = {{
+//++Autogenerated -- start of section automatically generated
+"! $ % & '' ( ) * + , - . / < = > ? False Infinity NaN Pi True Undefined [ ] ^ deg false inf infinity pi rad true xcoord "
+"ycoord zcoord { | } "
+
+, // 1 constants
+"Aqua Black Blue Brown Crimson Cyan Dark Gold Gray Green Indigo Light Lime Magenta Maroon Orange Pink Purple Red Silver "
+"Teal Turquoise Violet White Yellow euler_gamma xAxis yAxis zAxis "
+
+, // 2 innerfunction
+"LambertW( "
+"abs( acos( acosd( acosh( alt( arccos( arccosh( arcsin( arcsinh( arctan( arctanh( arg( asin( asind( asinh( "
+"atan( atan2( atan2d( atand( atanh( "
+"beta( betaRegularized( cbrt( ceil( conjugate( cos( cosIntegral( cosec( cosh( cot( cotan( cotanh( coth( csc( csch( "
+"erf( exp( expIntegral( floor( gamma( gammaRegularized( imaginary( ld( lg( ln( log( log10( log2( nroot( polygamma( psi( "
+"random( real( round( sec( sech( sgn( sign( sin( sinIntegral( sinh( sqrt( tan( tanh( x( y( z( zeta( "
+
+, // 3 function
+"ANOVA( AffineRatio( Angle( AngleBisector( Append( ApplyMatrix( "
+"Arc( AreCollinear( AreConcurrent( AreConcyclic( AreCongruent( AreEqual( AreParallel( ArePerpendicular( Area( "
+"Assume( Asymptote( AttachCopyToView( Axes( AxisStepX( AxisStepY( "
+"BarChart( Barycenter( Bernoulli( BetaDist( BezierCurve( BinomialCoefficient( BinomialDist( Bottom( BoxPlot( Button( "
+"CASLoaded( CFactor( CIFactor( CSolutions( CSolve( Cauchy( Cell( CellRange( Center( CenterView( Centroid( "
+"CharacteristicPolynomial( Checkbox( ChiSquared( ChiSquaredTest( "
+"Circle( CircularArc( CircularSector( CircumcircularArc( CircumcircularSector( Circumference( "
+"Classes( ClosestPoint( ClosestPointRegion( Coefficients( Column( ColumnName( "
+"Command( CommonDenominator( CompleteSquare( ComplexRoot( "
+"Cone( Conic( ConjugateDiameter( ConstructionStep( ContingencyTable( ContinuedFraction( ConvexHull( CopyFreeObject( "
+"Corner( CorrelationCoefficient( CountIf( Covariance( Cross( CrossRatio( Cube( Cubic( Curvature( CurvatureVector( Curve( "
+"Cylinder( "
+"DataFunction( Degree( DelaunayTriangulation( Delete( Denominator( DensityPlot( Derivative( Determinant( "
+"Difference( Dilate( Dimension( Direction( Directrix( Distance( Div( Division( Divisors( DivisorsList( DivisorsSum( "
+"Dodecahedron( Dot( DotPlot( DynamicCoordinates( "
+"Eccentricity( Eigenvalues( Eigenvectors( Element( Eliminate( Ellipse( Ends( Envelope( Erlang( Evaluate( "
+"Execute( Expand( Exponential( ExportImage( ExtendedGCD( Extremum( "
+"FDistribution( Factor( Factors( FillCells( FillColumn( FillRow( First( "
+"Fit( FitExp( FitGrowth( FitImplicit( FitLine( FitLineX( FitLog( FitLogistic( FitPoly( FitPow( FitSin( Flatten( "
+"Focus( FormulaText( FractionText( Frequency( FrequencyPolygon( FrequencyTable( FromBase( Function( FutureValue( "
+"GCD( Gamma( GeometricMean( GetTime( GroebnerDegRevLex( GroebnerLex( GroebnerLexDeg( "
+"HarmonicMean( Height( HideLayer( Histogram( HistogramRight( HyperGeometric( Hyperbola( "
+"IFactor( Icosahedron( Identity( If( ImplicitCurve( ImplicitDerivative( Incircle( IndexOf( "
+"InfiniteCone( InfiniteCylinder( InflectionPoint( InputBox( Insert( "
+"Integral( IntegralBetween( IntegralSymbolic( InteriorAngles( Intersect( IntersectConic( IntersectPath( Intersection( "
+"InverseBeta( InverseBinomial( InverseBinomialMinimumTrials( InverseCauchy( InverseChiSquared( InverseExponential( "
+"InverseFDistribution( InverseGamma( InverseHyperGeometric( InverseLaplace( InverseLogNormal( InverseLogistic( "
+"InverseNormal( InversePascal( InversePoisson( InverseTDistribution( InverseWeibull( InverseZipf( Invert( "
+"IsDefined( IsFactored( IsInRegion( IsInteger( IsPrime( IsTangent( IsVertexForm( Iteration( IterationList( "
+"Join( JordanDiagonalization( KeepIf( "
+"LCM( LUDecomposition( Laplace( Last( LeftSide( LeftSum( Length( LetterToUnicode( "
+"Limit( LimitAbove( LimitBelow( Line( LineGraph( LinearEccentricity( "
+"Locus( LocusEquation( LogNormal( Logistic( LowerSum( "
+"MAD( MajorAxis( MatrixPlot( MatrixRank( Max( Maximize( Mean( MeanX( MeanY( Median( "
+"Midpoint( Min( MinimalPolynomial( Minimize( MinimumSpanningTree( MinorAxis( MixedNumber( Mod( Mode( ModularExponent( "
+"NDerivative( NIntegral( NInvert( NSolutions( NSolve( NSolveODE( Name( Net( NextPrime( "
+"Normal( NormalQuantilePlot( Normalize( Numerator( Numeric( "
+"Object( Octahedron( Ordinal( OrdinalRank( OsculatingCircle( "
+"Pan( Parabola( Parameter( ParametricDerivative( ParseToFunction( ParseToNumber( PartialFractions( Pascal( "
+"PathParameter( Payment( PenStroke( "
+"Percentile( Perimeter( Periods( PerpendicularBisector( PerpendicularLine( PerpendicularPlane( PerpendicularVector( "
+"PieChart( Plane( PlaneBisector( PlaySound( PlotSolve( "
+"Point( PointIn( PointList( Poisson( Polar( Polygon( Polyline( Polynomial( "
+"PresentValue( PreviousPrime( PrimeFactors( Prism( Product( Prove( ProveDetails( Pyramid( "
+"QRDecomposition( Quartile1( Quartile3( "
+"RSquare( Radius( RandomBetween( RandomBinomial( RandomDiscrete( RandomElement( RandomNormal( "
+"RandomPointIn( RandomPoisson( RandomPolynomial( RandomUniform( Rate( Rationalize( Ray( ReadText( RectangleSum( "
+"ReducedRowEchelonForm( Reflect( Relation( RemovableDiscontinuity( Remove( RemoveUndefined( Rename( Repeat( ReplaceAll( "
+"ResidualPlot( Reverse( RightSide( RigidPolygon( Root( RootList( RootMeanSquare( Roots( Rotate( RotateText( Row( "
+"RunClickScript( RunUpdateScript( "
+"SD( SDX( SDY( SVD( Sample( SampleSD( SampleSDX( SampleSDY( SampleVariance( ScientificText( Sector( Segment( "
+"SelectObjects( SelectedElement( SelectedIndex( SemiMajorAxisLength( SemiMinorAxisLength( Semicircle( Sequence( "
+"SetActiveView( SetAxesRatio( SetBackgroundColor( "
+"SetCaption( SetColor( SetConditionToShowObject( SetConstructionStep( SetCoords( SetDecoration( SetDynamicColor( "
+"SetFilling( SetFixed( SetImage( SetLabelMode( SetLayer( SetLevelOfDetail( SetLineStyle( SetLineThickness( "
+"SetPerspective( SetPointSize( SetPointStyle( SetSeed( SetSpinSpeed( SetTooltipMode( SetTrace( "
+"SetValue( SetViewDirection( SetVisibleInView( "
+"Shear( ShortestDistance( ShowAxes( ShowGrid( ShowLabel( ShowLayer( Shuffle( Side( SigmaXX( SigmaXY( SigmaYY( Simplify( "
+"Slider( Slope( SlopeField( SlowPlot( Solutions( Solve( SolveCubic( SolveODE( SolveQuartic( Sort( "
+"Spearman( Sphere( Spline( Split( StartAnimation( StartRecord( StemPlot( StepGraph( StickGraph( Stretch( "
+"Substitute( Sum( SumSquaredErrors( SurdText( Surface( Sxx( Sxy( Syy( "
+"TDistribution( TMean2Estimate( TMeanEstimate( TTest( TTest2( TTestPaired( TableText( Take( Tangent( TaylorPolynomial( "
+"Tetrahedron( Text( TextToUnicode( TiedRank( ToBase( ToComplex( ToExponential( ToPoint( ToPolar( ToolImage( Top( "
+"Translate( Transpose( TrapezoidalSum( TravelingSalesman( "
+"TriangleCenter( TriangleCurve( Triangular( TrigCombine( TrigExpand( TrigSimplify( Trilinear( "
+"Turtle( TurtleBack( TurtleDown( TurtleForward( TurtleLeft( TurtleRight( TurtleUp( Type( "
+"UnicodeToLetter( UnicodeToText( Uniform( Union( Unique( UnitPerpendicularVector( UnitVector( "
+"UpdateConstruction( UpperSum( "
+"Variance( Vector( Vertex( VerticalText( Volume( Voronoi( Weibull( "
+"ZMean2Estimate( ZMean2Test( ZMeanEstimate( ZMeanTest( "
+"ZProportion2Estimate( ZProportion2Test( ZProportionEstimate( ZProportionTest( Zip( Zipf( ZoomIn( ZoomOut( "
+"mad( mean( stdev( stdevp( "
+
+, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr
+//--Autogenerated -- end of section automatically generated
+
+}};
+
+static EDITSTYLE Styles_GGB[] = {
+ EDITSTYLE_DEFAULT,
+ { SCE_GGB_WORD, NP2StyleX_Keyword, L"fore:#0000FF" },
+ { SCE_GGB_CONSTANT, NP2StyleX_Constant, L"fore:#307300" },
+ { SCE_GGB_INNERFUNCTION, NP2StyleX_FunctionDefinition, L"bold; fore:#A46000" },
+ { SCE_GGB_FUNCTION, NP2StyleX_Function, L"fore:#A46000" },
+ { SCE_GGB_COMMENTLINE, NP2StyleX_Comment, L"fore:#608060" },
+ { SCE_GGB_NUMBER, NP2StyleX_Number, L"fore:#FF0000" },
+ { SCE_GGB_OPERATOR, NP2StyleX_Operator, L"fore:#B000B0" },
+};
+
+EDITLEXER lexGeogebra = {
+ SCLEX_GEOGEBRA, NP2LEX_GEOGEBRA,
+//Settings++Autogenerated -- start of section automatically generated
+ LexerAttr_NoBlockComment |
+ LexerAttr_PlainTextFile,
+ TAB_WIDTH_4, INDENT_WIDTH_4,
+ (1 << 0) | (1 << 1), // level1, level2
+ 0,
+ '\0', 0, 0,
+ 0,
+ 0, 0,
+ 0, 0
+ , KeywordAttr32(0, KeywordAttr_PreSorted) // operators
+ | KeywordAttr32(1, KeywordAttr_PreSorted) // constants
+ | KeywordAttr32(2, KeywordAttr_PreSorted) // innerfunction
+ | KeywordAttr32(3, KeywordAttr_PreSorted) // function
+ , SCE_GGB_COMMENTLINE,
+ 0, 0,
+//Settings--Autogenerated -- end of section automatically generated
+ EDITLEXER_HOLE(L"Geogebra Script", Styles_GGB),
+ L"ggb",
+ &Keywords_Ggb,
+ Styles_GGB
+};
diff --git a/src/Styles.cpp b/src/Styles.cpp
index 745e7ae802..066c82bb66 100644
--- a/src/Styles.cpp
+++ b/src/Styles.cpp
@@ -85,6 +85,7 @@ extern EDITLEXER lexDiff;
extern EDITLEXER lexFSharp;
extern EDITLEXER lexFortran;
+extern EDITLEXER lexGeogebra;
extern EDITLEXER lexGN;
extern EDITLEXER lexGo;
extern EDITLEXER lexGradle;
@@ -198,6 +199,7 @@ static PEDITLEXER pLexArray[] = {
&lexFSharp,
&lexFortran,
+ &lexGeogebra,
&lexGN,
&lexGo,
&lexGradle,
diff --git a/tools/KeywordCore.py b/tools/KeywordCore.py
index 6c70e157b7..8b6d592dc9 100644
--- a/tools/KeywordCore.py
+++ b/tools/KeywordCore.py
@@ -256,14 +256,14 @@ def remove_duplicate_lower(keywords, duplicate):
def first_word_on_each_line(doc):
return re.findall(r'^\s*(\w+)', doc, re.MULTILINE)
-
+
def parse_actionscript_api_file(path):
sections = read_api_file(path, '//')
keywordMap = {}
for key, doc in sections:
if key in ('keywords', 'types', 'directive'):
keywordMap[key] = doc.split()
- if key == 'class':
+ elif key == 'class':
items = re.findall(r'class\s+(\w+)', doc)
keywordMap[key] = items
elif key == 'functions':
@@ -1035,6 +1035,40 @@ def parse_fsharp_api_file(path):
('comment tag', CSharpKeywordMap['comment tag'], KeywordAttr.NoLexer | KeywordAttr.NoAutoComp | KeywordAttr.Special),
]
+def parse_geogebra_api_file(path):
+ sections = read_api_file(path, '//')
+ keywordMap = {}
+ for key, doc in sections:
+ if key == 'operators':
+ keywordMap[key] = doc.split()
+ elif key == 'constants':
+ keywordMap[key] = doc.split()
+ elif key == 'innerfunction':
+ items = re.findall(r'(\w+\()', doc)
+ keywordMap[key] = items
+ elif key == 'function':
+ items = []
+ lines = re.split(r'\n', doc)
+ for line in lines:
+ if (re.match(r'^(?!.*.Syntax).*$', line)):
+ parts = re.split(r'=', line)
+ if len(parts) == 2:
+ items.append(parts[1]+'(')
+ keywordMap[key] = items
+
+ RemoveDuplicateKeyword(keywordMap, [
+ 'operators',
+ 'constants',
+ 'innerfunction',
+ 'function',
+ ])
+ return [
+ ('operators', keywordMap['operators'], KeywordAttr.Special),
+ ('constants', keywordMap['constants'], KeywordAttr.Special),
+ ('innerfunction', keywordMap['innerfunction'], KeywordAttr.Default),
+ ('function', keywordMap['function'], KeywordAttr.Special),
+ ]
+
def parse_gn_api_file(path):
sections = read_api_file(path, '#')
keywordMap = {}
diff --git a/tools/KeywordUpdate.py b/tools/KeywordUpdate.py
index 38f41abcc8..a73c848021 100644
--- a/tools/KeywordUpdate.py
+++ b/tools/KeywordUpdate.py
@@ -33,6 +33,7 @@
('NP2LEX_FORTRAN', 'stlFortran.cpp', 'LexFortran.cxx', 'Fortran.f', 0, parse_fortran_api_file),
+ ('NP2LEX_GEOGEBRA', 'stlGeogebra.cpp', 'LexGeogebra.cxx', 'Geogebra.ggb', 1, parse_geogebra_api_file),
('NP2LEX_GN', 'stlGN.cpp', 'LexGN.cxx', 'GN.gn', 0, parse_gn_api_file),
('NP2LEX_GRAPHVIZ', 'stlGraphViz.cpp', 'LexGraphViz.cxx', 'GraphViz.dot', 0, parse_graphviz_api_file),
('NP2LEX_BLOCKDIAG', 'stlBlockdiag.cpp', 'LexGraphViz.cxx', 'blockdiag.diag', 0, parse_graphviz_api_file),
diff --git a/tools/LexerConfig.py b/tools/LexerConfig.py
index 0540d4ec66..e35ad0182b 100644
--- a/tools/LexerConfig.py
+++ b/tools/LexerConfig.py
@@ -435,6 +435,14 @@ class KeywordAttr(IntFlag):
'string_style_range': ['SCE_FSHARP_CHARACTER', 'SCE_FSHARP_FORMAT_SPECIFIER'],
},
+ 'NP2LEX_GEOGEBRA': {
+ 'default_encoding': 'utf-8',
+ 'line_comment_string': '#',
+ 'comment_style_marker': 'SCE_GGB_COMMENTLINE',
+ 'escape_char_start': NoEscapeCharacter,
+ 'extra_word_char': '-',
+ 'plain_text_file': True,
+ },
'NP2LEX_GN': {
'line_comment_string': '#',
'comment_style_marker': 'SCE_GN_COMMENT',
diff --git a/tools/lang/Geogebra.ggb b/tools/lang/Geogebra.ggb
new file mode 100644
index 0000000000..a9fc74cecd
--- /dev/null
+++ b/tools/lang/Geogebra.ggb
@@ -0,0 +1,1260 @@
+// https://github.com/geogebra/geogebra
+// https://geogebra.github.io/docs/manual/en/
+
+
+//! operators ===========================================================
++ - * / ^ ! ( ) [ ] { } = | ! & - < > % ? . , '' $
+Undefined NaN pi Pi deg Infinity inf infinity rad true True false False xcoord ycoord zcoord
+
+//! constants ===========================================================
+xAxis
+yAxis
+zAxis
+euler_gamma
+Aqua
+Black
+Blue
+Brown
+Crimson
+Cyan
+Dark Blue
+Dark Gray
+Dark Green
+Gold
+Gray
+Green
+Indigo
+Light Blue
+Light Gray
+Light Green
+Light Orange
+Light Purple
+Light Violet
+Light Yellow
+Lime
+Magenta
+Maroon
+Orange
+Pink
+Purple
+Red
+Silver
+Teal
+Turquoise
+Violet
+White
+Yellow
+
+//! innerFunction ===========================================================
+x( )
+y( )
+z( )
+arg( )
+conjugate( )
+real( )
+imaginary( )
+abs( )
+alt( )
+sgn( )
+sign()
+floor( )
+ceil( )
+round(x)
+round(x, y)
+sqrt( )
+cbrt( )
+nroot(x, n)
+random( )
+exp( )
+ℯ^x^
+ln( )
+log2( )
+ld( )
+log10( )
+log( )
+lg( )
+log(b, x )
+cos( )
+sin( )
+tan( )
+sec()
+csc()
+cosec()
+cot()
+cotan()
+acos( )
+arccos( )
+acosd( )
+asin( )
+arcsin( )
+asind( )
+atan( )
+arctan( )
+atand( )
+atan2(y,x)
+atan2d(y, x)
+cosh( )
+sinh( )
+tanh( )
+sech( )
+csch( )
+coth( )
+cotanh()
+acosh( )
+arccosh( )
+asinh( )
+arcsinh( )
+atanh( )
+arctanh( )
+beta(a, b)
+beta(a, b, x)
+betaRegularized(a, b, x)
+gamma( x)
+gamma(a, x)
+gammaRegularized(a, x)
+erf(x)
+psi(x)
+polygamma(m, x)
+sinIntegral(x)
+cosIntegral(x)
+expIntegral(x)
+zeta(x)
+LambertW(x, 0)
+LambertW(x,-1)
+
+//! Function ===========================================================
+# For further details, please see https://www.geogebra.org/license
+ANOVA=ANOVA
+ANOVA.Syntax=[ , , ... ]
+AffineRatio=AffineRatio
+AffineRatio.Syntax=[ , , ]
+Angle=Angle
+Angle.Syntax=[